summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobody <>2003-12-13 20:12:34 +0000
committernobody <>2003-12-13 20:12:34 +0000
commit03edb3e6840d03ad00ef37756c6de639d4f586dc (patch)
tree07b9d1afafc36fe9970771b7a4eab9f3e20f46b4
parentd48ee38f3dbd6806cff2ebee97cdd21e905df7f5 (diff)
downloadbinutils-gdb-03edb3e6840d03ad00ef37756c6de639d4f586dc.tar.gz
This commit was manufactured by cvs2svn to create tagcarlton_dictionary-20021115-merge
'carlton_dictionary-20021115-merge'. Sprout from drow-cplus-branch 2002-10-04 22:17:37 UTC nobody 'This commit was manufactured by cvs2svn to create branch 'drow-cplus-' Cherrypick from drow-cplus-branch 2003-12-13 20:12:33 UTC nobody 'This commit was manufactured by cvs2svn to create branch 'drow-cplus-': bfd/mach-o-target.c bfd/pef-traceback.h bfd/pef.h gdb/config/i386/interix.mh gdb/config/i386/interix.mt gdb/config/i386/nm-interix.h gdb/testsuite/gdb.mi/gdb792.cc Cherrypick from drow-cplus-branch 2002-10-25 15:43:04 UTC nobody 'This commit was manufactured by cvs2svn to create branch 'drow-cplus-': gdb/config/i386/obsd.mt gdb/i386obsd-tdep.c gdb/testsuite/gdb.asm/mips.inc Cherrypick from master 2002-11-15 15:50:21 UTC Andrew Cagney <cagney@redhat.com> '2002-11-14 Andrew Cagney <ac131313@redhat.com>': ChangeLog Makefile.def Makefile.in Makefile.tpl bfd/ChangeLog bfd/Makefile.am bfd/Makefile.in bfd/aoutx.h bfd/archive.c bfd/archures.c bfd/bfd-in.h bfd/bfd-in2.h bfd/bfd.c bfd/binary.c bfd/coff-arm.c bfd/coff-h8300.c bfd/coff-stgo32.c bfd/coff-tic4x.c bfd/coffcode.h bfd/coffgen.c bfd/cofflink.c bfd/config.bfd bfd/configure bfd/configure.in bfd/doc/ChangeLog bfd/doc/Makefile.am bfd/doc/Makefile.in bfd/dwarf2.c bfd/ecoff.c bfd/elf-bfd.h bfd/elf-eh-frame.c bfd/elf.c bfd/elf32-arc.c bfd/elf32-arm.h bfd/elf32-cris.c bfd/elf32-d10v.c bfd/elf32-h8300.c bfd/elf32-i386.c bfd/elf32-ip2k.c bfd/elf32-m32r.c bfd/elf32-m68hc11.c bfd/elf32-m68hc12.c bfd/elf32-or32.c bfd/elf32-ppc.c bfd/elf32-sh.c bfd/elf32-sh64-com.c bfd/elf32-sh64.c bfd/elf32-v850.c bfd/elf64-alpha.c bfd/elf64-hppa.c bfd/elf64-mips.c bfd/elf64-mmix.c bfd/elf64-ppc.c bfd/elf64-ppc.h bfd/elf64-sh64.c bfd/elf64-sparc.c bfd/elfarm-nabi.c bfd/elfcode.h bfd/elfcore.h bfd/elflink.c bfd/elflink.h bfd/elfxx-ia64.c bfd/elfxx-mips.c bfd/elfxx-target.h bfd/format.c bfd/gen-aout.c bfd/libbfd-in.h bfd/libbfd.c bfd/libbfd.h bfd/libcoff.h bfd/linker.c bfd/mach-o.c bfd/mach-o.h bfd/merge.c bfd/opncls.c bfd/pef.c bfd/po/BLD-POTFILES.in bfd/po/SRC-POTFILES.in bfd/po/da.po bfd/reloc.c bfd/reloc16.c bfd/section.c bfd/simple.c bfd/srec.c bfd/stabs.c bfd/syms.c bfd/targets.c bfd/version.h bfd/vms-gsd.c bfd/vms-hdr.c bfd/vms.c bfd/xcofflink.c bfd/xsym.c bfd/xsym.h config/ChangeLog configure.in gdb/ChangeLog gdb/MAINTAINERS gdb/Makefile.in gdb/NEWS gdb/PROBLEMS gdb/a68v-nat.c gdb/ada-lang.c gdb/alpha-nat.c gdb/alpha-tdep.c gdb/arch-utils.c gdb/arm-tdep.c gdb/blockframe.c gdb/breakpoint.c gdb/breakpoint.h gdb/buildsym.c gdb/buildsym.h gdb/c-exp.y gdb/c-lang.h gdb/c-typeprint.c gdb/cli/cli-cmds.c gdb/coffread.c gdb/complaints.c gdb/complaints.h gdb/config.in gdb/config/alpha/nm-fbsd.h gdb/config/alpha/nm-linux.h gdb/config/alpha/nm-nbsd.h gdb/config/alpha/nm-osf.h gdb/config/djgpp/fnchange.lst gdb/config/h8500/tm-h8500.h gdb/config/i386/i386gnu.mt gdb/config/i386/i386sco5.mt gdb/config/i386/i386v4.mt gdb/config/i386/i386v42mp.mt gdb/config/i386/ncr3000.mt gdb/config/i386/nm-i386sco.h gdb/config/i386/nm-i386v42mp.h gdb/config/i386/nm-linux.h gdb/config/i386/nm-ptx4.h gdb/config/i386/nm-symmetry.h gdb/config/i386/tm-i386sol2.h gdb/config/i386/tm-ptx.h gdb/config/i386/xm-i386sco.h gdb/config/m32r/tm-m32r.h gdb/config/m68k/nm-sun3.h gdb/config/m68k/tm-delta68.h gdb/config/m68k/tm-linux.h gdb/config/mips/nm-irix4.h gdb/config/mips/nm-irix5.h gdb/config/mips/tm-embed.h gdb/config/mips/tm-irix3.h gdb/config/mips/tm-irix6.h gdb/config/mn10200/tm-mn10200.h gdb/config/nm-gnu.h gdb/config/nm-m3.h gdb/config/pa/nm-hppah.h gdb/config/pa/tm-hppa.h gdb/config/pa/tm-hppa64.h gdb/config/rs6000/tm-rs6000.h gdb/config/sparc/nm-nbsd.h gdb/config/sparc/nm-sun4os4.h gdb/config/sparc/nm-sun4sol2.h gdb/config/sparc/tm-sparc.h gdb/config/sparc/tm-sparclet.h gdb/config/tm-sysv4.h gdb/config/z8k/tm-z8k.h gdb/configure gdb/configure.in gdb/configure.tgt gdb/core-sol2.c gdb/corefile.c gdb/corelow.c gdb/cp-valprint.c gdb/cris-tdep.c gdb/d10v-tdep.c gdb/dbxread.c gdb/defs.h gdb/demangle.c gdb/doc/ChangeLog gdb/doc/gdb.texinfo gdb/doc/gdbint.texinfo gdb/dummy-frame.c gdb/dummy-frame.h gdb/dwarf2cfi.c gdb/dwarf2cfi.h gdb/dwarf2read.c gdb/dwarfread.c gdb/elfread.c gdb/event-loop.c gdb/event-top.c gdb/expression.h gdb/f-exp.y gdb/f-valprint.c gdb/findvar.c gdb/frame.c gdb/frame.h gdb/frv-tdep.c gdb/gdb_indent.sh gdb/gdb_thread_db.h gdb/gdbarch.c gdb/gdbarch.h gdb/gdbarch.sh gdb/gdbcore.h gdb/gdbtypes.c gdb/gdbtypes.h gdb/gnu-nat.c gdb/go32-nat.c gdb/h8300-tdep.c gdb/h8500-tdep.c gdb/hp300ux-nat.c gdb/hppa-tdep.c gdb/hppab-nat.c gdb/hppah-nat.c gdb/hppam3-nat.c gdb/hpread.c gdb/hpux-thread.c gdb/i386-interix-nat.c gdb/i386-interix-tdep.c gdb/i386-linux-nat.c gdb/i386-linux-tdep.c gdb/i386-tdep.c gdb/i386-tdep.h gdb/i386bsd-nat.c gdb/i386gnu-nat.c gdb/i386obsd-nat.c gdb/i386v-nat.c gdb/i387-tdep.c gdb/ia64-aix-nat.c gdb/ia64-linux-nat.c gdb/ia64-tdep.c gdb/infcmd.c gdb/infptrace.c gdb/infrun.c gdb/irix4-nat.c gdb/irix5-nat.c gdb/jv-exp.y gdb/language.c gdb/language.h gdb/lin-lwp.c gdb/linespec.c gdb/lynx-nat.c gdb/m2-exp.y gdb/m68hc11-tdep.c gdb/m68k-tdep.c gdb/m68knbsd-nat.c gdb/macroscope.c gdb/macrotab.c gdb/macrotab.h gdb/mcore-tdep.c gdb/mdebugread.c gdb/mi/ChangeLog gdb/mi/gdbmi.texinfo gdb/mi/mi-cmd-stack.c gdb/mi/mi-cmd-var.c gdb/mi/mi-main.c gdb/mips-linux-nat.c gdb/mips-linux-tdep.c gdb/mips-nat.c gdb/mips-tdep.c gdb/mipsm3-nat.c gdb/mipsv4-nat.c gdb/mn10300-tdep.c gdb/monitor.c gdb/ns32k-tdep.c gdb/ns32knbsd-nat.c gdb/objc-exp.y gdb/objc-lang.c gdb/p-exp.y gdb/parse.c gdb/ppc-bdm.c gdb/ppc-sysv-tdep.c gdb/printcmd.c gdb/ptx4-nat.c gdb/regcache.c gdb/regcache.h gdb/reggroups.c gdb/reggroups.h gdb/remote-array.c gdb/remote-e7000.c gdb/remote-es.c gdb/remote-mips.c gdb/remote-rdi.c gdb/remote-rdp.c gdb/remote-sds.c gdb/remote-sim.c gdb/remote-st.c gdb/remote-vx.c gdb/remote-vx68.c gdb/remote-vxmips.c gdb/remote-vxsparc.c gdb/remote.c gdb/rs6000-tdep.c gdb/s390-tdep.c gdb/sh-tdep.c gdb/sol-thread.c gdb/solib-sunos.c gdb/solib-svr4.c gdb/solib-svr4.h gdb/source.c gdb/sparc-nat.c gdb/sparc-tdep.c gdb/stabsread.c gdb/stabsread.h gdb/stack.c gdb/sun3-nat.c gdb/symfile.c gdb/symfile.h gdb/symm-nat.c gdb/symtab.c gdb/symtab.h gdb/target.c gdb/target.h gdb/testsuite/ChangeLog gdb/testsuite/gdb.asm/asm-source.exp gdb/testsuite/gdb.asm/asmsrc1.s gdb/testsuite/gdb.asm/asmsrc2.s gdb/testsuite/gdb.asm/common.inc gdb/testsuite/gdb.base/constvars.c gdb/testsuite/gdb.base/constvars.exp gdb/testsuite/gdb.base/default.exp gdb/testsuite/gdb.base/help.exp gdb/testsuite/gdb.chill/ChangeLog gdb/testsuite/gdb.chill/chexp.exp gdb/testsuite/gdb.chill/pr-5016.exp gdb/testsuite/gdb.mi/ChangeLog gdb/testsuite/gdb.mi/gdb792.exp gdb/testsuite/gdb.mi/mi-console.exp gdb/testsuite/gdb.mi/mi-disassemble.exp gdb/testsuite/gdb.mi/mi-eval.exp gdb/testsuite/gdb.mi/mi-read-memory.exp gdb/testsuite/gdb.mi/mi-regs.exp gdb/testsuite/gdb.mi/mi-return.exp gdb/testsuite/gdb.mi/mi-stack.exp gdb/testsuite/gdb.mi/mi-stepi.exp gdb/testsuite/gdb.mi/mi-var-block.exp gdb/testsuite/gdb.mi/mi-var-cmd.exp gdb/testsuite/gdb.mi/mi-watch.exp gdb/testsuite/gdb.mi/mi1-console.exp gdb/testsuite/gdb.mi/mi1-disassemble.exp gdb/testsuite/gdb.mi/mi1-eval.exp gdb/testsuite/gdb.mi/mi1-read-memory.exp gdb/testsuite/gdb.mi/mi1-regs.exp gdb/testsuite/gdb.mi/mi1-return.exp gdb/testsuite/gdb.mi/mi1-stack.exp gdb/testsuite/gdb.mi/mi1-stepi.exp gdb/testsuite/gdb.mi/mi1-var-block.exp gdb/testsuite/gdb.mi/mi1-var-cmd.exp gdb/testsuite/gdb.mi/mi1-watch.exp gdb/testsuite/gdb.threads/schedlock.c gdb/testsuite/lib/mi-support.exp gdb/thread-db.c gdb/tui/ChangeLog gdb/tui/tuiIO.c gdb/tui/tuiStack.c gdb/tui/tuiWin.c gdb/utils.c gdb/v850-tdep.c gdb/v850ice.c gdb/valops.c gdb/value.h gdb/values.c gdb/varobj.c gdb/vax-tdep.c gdb/version.in gdb/win32-nat.c gdb/wince.c gdb/x86-64-linux-nat.c gdb/x86-64-linux-tdep.c gdb/x86-64-tdep.c gdb/x86-64-tdep.h gdb/xcoffread.c gdb/xstormy16-tdep.c gdb/z8k-tdep.c include/ChangeLog include/ansidecl.h include/bfdlink.h include/elf/ChangeLog include/elf/sh.h include/getopt.h include/opcode/ChangeLog include/opcode/cgen.h include/opcode/tic4x.h include/partition.h libiberty/ChangeLog libiberty/config.table libiberty/cplus-dem.c opcodes/ChangeLog opcodes/Makefile.am opcodes/Makefile.in opcodes/ia64-asmtab.c opcodes/ia64-gen.c opcodes/ia64-opc-a.c opcodes/ia64-opc-b.c opcodes/ia64-opc-d.c opcodes/ia64-opc-f.c opcodes/ia64-opc-i.c opcodes/ia64-opc-m.c opcodes/ia64-opc-x.c opcodes/m68hc11-dis.c opcodes/ppc-dis.c opcodes/ppc-opc.c opcodes/sparc-opc.c sim/common/ChangeLog sim/common/Make-common.in sim/common/cgen-trace.h sim/common/run.c sim/d10v/ChangeLog sim/d10v/simops.c sim/igen/ChangeLog sim/igen/gen-engine.c sim/sh/ChangeLog sim/sh/gencode.c sim/sh/interp.c Delete: bfd/elf32-i386-fbsd.c bfd/elf32-i386qnx.c bfd/elf32-ppcqnx.c bfd/elf32-qnx.h bfd/elf32-sh-lin.c bfd/elf32-sh-nbsd.c bfd/elf32-sh64-nbsd.c bfd/elf32-shqnx.c bfd/elf64-alpha-fbsd.c bfd/elf64-sh64-nbsd.c bfd/elfarmqnx-nabi.c config/mpw-mh-mpw config/mpw/ChangeLog config/mpw/MoveIfChange config/mpw/README config/mpw/forward-include config/mpw/g-mpw-make.sed config/mpw/mpw-touch config/mpw/mpw-true config/mpw/null-command config/mpw/open-brace config/mpw/tr-7to8-src config/mpw/true gdb/config/i386/tm-i386v4.h gdb/config/i386/tm-i386v42mp.h
-rw-r--r--ChangeLog25
-rw-r--r--Makefile.def1
-rw-r--r--Makefile.in20
-rw-r--r--Makefile.tpl73
-rw-r--r--bfd/ChangeLog785
-rw-r--r--bfd/Makefile.am113
-rw-r--r--bfd/Makefile.in124
-rw-r--r--bfd/aoutx.h88
-rw-r--r--bfd/archive.c11
-rw-r--r--bfd/archures.c75
-rw-r--r--bfd/bfd-in.h6
-rw-r--r--bfd/bfd-in2.h110
-rw-r--r--bfd/bfd.c168
-rw-r--r--bfd/binary.c2
-rw-r--r--bfd/coff-arm.c16
-rw-r--r--bfd/coff-h8300.c97
-rw-r--r--bfd/coff-stgo32.c99
-rw-r--r--bfd/coff-tic4x.c26
-rw-r--r--bfd/coffcode.h2
-rw-r--r--bfd/coffgen.c2
-rw-r--r--bfd/cofflink.c3
-rw-r--r--bfd/config.bfd52
-rwxr-xr-xbfd/configure528
-rw-r--r--bfd/configure.in58
-rw-r--r--bfd/doc/ChangeLog8
-rw-r--r--bfd/doc/Makefile.am2
-rw-r--r--bfd/doc/Makefile.in3
-rw-r--r--bfd/dwarf2.c150
-rw-r--r--bfd/ecoff.c12
-rw-r--r--bfd/elf-bfd.h105
-rw-r--r--bfd/elf-eh-frame.c196
-rw-r--r--bfd/elf.c61
-rw-r--r--bfd/elf32-arc.c5
-rw-r--r--bfd/elf32-arm.h66
-rw-r--r--bfd/elf32-cris.c3
-rw-r--r--bfd/elf32-d10v.c2
-rw-r--r--bfd/elf32-h8300.c217
-rw-r--r--bfd/elf32-i386-fbsd.c56
-rw-r--r--bfd/elf32-i386.c93
-rw-r--r--bfd/elf32-i386qnx.c30
-rw-r--r--bfd/elf32-ip2k.c2
-rw-r--r--bfd/elf32-m32r.c30
-rw-r--r--bfd/elf32-m68hc11.c144
-rw-r--r--bfd/elf32-m68hc12.c2
-rw-r--r--bfd/elf32-or32.c2
-rw-r--r--bfd/elf32-ppc.c3
-rw-r--r--bfd/elf32-ppcqnx.c32
-rw-r--r--bfd/elf32-qnx.h111
-rw-r--r--bfd/elf32-sh-lin.c110
-rw-r--r--bfd/elf32-sh-nbsd.c29
-rw-r--r--bfd/elf32-sh.c1484
-rw-r--r--bfd/elf32-sh64-com.c2
-rw-r--r--bfd/elf32-sh64.c66
-rw-r--r--bfd/elf32-shqnx.c31
-rw-r--r--bfd/elf32-v850.c8
-rw-r--r--bfd/elf64-alpha-fbsd.c56
-rw-r--r--bfd/elf64-alpha.c58
-rw-r--r--bfd/elf64-hppa.c5
-rw-r--r--bfd/elf64-mips.c25
-rw-r--r--bfd/elf64-mmix.c5
-rw-r--r--bfd/elf64-ppc.c113
-rw-r--r--bfd/elf64-ppc.h2
-rw-r--r--bfd/elf64-sh64-nbsd.c29
-rw-r--r--bfd/elf64-sh64.c84
-rw-r--r--bfd/elf64-sparc.c29
-rw-r--r--bfd/elfarm-nabi.c6
-rw-r--r--bfd/elfarmqnx-nabi.c34
-rw-r--r--bfd/elfcode.h60
-rw-r--r--bfd/elfcore.h46
-rw-r--r--bfd/elflink.c50
-rw-r--r--bfd/elflink.h409
-rw-r--r--bfd/elfxx-ia64.c14
-rw-r--r--bfd/elfxx-mips.c129
-rw-r--r--bfd/elfxx-target.h15
-rw-r--r--bfd/format.c58
-rw-r--r--bfd/gen-aout.c4
-rw-r--r--bfd/libbfd-in.h3
-rw-r--r--bfd/libbfd.c12
-rw-r--r--bfd/libbfd.h11
-rw-r--r--bfd/libcoff.h2
-rw-r--r--bfd/linker.c16
-rw-r--r--bfd/mach-o-target.c117
-rw-r--r--bfd/mach-o.c2194
-rw-r--r--bfd/mach-o.h490
-rw-r--r--bfd/merge.c6
-rw-r--r--bfd/opncls.c70
-rw-r--r--bfd/pef-traceback.h215
-rw-r--r--bfd/pef.c1312
-rw-r--r--bfd/pef.h186
-rw-r--r--bfd/po/BLD-POTFILES.in1
-rw-r--r--bfd/po/SRC-POTFILES.in18
-rw-r--r--bfd/po/da.po340
-rw-r--r--bfd/reloc.c47
-rw-r--r--bfd/reloc16.c71
-rw-r--r--bfd/section.c5
-rw-r--r--bfd/simple.c212
-rw-r--r--bfd/srec.c4
-rw-r--r--bfd/stabs.c20
-rw-r--r--bfd/syms.c10
-rw-r--r--bfd/targets.c78
-rw-r--r--bfd/version.h4
-rw-r--r--bfd/vms-gsd.c8
-rw-r--r--bfd/vms-hdr.c1
-rw-r--r--bfd/vms.c2
-rw-r--r--bfd/xcofflink.c6
-rw-r--r--bfd/xsym.c2484
-rw-r--r--bfd/xsym.h701
-rw-r--r--config/ChangeLog6
-rw-r--r--config/mpw-mh-mpw157
-rw-r--r--config/mpw/ChangeLog53
-rw-r--r--config/mpw/MoveIfChange19
-rw-r--r--config/mpw/README23
-rw-r--r--config/mpw/forward-include3
-rw-r--r--config/mpw/g-mpw-make.sed293
-rw-r--r--config/mpw/mpw-touch7
-rw-r--r--config/mpw/mpw-true1
-rw-r--r--config/mpw/null-command1
-rw-r--r--config/mpw/open-brace4
-rw-r--r--config/mpw/tr-7to8-src9
-rw-r--r--config/mpw/true1
-rw-r--r--configure.in11
-rw-r--r--gdb/ChangeLog1316
-rw-r--r--gdb/MAINTAINERS5
-rw-r--r--gdb/Makefile.in83
-rw-r--r--gdb/NEWS5
-rw-r--r--gdb/PROBLEMS15
-rw-r--r--gdb/a68v-nat.c26
-rw-r--r--gdb/ada-lang.c13
-rw-r--r--gdb/alpha-nat.c26
-rw-r--r--gdb/alpha-tdep.c2
-rw-r--r--gdb/arch-utils.c2
-rw-r--r--gdb/arm-tdep.c12
-rw-r--r--gdb/blockframe.c870
-rw-r--r--gdb/breakpoint.c23
-rw-r--r--gdb/breakpoint.h11
-rw-r--r--gdb/buildsym.c14
-rw-r--r--gdb/buildsym.h3
-rw-r--r--gdb/c-exp.y19
-rw-r--r--gdb/c-lang.h3
-rw-r--r--gdb/c-typeprint.c32
-rw-r--r--gdb/cli/cli-cmds.c97
-rw-r--r--gdb/coffread.c25
-rw-r--r--gdb/complaints.c2
-rw-r--r--gdb/complaints.h18
-rw-r--r--gdb/config.in5
-rw-r--r--gdb/config/alpha/nm-fbsd.h2
-rw-r--r--gdb/config/alpha/nm-linux.h2
-rw-r--r--gdb/config/alpha/nm-nbsd.h2
-rw-r--r--gdb/config/alpha/nm-osf.h2
-rw-r--r--gdb/config/djgpp/fnchange.lst14
-rw-r--r--gdb/config/h8500/tm-h8500.h12
-rw-r--r--gdb/config/i386/i386gnu.mt2
-rw-r--r--gdb/config/i386/i386sco5.mt2
-rw-r--r--gdb/config/i386/i386v4.mt2
-rw-r--r--gdb/config/i386/i386v42mp.mt2
-rw-r--r--gdb/config/i386/interix.mh9
-rw-r--r--gdb/config/i386/interix.mt3
-rw-r--r--gdb/config/i386/ncr3000.mt2
-rw-r--r--gdb/config/i386/nm-i386sco.h8
-rw-r--r--gdb/config/i386/nm-i386v42mp.h69
-rw-r--r--gdb/config/i386/nm-interix.h (renamed from bfd/elf32-sh64-nbsd.c)30
-rw-r--r--gdb/config/i386/nm-linux.h3
-rw-r--r--gdb/config/i386/nm-ptx4.h2
-rw-r--r--gdb/config/i386/nm-symmetry.h2
-rw-r--r--gdb/config/i386/obsd.mt3
-rw-r--r--gdb/config/i386/tm-i386sol2.h2
-rw-r--r--gdb/config/i386/tm-i386v4.h39
-rw-r--r--gdb/config/i386/tm-i386v42mp.h93
-rw-r--r--gdb/config/i386/tm-ptx.h2
-rw-r--r--gdb/config/i386/xm-i386sco.h5
-rw-r--r--gdb/config/m32r/tm-m32r.h4
-rw-r--r--gdb/config/m68k/nm-sun3.h2
-rw-r--r--gdb/config/m68k/tm-delta68.h4
-rw-r--r--gdb/config/m68k/tm-linux.h6
-rw-r--r--gdb/config/mips/nm-irix4.h2
-rw-r--r--gdb/config/mips/nm-irix5.h2
-rw-r--r--gdb/config/mips/tm-embed.h2
-rw-r--r--gdb/config/mips/tm-irix3.h5
-rw-r--r--gdb/config/mips/tm-irix6.h5
-rw-r--r--gdb/config/mn10200/tm-mn10200.h8
-rw-r--r--gdb/config/nm-gnu.h2
-rw-r--r--gdb/config/nm-m3.h2
-rw-r--r--gdb/config/pa/nm-hppah.h2
-rw-r--r--gdb/config/pa/tm-hppa.h131
-rw-r--r--gdb/config/pa/tm-hppa64.h10
-rw-r--r--gdb/config/rs6000/tm-rs6000.h5
-rw-r--r--gdb/config/sparc/nm-nbsd.h2
-rw-r--r--gdb/config/sparc/nm-sun4os4.h2
-rw-r--r--gdb/config/sparc/nm-sun4sol2.h2
-rw-r--r--gdb/config/sparc/tm-sparc.h11
-rw-r--r--gdb/config/sparc/tm-sparclet.h8
-rw-r--r--gdb/config/tm-sysv4.h10
-rw-r--r--gdb/config/z8k/tm-z8k.h11
-rwxr-xr-xgdb/configure900
-rw-r--r--gdb/configure.in19
-rw-r--r--gdb/configure.tgt10
-rw-r--r--gdb/core-sol2.c30
-rw-r--r--gdb/corefile.c8
-rw-r--r--gdb/corelow.c2
-rw-r--r--gdb/cp-valprint.c16
-rw-r--r--gdb/cris-tdep.c13
-rw-r--r--gdb/d10v-tdep.c19
-rw-r--r--gdb/dbxread.c22
-rw-r--r--gdb/defs.h7
-rw-r--r--gdb/demangle.c31
-rw-r--r--gdb/doc/ChangeLog28
-rw-r--r--gdb/doc/gdb.texinfo4
-rw-r--r--gdb/doc/gdbint.texinfo141
-rw-r--r--gdb/dummy-frame.c310
-rw-r--r--gdb/dummy-frame.h65
-rw-r--r--gdb/dwarf2cfi.c153
-rw-r--r--gdb/dwarf2cfi.h36
-rw-r--r--gdb/dwarf2read.c379
-rw-r--r--gdb/dwarfread.c46
-rw-r--r--gdb/elfread.c8
-rw-r--r--gdb/event-loop.c7
-rw-r--r--gdb/event-top.c33
-rw-r--r--gdb/expression.h21
-rw-r--r--gdb/f-exp.y3
-rw-r--r--gdb/f-valprint.c12
-rw-r--r--gdb/findvar.c18
-rw-r--r--gdb/frame.c698
-rw-r--r--gdb/frame.h210
-rw-r--r--gdb/frv-tdep.c5
-rwxr-xr-xgdb/gdb_indent.sh2
-rw-r--r--gdb/gdb_thread_db.h3
-rw-r--r--gdb/gdbarch.c224
-rw-r--r--gdb/gdbarch.h134
-rwxr-xr-xgdb/gdbarch.sh12
-rw-r--r--gdb/gdbcore.h7
-rw-r--r--gdb/gdbtypes.c36
-rw-r--r--gdb/gdbtypes.h51
-rw-r--r--gdb/gnu-nat.c32
-rw-r--r--gdb/go32-nat.c4
-rw-r--r--gdb/h8300-tdep.c84
-rw-r--r--gdb/h8500-tdep.c115
-rw-r--r--gdb/hp300ux-nat.c2
-rw-r--r--gdb/hppa-tdep.c300
-rw-r--r--gdb/hppab-nat.c4
-rw-r--r--gdb/hppah-nat.c6
-rw-r--r--gdb/hppam3-nat.c6
-rw-r--r--gdb/hpread.c33
-rw-r--r--gdb/hpux-thread.c9
-rw-r--r--gdb/i386-interix-nat.c190
-rw-r--r--gdb/i386-interix-tdep.c365
-rw-r--r--gdb/i386-linux-nat.c198
-rw-r--r--gdb/i386-linux-tdep.c32
-rw-r--r--gdb/i386-tdep.c144
-rw-r--r--gdb/i386-tdep.h25
-rw-r--r--gdb/i386bsd-nat.c11
-rw-r--r--gdb/i386gnu-nat.c8
-rw-r--r--gdb/i386obsd-nat.c8
-rw-r--r--gdb/i386obsd-tdep.c122
-rw-r--r--gdb/i386v-nat.c4
-rw-r--r--gdb/i387-tdep.c61
-rw-r--r--gdb/ia64-aix-nat.c16
-rw-r--r--gdb/ia64-linux-nat.c4
-rw-r--r--gdb/ia64-tdep.c14
-rw-r--r--gdb/infcmd.c148
-rw-r--r--gdb/infptrace.c31
-rw-r--r--gdb/infrun.c21
-rw-r--r--gdb/irix4-nat.c16
-rw-r--r--gdb/irix5-nat.c20
-rw-r--r--gdb/jv-exp.y16
-rw-r--r--gdb/language.c7
-rw-r--r--gdb/language.h3
-rw-r--r--gdb/lin-lwp.c7
-rw-r--r--gdb/linespec.c386
-rw-r--r--gdb/lynx-nat.c38
-rw-r--r--gdb/m2-exp.y2
-rw-r--r--gdb/m68hc11-tdep.c4
-rw-r--r--gdb/m68k-tdep.c21
-rw-r--r--gdb/m68knbsd-nat.c14
-rw-r--r--gdb/macroscope.c43
-rw-r--r--gdb/macrotab.c8
-rw-r--r--gdb/macrotab.h9
-rw-r--r--gdb/mcore-tdep.c5
-rw-r--r--gdb/mdebugread.c64
-rw-r--r--gdb/mi/ChangeLog40
-rw-r--r--gdb/mi/gdbmi.texinfo16
-rw-r--r--gdb/mi/mi-cmd-stack.c26
-rw-r--r--gdb/mi/mi-cmd-var.c12
-rw-r--r--gdb/mi/mi-main.c63
-rw-r--r--gdb/mips-linux-nat.c4
-rw-r--r--gdb/mips-linux-tdep.c8
-rw-r--r--gdb/mips-nat.c2
-rw-r--r--gdb/mips-tdep.c30
-rw-r--r--gdb/mipsm3-nat.c16
-rw-r--r--gdb/mipsv4-nat.c14
-rw-r--r--gdb/mn10300-tdep.c8
-rw-r--r--gdb/monitor.c39
-rw-r--r--gdb/ns32k-tdep.c5
-rw-r--r--gdb/ns32knbsd-nat.c10
-rw-r--r--gdb/objc-exp.y25
-rw-r--r--gdb/objc-lang.c8
-rw-r--r--gdb/p-exp.y11
-rw-r--r--gdb/parse.c18
-rw-r--r--gdb/ppc-bdm.c36
-rw-r--r--gdb/ppc-sysv-tdep.c12
-rw-r--r--gdb/printcmd.c134
-rw-r--r--gdb/ptx4-nat.c2
-rw-r--r--gdb/regcache.c496
-rw-r--r--gdb/regcache.h99
-rw-r--r--gdb/reggroups.c268
-rw-r--r--gdb/reggroups.h61
-rw-r--r--gdb/remote-array.c37
-rw-r--r--gdb/remote-e7000.c35
-rw-r--r--gdb/remote-es.c100
-rw-r--r--gdb/remote-mips.c2
-rw-r--r--gdb/remote-rdi.c2
-rw-r--r--gdb/remote-rdp.c38
-rw-r--r--gdb/remote-sds.c6
-rw-r--r--gdb/remote-sim.c37
-rw-r--r--gdb/remote-st.c37
-rw-r--r--gdb/remote-vx.c4
-rw-r--r--gdb/remote-vx68.c32
-rw-r--r--gdb/remote-vxmips.c38
-rw-r--r--gdb/remote-vxsparc.c37
-rw-r--r--gdb/remote.c3
-rw-r--r--gdb/rs6000-tdep.c34
-rw-r--r--gdb/s390-tdep.c22
-rw-r--r--gdb/sh-tdep.c31
-rw-r--r--gdb/sol-thread.c27
-rw-r--r--gdb/solib-sunos.c8
-rw-r--r--gdb/solib-svr4.c71
-rw-r--r--gdb/solib-svr4.h4
-rw-r--r--gdb/source.c7
-rw-r--r--gdb/sparc-nat.c116
-rw-r--r--gdb/sparc-tdep.c249
-rw-r--r--gdb/stabsread.c107
-rw-r--r--gdb/stabsread.h4
-rw-r--r--gdb/stack.c6
-rw-r--r--gdb/sun3-nat.c31
-rw-r--r--gdb/symfile.c7
-rw-r--r--gdb/symfile.h6
-rw-r--r--gdb/symm-nat.c78
-rw-r--r--gdb/symtab.c526
-rw-r--r--gdb/symtab.h107
-rw-r--r--gdb/target.c3
-rw-r--r--gdb/target.h16
-rw-r--r--gdb/testsuite/ChangeLog35
-rw-r--r--gdb/testsuite/gdb.asm/asm-source.exp11
-rw-r--r--gdb/testsuite/gdb.asm/asmsrc1.s16
-rw-r--r--gdb/testsuite/gdb.asm/asmsrc2.s3
-rw-r--r--gdb/testsuite/gdb.asm/common.inc14
-rw-r--r--gdb/testsuite/gdb.asm/mips.inc64
-rw-r--r--gdb/testsuite/gdb.base/constvars.c5
-rw-r--r--gdb/testsuite/gdb.base/constvars.exp5
-rw-r--r--gdb/testsuite/gdb.base/default.exp4
-rw-r--r--gdb/testsuite/gdb.base/help.exp8
-rw-r--r--gdb/testsuite/gdb.chill/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.chill/chexp.exp900
-rw-r--r--gdb/testsuite/gdb.chill/pr-5016.exp1
-rw-r--r--gdb/testsuite/gdb.mi/ChangeLog38
-rw-r--r--gdb/testsuite/gdb.mi/gdb792.cc59
-rw-r--r--gdb/testsuite/gdb.mi/gdb792.exp90
-rw-r--r--gdb/testsuite/gdb.mi/mi-console.exp17
-rw-r--r--gdb/testsuite/gdb.mi/mi-disassemble.exp50
-rw-r--r--gdb/testsuite/gdb.mi/mi-eval.exp45
-rw-r--r--gdb/testsuite/gdb.mi/mi-read-memory.exp18
-rw-r--r--gdb/testsuite/gdb.mi/mi-regs.exp50
-rw-r--r--gdb/testsuite/gdb.mi/mi-return.exp36
-rw-r--r--gdb/testsuite/gdb.mi/mi-stack.exp19
-rw-r--r--gdb/testsuite/gdb.mi/mi-stepi.exp27
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-block.exp71
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-cmd.exp36
-rw-r--r--gdb/testsuite/gdb.mi/mi-watch.exp29
-rw-r--r--gdb/testsuite/gdb.mi/mi1-console.exp17
-rw-r--r--gdb/testsuite/gdb.mi/mi1-disassemble.exp50
-rw-r--r--gdb/testsuite/gdb.mi/mi1-eval.exp45
-rw-r--r--gdb/testsuite/gdb.mi/mi1-read-memory.exp17
-rw-r--r--gdb/testsuite/gdb.mi/mi1-regs.exp50
-rw-r--r--gdb/testsuite/gdb.mi/mi1-return.exp36
-rw-r--r--gdb/testsuite/gdb.mi/mi1-stack.exp19
-rw-r--r--gdb/testsuite/gdb.mi/mi1-stepi.exp27
-rw-r--r--gdb/testsuite/gdb.mi/mi1-var-block.exp71
-rw-r--r--gdb/testsuite/gdb.mi/mi1-var-cmd.exp36
-rw-r--r--gdb/testsuite/gdb.mi/mi1-watch.exp29
-rw-r--r--gdb/testsuite/gdb.threads/schedlock.c2
-rw-r--r--gdb/testsuite/lib/mi-support.exp21
-rw-r--r--gdb/thread-db.c102
-rw-r--r--gdb/tui/ChangeLog22
-rw-r--r--gdb/tui/tuiIO.c15
-rw-r--r--gdb/tui/tuiStack.c2
-rw-r--r--gdb/tui/tuiWin.c19
-rw-r--r--gdb/utils.c137
-rw-r--r--gdb/v850-tdep.c4
-rw-r--r--gdb/v850ice.c21
-rw-r--r--gdb/valops.c235
-rw-r--r--gdb/value.h2
-rw-r--r--gdb/values.c4
-rw-r--r--gdb/varobj.c131
-rw-r--r--gdb/vax-tdep.c2
-rw-r--r--gdb/version.in2
-rw-r--r--gdb/win32-nat.c8
-rw-r--r--gdb/wince.c4
-rw-r--r--gdb/x86-64-linux-nat.c2
-rw-r--r--gdb/x86-64-linux-tdep.c76
-rw-r--r--gdb/x86-64-tdep.c409
-rw-r--r--gdb/x86-64-tdep.h5
-rw-r--r--gdb/xcoffread.c24
-rw-r--r--gdb/xstormy16-tdep.c10
-rw-r--r--gdb/z8k-tdep.c115
-rw-r--r--include/ChangeLog30
-rw-r--r--include/ansidecl.h5
-rw-r--r--include/bfdlink.h5
-rw-r--r--include/elf/ChangeLog4
-rw-r--r--include/elf/sh.h16
-rw-r--r--include/getopt.h8
-rw-r--r--include/opcode/ChangeLog4
-rw-r--r--include/opcode/cgen.h16
-rw-r--r--include/opcode/tic4x.h16
-rw-r--r--include/partition.h4
-rw-r--r--libiberty/ChangeLog10
-rw-r--r--libiberty/config.table1
-rw-r--r--libiberty/cplus-dem.c18
-rw-r--r--opcodes/ChangeLog51
-rw-r--r--opcodes/Makefile.am6
-rw-r--r--opcodes/Makefile.in8
-rw-r--r--opcodes/ia64-asmtab.c4
-rw-r--r--opcodes/ia64-gen.c1206
-rw-r--r--opcodes/ia64-opc-a.c567
-rw-r--r--opcodes/ia64-opc-b.c496
-rw-r--r--opcodes/ia64-opc-d.c41
-rw-r--r--opcodes/ia64-opc-f.c1057
-rw-r--r--opcodes/ia64-opc-i.c169
-rw-r--r--opcodes/ia64-opc-m.c831
-rw-r--r--opcodes/ia64-opc-x.c85
-rw-r--r--opcodes/m68hc11-dis.c99
-rw-r--r--opcodes/ppc-dis.c21
-rw-r--r--opcodes/ppc-opc.c14
-rw-r--r--opcodes/sparc-opc.c38
-rw-r--r--sim/common/ChangeLog13
-rw-r--r--sim/common/Make-common.in4
-rw-r--r--sim/common/cgen-trace.h2
-rw-r--r--sim/common/run.c2
-rw-r--r--sim/d10v/ChangeLog4
-rw-r--r--sim/d10v/simops.c3
-rw-r--r--sim/igen/ChangeLog6
-rw-r--r--sim/igen/gen-engine.c12
-rw-r--r--sim/sh/ChangeLog8
-rw-r--r--sim/sh/gencode.c33
-rw-r--r--sim/sh/interp.c19
443 files changed, 25367 insertions, 11903 deletions
diff --git a/ChangeLog b/ChangeLog
index f01dee3aa24..f36c879ea00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2002-11-13 Bruce Korb <bkorb@gnu.org>
+
+ * Makefile.tpl: syntactic cleanup
+
+2002-11-04 Kevin Buettner <kevinb@redhat.com>
+
+ * Makefile.def (host_modules): Add rda.
+ * Makefile.in: Regenerate.
+ * configure.in (target_tool): Add target-rda to list.
+
+2002-10-25 Phil Edwards <pme@gcc.gnu.org>
+
+ * Makefile.tpl (bootstrap): Add bubblestrap, quickstrap, cleanstrap,
+ and restrap targets to this rule.
+ * Makefile.in: Regenerate.
+
+2002-10-24 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * configure.in (i[3456]86-*-linux*): Add check to disable
+ ${libgcj} for glibc1.
+
+2002-10-07 Svein E. Seldal <Svein.Seldal@solidas.com>
+
+ * configure.in: Add tic4x target.
+
2002-10-03 Nathanael Nerode <neroden@gcc.gnu.org>
* Makefile.tpl: Make SET_LIB_PATH substitution more autoconfy.
diff --git a/Makefile.def b/Makefile.def
index 754b79ee08a..ae4b2e6fa0b 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -77,3 +77,4 @@ target_modules = { module= libjava; };
target_modules = { module= zlib; };
target_modules = { module= boehm-gc; };
target_modules = { module= qthreads; };
+target_modules = { module= rda; };
diff --git a/Makefile.in b/Makefile.in
index ce4bffa88a4..6f7689785cb 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -760,7 +760,8 @@ ALL_TARGET_MODULES = \
all-target-libjava \
all-target-zlib \
all-target-boehm-gc \
- all-target-qthreads
+ all-target-qthreads \
+ all-target-rda
# This is a list of the configure targets for all of the modules which
# are compiled using the target tools.
@@ -779,7 +780,8 @@ CONFIGURE_TARGET_MODULES = \
configure-target-libjava \
configure-target-zlib \
configure-target-boehm-gc \
- configure-target-qthreads
+ configure-target-qthreads \
+ configure-target-rda
# This is a list of the check targets for all of the modules which are
# compiled using $(TARGET_FLAGS_TO_PASS).
@@ -795,7 +797,8 @@ CHECK_TARGET_MODULES = \
check-target-libjava \
check-target-zlib \
check-target-boehm-gc \
- check-target-qthreads
+ check-target-qthreads \
+ check-target-rda
# This is a list of the install targets for all of the modules which are
# compiled using $(TARGET_FLAGS_TO_PASS).
@@ -812,7 +815,8 @@ INSTALL_TARGET_MODULES = \
install-target-libjava \
install-target-zlib \
install-target-boehm-gc \
- install-target-qthreads
+ install-target-qthreads \
+ install-target-rda
# This is a list of the targets for which we can do a clean-{target}.
CLEAN_MODULES = \
@@ -892,7 +896,8 @@ CLEAN_TARGET_MODULES = \
clean-target-libjava \
clean-target-zlib \
clean-target-boehm-gc \
- clean-target-qthreads
+ clean-target-qthreads \
+ clean-target-rda
# All of the x11 modules that can be cleaned
CLEAN_X11_MODULES = \
@@ -1527,8 +1532,8 @@ 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
+.PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap
+bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap: all-bootstrap
@r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \
$(SET_LIB_PATH) \
@@ -1762,6 +1767,7 @@ all-target-libjava: configure-target-libjava
all-target-zlib: configure-target-zlib
all-target-boehm-gc: configure-target-boehm-gc
all-target-qthreads: configure-target-qthreads
+all-target-rda: configure-target-rda
### other supporting targets
diff --git a/Makefile.tpl b/Makefile.tpl
index 5ef7d55fa3f..7428f412451 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -1,4 +1,4 @@
-[+ AutoGen5 template
+[+ AutoGen5 template -*- Mode: Makefile -*-
in
+]
@@ -522,8 +522,10 @@ CONFIGURE_BUILD_MODULES = \
# This is a list of the targets for all of the modules which are compiled
# using $(FLAGS_TO_PASS).
-ALL_MODULES = [+ FOR host_modules +]\
- all-[+module+] [+ ENDFOR host_modules +]\
+ALL_MODULES =[+
+ FOR host_modules +] \
+ all-[+module+][+
+ ENDFOR host_modules +] \
$(EXTRA_TARGET_HOST_ALL_MODULES)
# This is a list of the check targets for all of the modules which are
@@ -539,16 +541,25 @@ NATIVE_CHECK_MODULES = \
check-flex \
check-zip
-CROSS_CHECK_MODULES = [+ FOR host_modules +][+ IF no_check +][+ ELIF no_check_cross +][+ ELSE x +]\
- check-[+module+] [+ ENDIF no_check +][+ ENDFOR host_modules +]\
+CROSS_CHECK_MODULES =[+
+ FOR host_modules +][+
+ IF (not (or (exist? "no_check_cross") (exist? "no_check")))
+ +] \
+ check-[+module+][+
+ ENDIF no_check +][+
+ ENDFOR host_modules +] \
$(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).
-INSTALL_MODULES = [+ FOR host_modules+][+ IF no_install +][+ ELSE no_install +]\
- install-[+module+] [+ ENDIF no_install +][+ ENDFOR host_modules +]\
+INSTALL_MODULES =[+
+ FOR host_modules+][+
+ IF (not (exist? "no_install")) +] \
+ install-[+module+][+
+ ENDIF no_install +][+
+ ENDFOR host_modules +] \
$(EXTRA_TARGET_HOST_INSTALL_MODULES)
# This is a list of the targets for all of the modules which are compiled
@@ -583,31 +594,51 @@ INSTALL_X11_MODULES = \
# This is a list of the targets for all of the modules which are compiled
# using $(TARGET_FLAGS_TO_PASS).
-ALL_TARGET_MODULES = [+ FOR target_modules +]\
- all-target-[+module+] [+ ENDFOR target_modules +]
+ALL_TARGET_MODULES =[+
+ FOR target_modules +] \
+ all-target-[+module+][+
+ ENDFOR target_modules +]
# This is a list of the configure targets for all of the modules which
# are compiled using the target tools.
-CONFIGURE_TARGET_MODULES = [+ FOR target_modules +]\
- configure-target-[+module+] [+ ENDFOR target_modules +]
+CONFIGURE_TARGET_MODULES =[+
+ FOR target_modules +] \
+ configure-target-[+module+][+
+ ENDFOR target_modules +]
# This is a list of the check targets for all of the modules which are
# compiled using $(TARGET_FLAGS_TO_PASS).
-CHECK_TARGET_MODULES = [+ FOR target_modules +][+ IF no_check +][+ ELSE check +]\
- check-target-[+module+] [+ ENDIF no_check +][+ ENDFOR target_modules +]
+CHECK_TARGET_MODULES =[+
+ FOR target_modules +][+
+ IF (not (exist? "no_check")) +] \
+ check-target-[+module+][+
+ ENDIF no_check +][+
+ ENDFOR target_modules +]
# This is a list of the install targets for all of the modules which are
# compiled using $(TARGET_FLAGS_TO_PASS).
-INSTALL_TARGET_MODULES = [+ FOR target_modules +][+ IF no_install +][+ ELSE install +]\
- install-target-[+module+] [+ ENDIF no_install +][+ ENDFOR target_modules +]
+INSTALL_TARGET_MODULES =[+
+ FOR target_modules +][+
+ IF (not (exist? "no_install")) +] \
+ install-target-[+module+][+
+ ENDIF no_install +][+
+ ENDFOR target_modules +]
# This is a list of the targets for which we can do a clean-{target}.
-CLEAN_MODULES = [+ FOR host_modules +][+ IF no_clean +][+ ELSE no_clean +]\
- clean-[+module+] [+ ENDIF no_clean +][+ ENDFOR host_modules +]
+CLEAN_MODULES =[+
+ FOR host_modules +][+
+ IF (not (exist? "no_clean")) +] \
+ clean-[+module+][+
+ ENDIF no_clean +][+
+ ENDFOR host_modules +]
# All of the target modules that can be cleaned
-CLEAN_TARGET_MODULES = [+ FOR target_modules +][+ IF no_clean +][+ ELSE clean +]\
- clean-target-[+module+] [+ ENDIF no_clean +][+ ENDFOR target_modules +]
+CLEAN_TARGET_MODULES =[+
+ FOR target_modules +][+
+ IF (not (exist? "no_clean")) +] \
+ clean-target-[+module+][+
+ ENDIF no_clean +][+
+ ENDFOR target_modules +]
# All of the x11 modules that can be cleaned
CLEAN_X11_MODULES = \
@@ -1242,8 +1273,8 @@ 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
+.PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap
+bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap: all-bootstrap
@r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \
$(SET_LIB_PATH) \
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f2c7a389e31..479674b6c6b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,752 @@
+2002-11-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * 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 <kdienes@apple.com>
+
+ * 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 <Svein.Seldal@solidas.com>
+
+ * coff-tic4x.c (tic4x_howto_table): Formatting fixup
+
+2002-11-14 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * 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 <kdienes@apple.com>
+
+ * config.bfd: Add entries for powerpc-*-darwin and cousins.
+
+2002-11-13 H.J. Lu <hjl@gnu.org>
+
+ * elfcode.h (elf_object_p): Don't restore abfd->arch_info.
+
+2002-11-13 Klee Dienes <kdienes@apple.com>
+ Alan Modra <amodra@bigpond.net.au>
+
+ * 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 <nickc@redhat.com>
+
+ * po/da.po: Updated Danish translation.
+
+2002-11-12 Alan Modra <amodra@bigpond.net.au>
+
+ * 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 <tmm@FreeBSD.org>
+
+ * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Correct
+ references to large plt symbols.
+
+2002-11-12 Klee Dienes <kdienes@apple.com>
+
+ * 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 <kazu@cs.umass.edu>
+
+ * coff-h8300.c: Fix formatting.
+ * elf32-h8300.c: Likewise.
+ * reloc16.c: Likewise.
+
+2002-11-09 Jeroen Dobbelaere <jeroen.dobbelaere@acunia.com>
+
+ * 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 <amodra@bigpond.net.au>
+
+ * targets.c (_bfd_target_vector): Disable pef_vec, pef_xlib_vec
+ and sym_vec.
+
+ * dwarf2.c: Revert last change.
+
+2002-11-07 Michal Ludvig <mludvig@suse.cz>
+
+ * 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 <hp@axis.com>
+
+ * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOT,
+ case R_CRIS_32_GOT>: 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 <amodra@bigpond.net.au>
+
+ * elf64-ppc.c: Comment typo fixes.
+ (ppc64_elf_merge_private_bfd_data): Allow BFD_ENDIAN_UNKNOWN input.
+
+2002-11-07 Nick Clifton <nickc@redhat.com>
+
+ * po/da.po: Updated Danish translation.
+
+2002-11-06 Alexandre Oliva <aoliva@redhat.com>
+
+ * 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 <kdienes@apple.com>
+
+ * coff-stgo32.c (stub_bytes): Mark as const.
+ Fix comment formatting.
+
+2002-11-06 Klee Dienes <kdienes@apple.com>
+
+ * 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 <gp@qnx.com>
+
+ * 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 <obrien@FreeBSD.org>
+ Alan Modra <amodra@bigpond.net.au>
+
+ * 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 <amodra@bigpond.net.au>
+
+ * 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 <kkojima@rr.iij4u.or.jp>
+ Alan Modra <amodra@bigpond.net.au>
+
+ * 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 <eathan@otenet.gr>
+
+ * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is
+ non-NULL before dereferencing.
+
+2002-11-04 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * vms.c (vms_object_p): Restore the start address when returning
+ NULL.
+
+2002-11-04 Alan Modra <amodra@bigpond.net.au>
+ Hans-Peter Nilsson <hp@axis.com>
+
+ * 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 <stephen.clarke@earthling.net>
+
+ * 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 <hp@axis.com>
+
+ * elf32-v850.c (v850_elf_relax_delete_bytes): Correct parameters
+ for bfd_elf32_swap_symbol_out.
+
+2002-10-31 David O'Brien <obrien@FreeBSD.org>
+
+ * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't mix
+ signed and unsigned in comparison.
+
+2002-10-30 Daniel Jacobowitz <drow@mvista.com>
+
+ * coffcode.h: Remove extraneous '\'.
+
+2002-10-28 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.am (targets.lo): Depend on Makefile instead of
+ config.status.
+ (archures.lo): Likewise.
+ * Makefile.in: Regenerated.
+
+2002-10-25 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * 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 <wilson@redhat.com>
+
+ * 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 <hp@axis.com>
+
+ * simple.c: Correct placement of ATTRIBUTE_UNUSED.
+
+2002-10-24 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * 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 <jakub@redhat.com>
+
+ * elf64-alpha.c (elf64_alpha_check_relocs): Only put maybe_dynamic
+ relocs into shared lib non-allocated reloc sections.
+
+2002-10-23 Nathan Tallent <eraxxon@alumni.rice.edu>
+
+ * 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 <ross.alexander@uk.neceur.com>
+
+ * elf64-hppa.c: Force DT_FLAGS to always be set. Required by
+ HPUX 11.00 patch PHSS_26559.
+
+2002-10-22 Alexandre Oliva <aoliva@redhat.com>
+
+ * 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 <aoliva@redhat.com>
+
+ * 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 <gp@qnx.com>
+
+ * targets.c (_bfd_target_vector): Add missing qnx vectors.
+
+2002-10-21 Alan Modra <amodra@bigpond.net.au>
+
+ * targets.c (bfd_target_list): Don't return the default target twice.
+
+2002-10-21 Elias Athanasopoulos <eathan@otenet.gr>
+
+ * archive.c (_bfd_archive_bsd_update_armap_timestamp): Replace
+ perror with bfd_perror.
+
+2002-10-19 H.J. Lu <hjl@gnu.org>
+
+ * elflink.h (elf_link_add_object_symbols): Correctly handle
+ DT_RPATH and DT_RUNPATH.
+
+2002-10-19 Mark Kettenis <kettenis@gnu.org>
+
+ * elf.c (elfcore_grok_note): Fix recognition on NT_PRXFPREG notes.
+
+2002-10-17 Denis Chertykov <denisc@overta.ru>
+
+ * elf32-ip2k.c (ELF_MACHINE_ALT1): Define alternate machine code
+ for ip2k port.
+
+2002-10-17 Alan Modra <amodra@bigpond.net.au>
+
+ * 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 <jakub@redhat.com>
+
+ * config.bfd (s390-*-linux*): Add targ64_selvecs.
+ (s390x-*-linux*): Add targ_selvecs.
+
+2002-10-16 Alan Modra <amodra@bigpond.net.au>
+
+ * 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 <amodra@bigpond.net.au>
+
+ * 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 <rth@redhat.com>
+
+ * 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 <rth@redhat.com>
+
+ * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: Increment
+ VALUE, not ADDEND.
+
+2002-10-14 Stephen Clarke <stephen.clarke@superh.com>
+
+ * 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 <amodra@bigpond.net.au>
+
+ * 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 <amodra@bigpond.net.au>
+
+ * 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 <kkojima@rr.iij4u.or.jp>
+
+ * config.bfd (sh*eb-*-linux*, sh*-*-linux*): Add the alternative
+ endian vector to targ_selvecs.
+
+2002-10-13 Alexandre Oliva <aoliva@redhat.com>
+
+ * 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 <stcarrez@nerim.fr>
+
+ * 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 <stcarrez@nerim.fr>
+
+ * 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 <kkojima@rr.iij4u.or.jp>
+
+ * 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 <drow@mvista.com>
+
+ * Makefile.in: Regenerated.
+
+2002-10-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * 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 <amodra@bigpond.net.au>
+
+ * 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 <stephen.clarke@superh.com>
+
+ * 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 <richard.shann@superh.com>
+ Stephen Clarke <stephen.clarke@superh.com>
+
+ * 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 <hjl@gnu.org>
+
+ * elf32-i386.c (elf_i386_relocate_section): Re-arrange the
+ IE->LE transition for R_386_TLS_IE.
+
+2002-10-08 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (edit_opd): Correct test for discarded sections.
+
+2002-10-07 Mark Elbrecht <snowball3@softhome.net>
+
+ * cofflink.c (mark_relocs): Don't mark relocations in excluded
+ sections.
+
+2002-10-07 Alan Modra <amodra@bigpond.net.au>
+
+ * 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 <amodra@bigpond.net.au>
+
+ * opncls.c: Formatting.
+ (_bfd_new_bfd): Use a smaller section hash table.
+
+2002-10-05 Alexandre Oliva <aoliva@redhat.com>
+
+ * 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 <stephen.clarke@superh.com>
* elf32-sh.c (elf_sh_link_hash_entry): Add gotplt_refcount.
@@ -9,7 +758,7 @@
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 <jakub@redhat.com>
* elf32-i386.c (elf_i386_relocate_section): Fix
@@ -28,10 +777,10 @@
R_X86_64_DTPOFF32 to st_value + addend in non-code sections.
2002-09-30 Gavin Romig-Koch <gavin@redhat.com>
- Ken Raeburn <raeburn@cygnus.com>
- Aldy Hernandez <aldyh@redhat.com>
- Eric Christopher <echristo@redhat.com>
- Richard Sandiford <rsandifo@redhat.com>
+ Ken Raeburn <raeburn@cygnus.com>
+ Aldy Hernandez <aldyh@redhat.com>
+ Eric Christopher <echristo@redhat.com>
+ Richard Sandiford <rsandifo@redhat.com>
* archures.c (bfd_mach_mips4120, bfd_mach_mips5400): New.
(bfd_mach_mips5500): New.
@@ -233,7 +982,7 @@
* elfcode.h (elf_slurp_reloc_table_from_section): Check
for overflow.
-2002-09-17 Stan Cox <scox@redhat.com>
+2002-09-17 Stan Cox <scox@redhat.com>
* elf64-mips.c (mips_elf64_be_swap_reloca_out): Handle type2 and type3.
(mips_elf64_final_gp): Don't make up gp value.
@@ -315,7 +1064,7 @@
2002-09-10 Michael Snyder <msnyder@redhat.com>
* irix-core.c (do_sections, do_sections64): New functions.
- (irix_core_core_file_p): Call new functions do_sections,
+ (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 <rth@redhat.com>
@@ -325,8 +1074,8 @@
2002-09-04 Kevin Buettner <kevinb@redhat.com>
- * config.bfd (mips*-*-irix6*): Add new ABI vectors. Make n32 default
- vector.
+ * config.bfd (mips*-*-irix6*): Add new ABI vectors. Make n32 default
+ vector.
2002-09-02 Nick Clifton <nickc@redhat.com>
@@ -337,7 +1086,7 @@
(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.
+ Fixup problems with freeing cached allocated memory blocks.
2002-09-02 Alan Modra <amodra@bigpond.net.au>
@@ -506,7 +1255,7 @@
* 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 <stephen.clarke@superh.com>
* elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize
@@ -516,7 +1265,7 @@
2002-08-22 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple
- byte read when reading the return address register column.
+ byte read when reading the return address register column.
2002-08-22 Nick Clifton <nickc@redhat.com>
@@ -582,9 +1331,9 @@
argument declaration.
2002-08-19 Elena Zannoni <ezannoni@redhat.com>
-
- * archures.c (bfd_mach_ppc_e500): Added.
- * bfd-in2.h: Rebuilt.
+
+ * archures.c (bfd_mach_ppc_e500): Added.
+ * bfd-in2.h: Rebuilt.
* cpu-powerpc.c (bfd_powerpc_archs): Added e500.
2002-08-19 Alan Modra <amodra@bigpond.net.au>
@@ -594,7 +1343,7 @@
2002-08-17 Andrew Cagney <ac131313@redhat.com>
* elf.c (bfd_elf_get_elf_syms): Change type of `esym' to
- `bfd_byte'.
+ `bfd_byte'.
2002-08-17 Stan Cox <scox@redhat.com>
@@ -606,7 +1355,7 @@
* bfd/elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect
symbols when looking for section referred to by a relocation.
* bfd/elf64-sh.c (sh_elf64_gc_mark_hook): Likewise.
-
+
2002-08-15 Alan Modra <amodra@bigpond.net.au>
* elf32-i370.c: Move reloc enum to include/elf/i370.h.
@@ -695,7 +1444,7 @@
2002-08-09 Graeme Peterson <gp@qnx.com>
- * Makefile.am: Add entries for elf32-ppcqnx.c, and add
+ * 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.
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 0aa98e3b87f..0c1a7980440 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -32,7 +32,7 @@ BFD32_LIBS = \
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
@@ -41,7 +41,7 @@ BFD32_LIBS_CFILES = \
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
@@ -203,7 +203,6 @@ BFD32_BACKENDS = \
elf32-arc.lo \
elfarm-oabi.lo \
elfarm-nabi.lo \
- elfarmqnx-nabi.lo \
elf32-avr.lo \
elf32-cris.lo \
elf32-d10v.lo \
@@ -216,8 +215,6 @@ BFD32_BACKENDS = \
elf32-hppa.lo \
elf32-i370.lo \
elf32-i386.lo \
- elf32-i386-fbsd.lo \
- elf32-i386qnx.lo \
elf32-i860.lo \
elf32-i960.lo \
elf32-ia64.lo \
@@ -236,15 +233,10 @@ BFD32_BACKENDS = \
elf32-or32.lo \
elf32-pj.lo \
elf32-ppc.lo \
- elf32-ppcqnx.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-shqnx.lo \
elf32-sparc.lo \
elf32-v850.lo \
elf32-vax.lo \
@@ -274,6 +266,7 @@ BFD32_BACKENDS = \
m68klynx.lo \
m68knetbsd.lo \
m88kmach3.lo \
+ mach-o.lo \
mipsbsd.lo \
newsos3.lo \
nlm.lo \
@@ -285,6 +278,7 @@ BFD32_BACKENDS = \
oasys.lo \
pc532-mach.lo \
pdp11.lo \
+ pef.lo \
pe-arm.lo \
pei-arm.lo \
pe-i386.lo \
@@ -314,7 +308,8 @@ BFD32_BACKENDS = \
vms-hdr.lo \
vms-misc.lo \
vms-tir.lo \
- xcofflink.lo
+ xcofflink.lo \
+ xsym.lo
BFD32_BACKENDS_CFILES = \
aout-adobe.c \
@@ -366,7 +361,6 @@ BFD32_BACKENDS_CFILES = \
elf32-arc.c \
elfarm-oabi.c \
elfarm-nabi.c \
- elfarmqnx-nabi.c \
elf32-avr.c \
elf32-cris.c \
elf32-d10v.c \
@@ -379,8 +373,6 @@ BFD32_BACKENDS_CFILES = \
elf32-hppa.c \
elf32-i370.c \
elf32-i386.c \
- elf32-i386-fbsd.c \
- elf32-i386qnx.c \
elf32-i860.c \
elf32-i960.c \
elf32-ip2k.c \
@@ -398,15 +390,10 @@ BFD32_BACKENDS_CFILES = \
elf32-or32.c \
elf32-pj.c \
elf32-ppc.c \
- elf32-ppcqnx.c \
elf32-sh64.c \
elf32-sh64-com.c \
elf32-s390.c \
elf32-sh.c \
- elf32-sh-lin.c \
- elf32-sh-nbsd.c \
- elf32-sh64-nbsd.c \
- elf32-shqnx.c \
elf32-sparc.c \
elf32-v850.c \
elf32-vax.c \
@@ -436,6 +423,7 @@ BFD32_BACKENDS_CFILES = \
m68klynx.c \
m68knetbsd.c \
m88kmach3.c \
+ mach-o.c \
mipsbsd.c \
newsos3.c \
nlm.c \
@@ -447,6 +435,7 @@ BFD32_BACKENDS_CFILES = \
oasys.c \
pc532-mach.c \
pdp11.c \
+ pef.c \
pe-arm.c \
pei-arm.c \
pe-i386.c \
@@ -475,7 +464,8 @@ BFD32_BACKENDS_CFILES = \
vms-hdr.c \
vms-misc.c \
vms-tir.c \
- xcofflink.c
+ xcofflink.c \
+ xsym.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
@@ -489,7 +479,6 @@ 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 \
@@ -497,7 +486,6 @@ BFD64_BACKENDS = \
elf64-mips.lo \
elf64-mmix.lo \
elf64-sh64.lo \
- elf64-sh64-nbsd.lo \
elf64-ppc.lo \
elf64-s390.lo \
elf64-sparc.lo \
@@ -516,7 +504,6 @@ 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 \
@@ -525,7 +512,6 @@ BFD64_BACKENDS_CFILES = \
elf64-ppc.c \
elf64-s390.c \
elf64-sh64.c \
- elf64-sh64-nbsd.c \
elf64-sparc.c \
elf64.c \
mmo.c \
@@ -579,16 +565,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 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 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)
@@ -671,10 +659,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
@@ -806,7 +794,7 @@ 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 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
LIBCOFF_H_FILES = libcoff-in.h coffcode.h
@@ -863,7 +851,7 @@ 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 \
@@ -900,6 +888,7 @@ 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
@@ -1116,11 +1105,6 @@ elfarm-nabi.lo: elfarm-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-arm.h elf32-target.h
-elfarmqnx-nabi.lo: elfarmqnx-nabi.c elfarm-nabi.c $(INCDIR)/elf/arm.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/filenames.h \
- elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-qnx.h \
- elf32-arm.h elf32-target.h
elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \
@@ -1168,14 +1152,6 @@ 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 $(INCDIR)/filenames.h \
- elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-i386.c \
- $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
-elf32-i386qnx.lo: elf32-i386qnx.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-qnx.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 \
@@ -1247,10 +1223,6 @@ 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-ppcqnx.lo: elf32-ppcqnx.c 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-qnx.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 \
@@ -1268,23 +1240,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-shqnx.lo: elf32-shqnx.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-qnx.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 \
@@ -1379,6 +1334,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
@@ -1410,6 +1367,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 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 \
@@ -1493,8 +1452,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 \
@@ -1502,6 +1461,7 @@ 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
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 \
@@ -1533,13 +1493,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 $(INCDIR)/filenames.h \
- elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf64-alpha.c \
- $(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 \
@@ -1578,10 +1531,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 \
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 4816c1718b0..0104743b6fa 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -118,7 +118,6 @@ bfd_default_target_size = @bfd_default_target_size@
bfd_libs = @bfd_libs@
bfd_machines = @bfd_machines@
bfd_version = @bfd_version@
-bfd_version_date = @bfd_version_date@
bfd_version_string = @bfd_version_string@
l = @l@
tdefaults = @tdefaults@
@@ -156,7 +155,7 @@ BFD32_LIBS = \
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
@@ -166,7 +165,7 @@ BFD32_LIBS_CFILES = \
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
@@ -331,7 +330,6 @@ BFD32_BACKENDS = \
elf32-arc.lo \
elfarm-oabi.lo \
elfarm-nabi.lo \
- elfarmqnx-nabi.lo \
elf32-avr.lo \
elf32-cris.lo \
elf32-d10v.lo \
@@ -344,8 +342,6 @@ BFD32_BACKENDS = \
elf32-hppa.lo \
elf32-i370.lo \
elf32-i386.lo \
- elf32-i386-fbsd.lo \
- elf32-i386qnx.lo \
elf32-i860.lo \
elf32-i960.lo \
elf32-ia64.lo \
@@ -364,15 +360,10 @@ BFD32_BACKENDS = \
elf32-or32.lo \
elf32-pj.lo \
elf32-ppc.lo \
- elf32-ppcqnx.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-shqnx.lo \
elf32-sparc.lo \
elf32-v850.lo \
elf32-vax.lo \
@@ -402,6 +393,7 @@ BFD32_BACKENDS = \
m68klynx.lo \
m68knetbsd.lo \
m88kmach3.lo \
+ mach-o.lo \
mipsbsd.lo \
newsos3.lo \
nlm.lo \
@@ -413,6 +405,7 @@ BFD32_BACKENDS = \
oasys.lo \
pc532-mach.lo \
pdp11.lo \
+ pef.lo \
pe-arm.lo \
pei-arm.lo \
pe-i386.lo \
@@ -442,7 +435,8 @@ BFD32_BACKENDS = \
vms-hdr.lo \
vms-misc.lo \
vms-tir.lo \
- xcofflink.lo
+ xcofflink.lo \
+ xsym.lo
BFD32_BACKENDS_CFILES = \
@@ -495,7 +489,6 @@ BFD32_BACKENDS_CFILES = \
elf32-arc.c \
elfarm-oabi.c \
elfarm-nabi.c \
- elfarmqnx-nabi.c \
elf32-avr.c \
elf32-cris.c \
elf32-d10v.c \
@@ -508,8 +501,6 @@ BFD32_BACKENDS_CFILES = \
elf32-hppa.c \
elf32-i370.c \
elf32-i386.c \
- elf32-i386-fbsd.c \
- elf32-i386qnx.c \
elf32-i860.c \
elf32-i960.c \
elf32-ip2k.c \
@@ -527,15 +518,10 @@ BFD32_BACKENDS_CFILES = \
elf32-or32.c \
elf32-pj.c \
elf32-ppc.c \
- elf32-ppcqnx.c \
elf32-sh64.c \
elf32-sh64-com.c \
elf32-s390.c \
elf32-sh.c \
- elf32-sh-lin.c \
- elf32-sh-nbsd.c \
- elf32-sh64-nbsd.c \
- elf32-shqnx.c \
elf32-sparc.c \
elf32-v850.c \
elf32-vax.c \
@@ -565,6 +551,7 @@ BFD32_BACKENDS_CFILES = \
m68klynx.c \
m68knetbsd.c \
m88kmach3.c \
+ mach-o.c \
mipsbsd.c \
newsos3.c \
nlm.c \
@@ -576,6 +563,7 @@ BFD32_BACKENDS_CFILES = \
oasys.c \
pc532-mach.c \
pdp11.c \
+ pef.c \
pe-arm.c \
pei-arm.c \
pe-i386.c \
@@ -604,7 +592,8 @@ BFD32_BACKENDS_CFILES = \
vms-hdr.c \
vms-misc.c \
vms-tir.c \
- xcofflink.c
+ xcofflink.c \
+ xsym.c
# The .o files needed by all of the 64 bit vectors that are configured into
@@ -619,7 +608,6 @@ 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 \
@@ -627,7 +615,6 @@ BFD64_BACKENDS = \
elf64-mips.lo \
elf64-mmix.lo \
elf64-sh64.lo \
- elf64-sh64-nbsd.lo \
elf64-ppc.lo \
elf64-s390.lo \
elf64-sparc.lo \
@@ -647,7 +634,6 @@ 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 \
@@ -656,7 +642,6 @@ BFD64_BACKENDS_CFILES = \
elf64-ppc.c \
elf64-s390.c \
elf64-sh64.c \
- elf64-sh64-nbsd.c \
elf64-sparc.c \
elf64.c \
mmo.c \
@@ -714,16 +699,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 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 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)
@@ -754,7 +741,7 @@ 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 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
@@ -770,7 +757,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)
@@ -785,7 +772,7 @@ 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
+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)
@@ -793,12 +780,12 @@ 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)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
@@ -847,6 +834,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:
@@ -1217,10 +1206,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
@@ -1393,7 +1382,7 @@ 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 \
@@ -1430,6 +1419,7 @@ 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
@@ -1646,11 +1636,6 @@ elfarm-nabi.lo: elfarm-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-arm.h elf32-target.h
-elfarmqnx-nabi.lo: elfarmqnx-nabi.c elfarm-nabi.c $(INCDIR)/elf/arm.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/filenames.h \
- elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-qnx.h \
- elf32-arm.h elf32-target.h
elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \
@@ -1698,14 +1683,6 @@ 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 $(INCDIR)/filenames.h \
- elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-i386.c \
- $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
-elf32-i386qnx.lo: elf32-i386qnx.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-qnx.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 \
@@ -1777,10 +1754,6 @@ 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-ppcqnx.lo: elf32-ppcqnx.c 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-qnx.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 \
@@ -1798,23 +1771,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-shqnx.lo: elf32-shqnx.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-qnx.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 \
@@ -1909,6 +1865,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
@@ -1940,6 +1898,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 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 \
@@ -2023,8 +1983,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 \
@@ -2032,6 +1992,7 @@ 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
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 \
@@ -2063,13 +2024,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 $(INCDIR)/filenames.h \
- elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf64-alpha.c \
- $(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 \
@@ -2108,10 +2062,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 \
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 7fa334ab48f..107772dfc32 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -2261,8 +2261,8 @@ NAME(aout,swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
/* Now the fun stuff. */
if (bfd_header_big_endian (abfd))
{
- r_index = ((bytes->r_index[0] << 16)
- | (bytes->r_index[1] << 8)
+ r_index = (((unsigned int) bytes->r_index[0] << 16)
+ | ((unsigned int) bytes->r_index[1] << 8)
| bytes->r_index[2]);
r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG));
r_type = ((bytes->r_type[0] & RELOC_EXT_BITS_TYPE_BIG)
@@ -2270,8 +2270,8 @@ NAME(aout,swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
}
else
{
- r_index = ((bytes->r_index[2] << 16)
- | (bytes->r_index[1] << 8)
+ r_index = (((unsigned int) bytes->r_index[2] << 16)
+ | ((unsigned int) bytes->r_index[1] << 8)
| bytes->r_index[0]);
r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE));
r_type = ((bytes->r_type[0] & RELOC_EXT_BITS_TYPE_LITTLE)
@@ -2283,9 +2283,9 @@ NAME(aout,swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
/* Base relative relocs are always against the symbol table,
regardless of the setting of r_extern. r_extern just reflects
whether the symbol the reloc is against is local or global. */
- if (r_type == RELOC_BASE10
- || r_type == RELOC_BASE13
- || r_type == RELOC_BASE22)
+ if (r_type == (unsigned int) RELOC_BASE10
+ || r_type == (unsigned int) RELOC_BASE13
+ || r_type == (unsigned int) RELOC_BASE22)
r_extern = 1;
if (r_extern && r_index > symcount)
@@ -2320,8 +2320,8 @@ NAME(aout,swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
/* Now the fun stuff. */
if (bfd_header_big_endian (abfd))
{
- r_index = ((bytes->r_index[0] << 16)
- | (bytes->r_index[1] << 8)
+ r_index = (((unsigned int) bytes->r_index[0] << 16)
+ | ((unsigned int) bytes->r_index[1] << 8)
| bytes->r_index[2]);
r_extern = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
r_pcrel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
@@ -2333,8 +2333,8 @@ NAME(aout,swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
}
else
{
- r_index = ((bytes->r_index[2] << 16)
- | (bytes->r_index[1] << 8)
+ r_index = (((unsigned int) bytes->r_index[2] << 16)
+ | ((unsigned int) bytes->r_index[1] << 8)
| bytes->r_index[0]);
r_extern = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
r_pcrel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
@@ -3891,7 +3891,7 @@ NAME(aout,final_link) (abfd, info, callback)
for (p = o->link_order_head; p != NULL; p = p->next)
{
if (p->type == bfd_indirect_link_order)
- p->u.indirect.section->linker_mark = true;
+ p->u.indirect.section->linker_mark = (unsigned int) true;
}
}
@@ -4440,7 +4440,7 @@ aout_link_write_symbols (finfo, input_bfd)
characters in the symbol names, not including the file
numbers in types (the first number after an open
parenthesis). */
- if (type == N_BINCL)
+ if (type == (int) N_BINCL)
{
struct external_nlist *incl_sym;
int nest;
@@ -4454,13 +4454,13 @@ aout_link_write_symbols (finfo, input_bfd)
int incl_type;
incl_type = H_GET_8 (input_bfd, incl_sym->e_type);
- if (incl_type == N_EINCL)
+ if (incl_type == (int) N_EINCL)
{
if (nest == 0)
break;
--nest;
}
- else if (incl_type == N_BINCL)
+ else if (incl_type == (int) N_BINCL)
++nest;
else if (nest == 0)
{
@@ -4485,7 +4485,7 @@ 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 = ! finfo->info->keep_memory;
+ copy = (boolean) (! finfo->info->keep_memory);
incl_entry = aout_link_includes_lookup (&finfo->includes,
name, true, copy);
if (incl_entry == NULL)
@@ -4513,7 +4513,7 @@ aout_link_write_symbols (finfo, input_bfd)
/* This is a duplicate header file. We must change
it to be an N_EXCL entry, and mark all the
included symbols to prevent outputting them. */
- type = N_EXCL;
+ type = (int) N_EXCL;
nest = 0;
for (incl_sym = sym + 1, incl_map = symbol_map + 1;
@@ -4523,7 +4523,7 @@ aout_link_write_symbols (finfo, input_bfd)
int incl_type;
incl_type = H_GET_8 (input_bfd, incl_sym->e_type);
- if (incl_type == N_EINCL)
+ if (incl_type == (int) N_EINCL)
{
if (nest == 0)
{
@@ -4532,7 +4532,7 @@ aout_link_write_symbols (finfo, input_bfd)
}
--nest;
}
- else if (incl_type == N_BINCL)
+ else if (incl_type == (int) N_BINCL)
++nest;
else if (nest == 0)
*incl_map = -1;
@@ -4887,8 +4887,8 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs,
if (bfd_header_big_endian (input_bfd))
{
- r_index = ((rel->r_index[0] << 16)
- | (rel->r_index[1] << 8)
+ r_index = (((unsigned int) rel->r_index[0] << 16)
+ | ((unsigned int) rel->r_index[1] << 8)
| rel->r_index[2]);
r_extern = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
r_pcrel = (0 != (rel->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
@@ -4900,8 +4900,8 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs,
}
else
{
- r_index = ((rel->r_index[2] << 16)
- | (rel->r_index[1] << 8)
+ r_index = (((unsigned int) rel->r_index[2] << 16)
+ | ((unsigned int) rel->r_index[1] << 8)
| rel->r_index[0]);
r_extern = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
r_pcrel = (0 != (rel->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
@@ -5223,8 +5223,8 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
if (bfd_header_big_endian (input_bfd))
{
- r_index = ((rel->r_index[0] << 16)
- | (rel->r_index[1] << 8)
+ r_index = (((unsigned int) rel->r_index[0] << 16)
+ | ((unsigned int) rel->r_index[1] << 8)
| rel->r_index[2]);
r_extern = (0 != (rel->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG));
r_type = ((rel->r_type[0] & RELOC_EXT_BITS_TYPE_BIG)
@@ -5232,8 +5232,8 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
}
else
{
- r_index = ((rel->r_index[2] << 16)
- | (rel->r_index[1] << 8)
+ r_index = (((unsigned int) rel->r_index[2] << 16)
+ | ((unsigned int) rel->r_index[1] << 8)
| rel->r_index[0]);
r_extern = (0 != (rel->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE));
r_type = ((rel->r_type[0] & RELOC_EXT_BITS_TYPE_LITTLE)
@@ -5249,16 +5249,16 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
/* We are generating a relocateable output file, and must
modify the reloc accordingly. */
if (r_extern
- || r_type == RELOC_BASE10
- || r_type == RELOC_BASE13
- || r_type == RELOC_BASE22)
+ || r_type == (unsigned int) RELOC_BASE10
+ || r_type == (unsigned int) RELOC_BASE13
+ || r_type == (unsigned int) RELOC_BASE22)
{
/* If we know the symbol this relocation is against,
convert it into a relocation against a section. This
is what the native linker does. */
- if (r_type == RELOC_BASE10
- || r_type == RELOC_BASE13
- || r_type == RELOC_BASE22)
+ if (r_type == (unsigned int) RELOC_BASE10
+ || r_type == (unsigned int) RELOC_BASE13
+ || r_type == (unsigned int) RELOC_BASE22)
h = NULL;
else
h = sym_hashes[r_index];
@@ -5426,9 +5426,9 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
relocation = 0;
}
}
- else if (r_type == RELOC_BASE10
- || r_type == RELOC_BASE13
- || r_type == RELOC_BASE22)
+ else if (r_type == (unsigned int) RELOC_BASE10
+ || r_type == (unsigned int) RELOC_BASE13
+ || r_type == (unsigned int) RELOC_BASE22)
{
struct external_nlist *sym;
int type;
@@ -5510,9 +5510,9 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
to skip this reloc. */
if (hundef
&& ! finfo->info->shared
- && r_type != RELOC_BASE10
- && r_type != RELOC_BASE13
- && r_type != RELOC_BASE22)
+ && r_type != (unsigned int) RELOC_BASE10
+ && r_type != (unsigned int) RELOC_BASE13
+ && r_type != (unsigned int) RELOC_BASE22)
{
const char *name;
@@ -5526,7 +5526,7 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
return false;
}
- if (r_type != RELOC_SPARC_REV32)
+ if (r_type != (unsigned int) RELOC_SPARC_REV32)
r = MY_final_link_relocate (howto_table_ext + r_type,
input_bfd, input_section,
contents, r_addr, relocation,
@@ -5555,9 +5555,9 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
if (h != NULL)
name = h->root.root.string;
else if (r_extern
- || r_type == RELOC_BASE10
- || r_type == RELOC_BASE13
- || r_type == RELOC_BASE22)
+ || r_type == (unsigned int) RELOC_BASE10
+ || r_type == (unsigned int) RELOC_BASE13
+ || r_type == (unsigned int) RELOC_BASE22)
name = strings + GET_WORD (input_bfd,
syms[r_index].e_strx);
else
@@ -5673,7 +5673,7 @@ aout_link_reloc_link_order (finfo, o, p)
int r_relative;
int r_length;
- r_pcrel = howto->pc_relative;
+ r_pcrel = (int) howto->pc_relative;
r_baserel = (howto->type & 8) != 0;
r_jmptable = (howto->type & 16) != 0;
r_relative = (howto->type & 32) != 0;
diff --git a/bfd/archive.c b/bfd/archive.c
index d7ac214c724..bfbd6de116c 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -436,12 +436,12 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag)
spaces, so only look for ' ' if we don't find '/'. */
char *e;
- e = memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd));
+ e = (char *) memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd));
if (e == NULL)
{
- e = memchr (hdr.ar_name, '/', ar_maxnamelen (abfd));
+ e = (char *) memchr (hdr.ar_name, '/', ar_maxnamelen (abfd));
if (e == NULL)
- e = memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd));
+ e = (char *) memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd));
}
if (e != NULL)
@@ -2082,7 +2082,7 @@ _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;
@@ -2108,8 +2108,7 @@ _bfd_archive_bsd_update_armap_timestamp (arch)
|| (bfd_bwrite (hdr.ar_date, (bfd_size_type) 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;
diff --git a/bfd/archures.c b/bfd/archures.c
index f84fc136d1e..485fef27401 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -4,21 +4,21 @@
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"
@@ -147,11 +147,11 @@ DESCRIPTION
.#define bfd_mach_mipsisa32 32
.#define bfd_mach_mipsisa64 64
. bfd_arch_i386, {* Intel 386 *}
-.#define bfd_mach_i386_i386 0
-.#define bfd_mach_i386_i8086 1
-.#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 *}
@@ -160,6 +160,7 @@ 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
@@ -167,8 +168,8 @@ DESCRIPTION
.#define bfd_mach_h8300s 3
. 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
@@ -187,13 +188,13 @@ DESCRIPTION
.#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 *}
. 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 *}
@@ -205,7 +206,7 @@ DESCRIPTION
.#define bfd_mach_z8002 2
. bfd_arch_h8500, {* Hitachi H8/500 *}
. bfd_arch_sh, {* Hitachi SH *}
-.#define bfd_mach_sh 0
+.#define bfd_mach_sh 1
.#define bfd_mach_sh2 0x20
.#define bfd_mach_sh_dsp 0x2d
.#define bfd_mach_sh3 0x30
@@ -237,15 +238,15 @@ DESCRIPTION
. 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'
. 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
+.#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, {* Mitsubishi M32R/D *}
-.#define bfd_mach_m32r 0 {* For backwards compatibility. *}
+.#define bfd_mach_m32r 1 {* For backwards compatibility. *}
.#define bfd_mach_m32rx 'x'
. bfd_arch_mn10200, {* Matsushita MN10200 *}
. bfd_arch_mn10300, {* Matsushita MN10300 *}
@@ -254,19 +255,19 @@ DESCRIPTION
. 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
. 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 0
-.#define bfd_mach_ip2022ext 1
+.#define bfd_mach_ip2022 1
+.#define bfd_mach_ip2022ext 2
. bfd_arch_pj,
. bfd_arch_avr, {* Atmel AVR microcontrollers. *}
.#define bfd_mach_avr1 1
@@ -276,12 +277,12 @@ 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_last
. };
*/
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index f30e20d0cbd..f41e3fbf69d 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -41,10 +41,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. */
@@ -349,7 +345,7 @@ 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 = (boolean)true), true)
+#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)
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 38e5459d20b..8f4a48ba456 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1,7 +1,7 @@
/* 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".
+ "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.
@@ -47,10 +47,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. */
@@ -355,7 +351,7 @@ 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 = (boolean)true), true)
+#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)
@@ -1542,11 +1538,11 @@ enum bfd_architecture
#define bfd_mach_mipsisa32 32
#define bfd_mach_mipsisa64 64
bfd_arch_i386, /* Intel 386 */
-#define bfd_mach_i386_i386 0
-#define bfd_mach_i386_i8086 1
-#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 */
@@ -1555,6 +1551,7 @@ 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
@@ -1562,8 +1559,8 @@ enum bfd_architecture
#define bfd_mach_h8300s 3
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
@@ -1582,13 +1579,13 @@ enum bfd_architecture
#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 */
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 */
@@ -1600,7 +1597,7 @@ enum bfd_architecture
#define bfd_mach_z8002 2
bfd_arch_h8500, /* Hitachi H8/500 */
bfd_arch_sh, /* Hitachi SH */
-#define bfd_mach_sh 0
+#define bfd_mach_sh 1
#define bfd_mach_sh2 0x20
#define bfd_mach_sh_dsp 0x2d
#define bfd_mach_sh3 0x30
@@ -1632,15 +1629,15 @@ enum bfd_architecture
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'
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
+#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, /* Mitsubishi M32R/D */
-#define bfd_mach_m32r 0 /* For backwards compatibility. */
+#define bfd_mach_m32r 1 /* For backwards compatibility. */
#define bfd_mach_m32rx 'x'
bfd_arch_mn10200, /* Matsushita MN10200 */
bfd_arch_mn10300, /* Matsushita MN10300 */
@@ -1649,19 +1646,19 @@ enum bfd_architecture
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
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 0
-#define bfd_mach_ip2022ext 1
+#define bfd_mach_ip2022 1
+#define bfd_mach_ip2022ext 2
bfd_arch_pj,
bfd_arch_avr, /* Atmel AVR microcontrollers. */
#define bfd_mach_avr1 1
@@ -1671,12 +1668,12 @@ 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_last
};
@@ -2505,6 +2502,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. */
@@ -3529,6 +3534,11 @@ struct _bfd
struct cisco_core_struct *cisco_core_data;
struct versados_data_struct *versados_data;
struct netbsd_core_struct *netbsd_core_data;
+ 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;
PTR any;
}
tdata;
@@ -3729,6 +3739,27 @@ extern bfd_byte *bfd_get_relocated_section_contents
boolean
bfd_alt_mach_code PARAMS ((bfd *abfd, int alternative));
+struct bfd_preserve
+{
+ PTR marker;
+ PTR tdata;
+ flagword flags;
+ const struct bfd_arch_info *arch_info;
+ struct sec *sections;
+ struct sec **section_tail;
+ unsigned int section_count;
+ struct bfd_hash_table section_htab;
+};
+
+boolean
+bfd_preserve_save PARAMS ((bfd *, struct bfd_preserve *));
+
+void
+bfd_preserve_restore PARAMS ((bfd *, struct bfd_preserve *));
+
+void
+bfd_preserve_finish PARAMS ((bfd *, struct bfd_preserve *));
+
/* Extracted from archive.c. */
symindex
bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym));
@@ -3791,7 +3822,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 };
@@ -4121,6 +4156,17 @@ bfd_set_format PARAMS ((bfd *abfd, bfd_format format));
const char *
bfd_format_string PARAMS ((bfd_format format));
+/* Extracted from linker.c. */
+boolean
+bfd_link_split_section PARAMS ((bfd *abfd, asection *sec));
+
+#define bfd_link_split_section(abfd, sec) \
+ BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
+
+/* Extracted from simple.c. */
+bfd_byte *
+bfd_simple_get_relocated_section_contents PARAMS ((bfd *abfd, asection *sec, bfd_byte *outbuf));
+
#ifdef __cplusplus
}
#endif
diff --git a/bfd/bfd.c b/bfd/bfd.c
index cfd77726a3e..5412ac8bfc9 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -4,21 +4,21 @@
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
@@ -180,6 +180,11 @@ CODE_FRAGMENT
. struct cisco_core_struct *cisco_core_data;
. struct versados_data_struct *versados_data;
. struct netbsd_core_struct *netbsd_core_data;
+. 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;
. PTR any;
. }
. tdata;
@@ -196,6 +201,7 @@ CODE_FRAGMENT
*/
#include "bfd.h"
+#include "bfdver.h"
#include "sysdep.h"
#ifdef ANSI_PROTOTYPES
@@ -1293,10 +1299,10 @@ bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at,
m->p_type = type;
m->p_flags = flags;
m->p_paddr = at;
- m->p_flags_valid = flags_valid;
- m->p_paddr_valid = at_valid;
- m->includes_filehdr = includes_filehdr;
- m->includes_phdrs = includes_phdrs;
+ 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->count = count;
if (count > 0)
memcpy (m->sections, secs, count * sizeof (asection *));
@@ -1386,3 +1392,133 @@ bfd_alt_mach_code (abfd, alternative)
return false;
}
+
+/*
+CODE_FRAGMENT
+
+.struct bfd_preserve
+.{
+. PTR marker;
+. PTR tdata;
+. flagword flags;
+. const struct bfd_arch_info *arch_info;
+. struct sec *sections;
+. struct sec **section_tail;
+. unsigned int section_count;
+. struct bfd_hash_table section_htab;
+.};
+.
+*/
+
+/*
+FUNCTION
+ bfd_preserve_save
+
+SYNOPSIS
+ 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.
+
+*/
+
+boolean
+bfd_preserve_save (abfd, preserve)
+ 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 = 0;
+
+ 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 (abfd, preserve)
+ 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 (abfd, preserve)
+ 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/bfd/binary.c b/bfd/binary.c
index fc972b22d13..7bddabf5fa8 100644
--- a/bfd/binary.c
+++ b/bfd/binary.c
@@ -185,7 +185,7 @@ binary_get_symtab (abfd, alocation)
syms = (asymbol *) bfd_alloc (abfd, amt);
if (syms == NULL)
- return false;
+ return (long) false;
/* Start symbol. */
syms[0].the_bfd = abfd;
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c
index 5e7f907a959..25256a8b7bb 100644
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -1881,6 +1881,7 @@ record_arm_to_thumb_glue (info, h)
register asection * s;
char * tmp_name;
struct coff_link_hash_entry * myh;
+ struct bfd_link_hash_entry * bh;
struct coff_arm_link_hash_table * globals;
bfd_vma val;
bfd_size_type amt;
@@ -1915,10 +1916,10 @@ record_arm_to_thumb_glue (info, h)
though the section isn't allocated yet, this is where we will be putting
it. */
+ 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,
- (struct bfd_link_hash_entry **) & myh);
+ BSF_GLOBAL, s, val, NULL, true, false, &bh);
free (tmp_name);
@@ -1937,6 +1938,7 @@ record_thumb_to_arm_glue (info, h)
register asection * s;
char * tmp_name;
struct coff_link_hash_entry * myh;
+ struct bfd_link_hash_entry * bh;
struct coff_arm_link_hash_table * globals;
bfd_vma val;
bfd_size_type amt;
@@ -1967,12 +1969,13 @@ record_thumb_to_arm_glue (info, h)
return; /* we've already seen this guy */
}
+ 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,
- (struct bfd_link_hash_entry **) &myh);
+ 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;
myh->class = C_THUMBEXTFUNC;
free (tmp_name);
@@ -1989,11 +1992,10 @@ record_thumb_to_arm_glue (info, h)
sprintf (tmp_name, globals->support_old_code ? BACK_FROM_ARM : CHANGE_TO_ARM, name);
- myh = NULL;
+ 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,
- (struct bfd_link_hash_entry **) & myh);
+ BSF_LOCAL, s, val, NULL, true, false, &bh);
free (tmp_name);
diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c
index 82b7bca5b01..c83015e4efb 100644
--- a/bfd/coff-h8300.c
+++ b/bfd/coff-h8300.c
@@ -4,21 +4,21 @@
Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -87,8 +87,7 @@ static boolean h8300_bfd_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *
the generic linker hash table, not the COFF backend linker hash
table! We use this to attach additional data structures we
need while linking on the h8300. */
-struct h8300_coff_link_hash_table
-{
+struct h8300_coff_link_hash_table {
/* The main hash table. */
struct generic_link_hash_table root;
@@ -135,7 +134,7 @@ funcvec_hash_newfunc (entry, gen_table, string)
/* Call the allocation method of the superclass. */
ret = ((struct funcvec_hash_entry *)
- bfd_hash_newfunc ((struct bfd_hash_entry *) ret, gen_table, string));
+ bfd_hash_newfunc ((struct bfd_hash_entry *) ret, gen_table, string));
if (ret == NULL)
return NULL;
@@ -165,8 +164,8 @@ funcvec_hash_table_init (table, abfd, newfunc)
struct funcvec_hash_table *table;
bfd *abfd;
struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,
- struct bfd_hash_table *,
- const char *));
+ struct bfd_hash_table *,
+ const char *));
{
/* Initialize our local fields, then call the generic initialization
routine. */
@@ -232,8 +231,7 @@ special (abfd, reloc_entry, symbol, data, input_section, output_bfd,
return bfd_reloc_ok;
}
-static reloc_howto_type howto_table[] =
-{
+static reloc_howto_type howto_table[] = {
HOWTO (R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, special, "8", false, 0x000000ff, 0x000000ff, false),
HOWTO (R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, special, "16", false, 0x0000ffff, 0x0000ffff, false),
HOWTO (R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, special, "32", false, 0xffffffff, 0xffffffff, false),
@@ -270,9 +268,9 @@ static reloc_howto_type howto_table[] =
/* Turn a howto into a reloc number. */
#define SELECT_RELOC(x,howto) \
- { x.r_type = select_reloc(howto); }
+ { x.r_type = select_reloc (howto); }
-#define BADMAG(x) (H8300BADMAG(x) && H8300HBADMAG(x) && H8300SBADMAG(x))
+#define BADMAG(x) (H8300BADMAG (x) && H8300HBADMAG (x) && H8300SBADMAG (x))
#define H8300 1 /* Customize coffcode.h */
#define __A_MAGIC_SET__
@@ -365,15 +363,15 @@ rtype2howto (internal, dst)
}
}
-#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
+#define RTYPE2HOWTO(internal, relocentry) rtype2howto (internal, relocentry)
/* Perform any necessary magic to the addend in a reloc entry. */
#define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
- cache_ptr->addend = ext_reloc.r_offset;
+ cache_ptr->addend = ext_reloc.r_offset;
#define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \
- reloc_processing(relent, reloc, symbols, abfd, section)
+ reloc_processing (relent, reloc, symbols, abfd, section)
static void
reloc_processing (relent, reloc, symbols, abfd, section)
@@ -483,8 +481,15 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info)
/* If the distance is within -128..+128 inclusive, then we can relax
this jump. +128 is valid since the target will move two bytes
closer if we do relax this branch. */
- if ((int)gap >= -128 && (int)gap <= 128 )
+ if ((int) gap >= -128 && (int) gap <= 128)
{
+ bfd_byte code;
+
+ if (!bfd_get_section_contents (abfd, input_section, & code,
+ reloc->address, 1))
+ break;
+ code = bfd_get_8 (abfd, & code);
+
/* It's possible we may be able to eliminate this branch entirely;
if the previous instruction is a branch around this instruction,
and there's no label at this instruction, then we can reverse
@@ -496,9 +501,25 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info)
lab1: lab1:
This saves 4 bytes instead of two, and should be relatively
- common. */
-
- if (gap <= 126
+ common.
+
+ Only perform this optimisation for jumps (code 0x5a) not
+ subroutine calls, as otherwise it could transform:
+
+ mov.w r0,r0
+ beq .L1
+ jsr @_bar
+ .L1: rts
+ _bar: rts
+ into:
+ mov.w r0,r0
+ bne _bar
+ rts
+ _bar: rts
+
+ which changes the call (jsr) into a branch (bne). */
+ if (code == 0x5a
+ && gap <= 126
&& last_reloc
&& last_reloc->howto->type == R_PCRBYTE)
{
@@ -546,7 +567,7 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info)
/* If the distance is within -128..+128 inclusive, then we can relax
this jump. +128 is valid since the target will move two bytes
closer if we do relax this branch. */
- if ((int)gap >= -128 && (int)gap <= 128 )
+ if ((int) gap >= -128 && (int) gap <= 128)
{
/* Change the reloc type. */
reloc->howto = howto_table + 15;
@@ -736,7 +757,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
/* Sanity check. */
if (value <= 0xff
|| (value >= 0x0000ff00 && value <= 0x0000ffff)
- || (value >= 0x00ffff00 && value <= 0x00ffffff)
+ || (value >= 0x00ffff00 && value <= 0x00ffffff)
|| (value >= 0xffffff00 && value <= 0xffffffff))
{
/* Everything looks OK. Apply the relocation and update the
@@ -804,7 +825,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
/* Fix the opcode. For all the move insns, we simply
need to turn off bit 0x20 in the previous byte. */
- data[dst_address - 1] &= ~0x20;
+ data[dst_address - 1] &= ~0x20;
dst_address += 2;
src_address += 4;
}
@@ -815,7 +836,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
- }
+ }
break;
/* A 16bit absolute branch that is now an 8-bit pc-relative branch. */
@@ -912,14 +933,14 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
abort ();
}
- /* Output the target. */
- bfd_put_8 (abfd, gap, data + dst_address - 1);
+ /* Output the target. */
+ bfd_put_8 (abfd, gap, data + dst_address - 1);
- /* We don't advance dst_address -- the 8bit reloc is applied at
- dst_address - 1, so the next insn should begin at dst_address. */
- src_address += 2;
+ /* We don't advance dst_address -- the 8bit reloc is applied at
+ dst_address - 1, so the next insn should begin at dst_address. */
+ src_address += 2;
- break;
+ break;
/* Similarly for a 24bit absolute that is now 8 bits. */
case R_JMPL2:
diff --git a/bfd/coff-stgo32.c b/bfd/coff-stgo32.c
index 5d867ea40b9..5c80b11b5d3 100644
--- a/bfd/coff-stgo32.c
+++ b/bfd/coff-stgo32.c
@@ -32,8 +32,7 @@
image and NOT in the file.
To be compatible with any existing executables I have fixed this
- here and NOT in the DJGPP startup code.
- */
+ here and NOT in the DJGPP startup code. */
#define TARGET_SYM go32stubbedcoff_vec
#define TARGET_NAME "coff-go32-exe"
@@ -55,40 +54,32 @@
#include "bfd.h"
-/* At first the prototypes */
+/* At first the prototypes. */
static void
-adjust_filehdr_in_post PARAMS ((bfd * abfd, PTR src, PTR dst));
+adjust_filehdr_in_post PARAMS ((bfd *, PTR, PTR));
static void
-adjust_filehdr_out_pre PARAMS ((bfd * abfd, PTR in, PTR out));
+adjust_filehdr_out_pre PARAMS ((bfd *, PTR, PTR));
static void
-adjust_filehdr_out_post PARAMS ((bfd * abfd, PTR in, PTR out));
-
+adjust_filehdr_out_post PARAMS ((bfd *, PTR, PTR));
static void
-adjust_scnhdr_in_post PARAMS ((bfd * abfd, PTR ext, PTR in));
+adjust_scnhdr_in_post PARAMS ((bfd *, PTR, PTR));
static void
-adjust_scnhdr_out_pre PARAMS ((bfd * abfd, PTR in, PTR out));
+adjust_scnhdr_out_pre PARAMS ((bfd *, PTR, PTR));
static void
-adjust_scnhdr_out_post PARAMS ((bfd * abfd, PTR in, PTR out));
-
+adjust_scnhdr_out_post PARAMS ((bfd *, PTR, PTR));
static void
-adjust_aux_in_post PARAMS ((bfd * abfd, PTR ext1, int type, int class, int indx,
- int numaux, PTR in1));
+adjust_aux_in_post PARAMS ((bfd *, PTR, int, int, int, int, PTR));
static void
-adjust_aux_out_pre PARAMS ((bfd * abfd, PTR inp, int type, int class, int indx,
- int numaux, PTR extp));
+adjust_aux_out_pre PARAMS ((bfd *, PTR, int, int, int, int, PTR));
static void
-adjust_aux_out_post PARAMS ((bfd * abfd, PTR inp, int type, int class, int indx,
- int numaux, PTR extp));
-
+adjust_aux_out_post PARAMS ((bfd *, PTR, int, int, int, int, PTR));
static void
-create_go32_stub PARAMS ((bfd * abfd));
+create_go32_stub PARAMS ((bfd *));
-/*
- All that ..._PRE and ...POST functions are called from the corresponding
+/* All that ..._PRE and ...POST functions are called from the corresponding
coff_swap... functions. The ...PRE functions are called at the beginning
- of the function and the ...POST functions at the end of the swap routines.
- */
+ of the function and the ...POST functions at the end of the swap routines. */
#define COFF_ADJUST_FILEHDR_IN_POST adjust_filehdr_in_post
#define COFF_ADJUST_FILEHDR_OUT_PRE adjust_filehdr_out_pre
@@ -103,23 +94,23 @@ create_go32_stub PARAMS ((bfd * abfd));
#define COFF_ADJUST_AUX_OUT_POST adjust_aux_out_post
static boolean
- go32_stubbed_coff_bfd_copy_private_bfd_data PARAMS ((bfd * ibfd, bfd * obfd));
+ go32_stubbed_coff_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *));
#define coff_bfd_copy_private_bfd_data go32_stubbed_coff_bfd_copy_private_bfd_data
#include "coff-i386.c"
-/* I hold in the usrdata the stub */
+/* I hold in the usrdata the stub. */
#define bfd_coff_go32stub bfd_usrdata
/* This macro is used, because I cannot assume the endianess of the
- host system */
+ host system. */
#define _H(index) (H_GET_16 (abfd, (header+index*2)))
/* These bytes are a 2048-byte DOS executable, which loads the COFF
- image into memory and then runs it. It is called 'stub' */
+ image into memory and then runs it. It is called 'stub'. */
-static unsigned char stub_bytes[STUBSIZE] =
+static const unsigned char stub_bytes[STUBSIZE] =
{
#include "go32stub.h"
};
@@ -129,10 +120,10 @@ static unsigned char stub_bytes[STUBSIZE] =
technique is in any function the same. For the ...in function,
all the pointers are adjusted by adding STUBSIZE and for the
...out function, it is subtracted first and after calling the
- standard swap function it is reset to the old value */
+ standard swap function it is reset to the old value. */
/* This macro is used for adjusting the filepointers, which
- is done only, if the pointer is nonzero */
+ is done only, if the pointer is nonzero. */
#define ADJUST_VAL(val,diff) \
if (val != 0) val += diff
@@ -148,13 +139,13 @@ adjust_filehdr_in_post (abfd, src, dst)
ADJUST_VAL (filehdr_dst->f_symptr, STUBSIZE);
- /* Save now the stub to be used later */
+ /* Save now the stub to be used later. */
bfd_coff_go32stub (abfd) = (PTR) bfd_alloc (abfd, (bfd_size_type) STUBSIZE);
/* Since this function returns no status, I do not set here
any bfd_error_...
That means, before the use of bfd_coff_go32stub (), this value
- should be checked if it is != NULL */
+ should be checked if it is != NULL. */
if (bfd_coff_go32stub (abfd) == NULL)
return;
memcpy (bfd_coff_go32stub (abfd), filehdr_src->stub, STUBSIZE);
@@ -169,14 +160,14 @@ adjust_filehdr_out_pre (abfd, in, out)
struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in;
FILHDR *filehdr_out = (FILHDR *) out;
- /* Generate the stub */
+ /* Generate the stub. */
create_go32_stub (abfd);
- /* Copy the stub to the file header */
+ /* Copy the stub to the file header. */
if (bfd_coff_go32stub (abfd) != NULL)
memcpy (filehdr_out->stub, bfd_coff_go32stub (abfd), STUBSIZE);
else
- /* use the default */
+ /* Use the default. */
memcpy (filehdr_out->stub, stub_bytes, STUBSIZE);
ADJUST_VAL (filehdr_in->f_symptr, -STUBSIZE);
@@ -189,7 +180,7 @@ adjust_filehdr_out_post (abfd, in, out)
PTR out ATTRIBUTE_UNUSED;
{
struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in;
- /* undo the above change */
+ /* Undo the above change. */
ADJUST_VAL (filehdr_in->f_symptr, STUBSIZE);
}
@@ -286,8 +277,7 @@ adjust_aux_out_post (abfd, inp, type, class, indx, numaux, extp)
}
}
-/*
- That's the function, which creates the stub. There are
+/* That's the function, which creates the stub. There are
different cases from where the stub is taken.
At first the environment variable $(GO32STUB) is checked and then
$(STUB) if it was not set.
@@ -297,14 +287,13 @@ adjust_aux_out_post (abfd, inp, type, class, indx, numaux, extp)
file.
If there was any error, the standard stub (compiled in this file)
- is taken.
- */
+ is taken. */
static void
create_go32_stub (abfd)
bfd *abfd;
{
- /* Do it only once */
+ /* Do it only once. */
if (bfd_coff_go32stub (abfd) == NULL)
{
char *stub;
@@ -315,9 +304,9 @@ create_go32_stub (abfd)
unsigned long coff_start;
long exe_start;
- /* Check at first the environment variable $(GO32STUB) */
+ /* Check at first the environment variable $(GO32STUB). */
stub = getenv ("GO32STUB");
- /* Now check the environment variable $(STUB) */
+ /* Now check the environment variable $(STUB). */
if (stub == NULL)
stub = getenv ("STUB");
if (stub == NULL)
@@ -336,19 +325,19 @@ create_go32_stub (abfd)
close (f);
goto stub_end;
}
- if (_H (0) != 0x5a4d) /* it is not an exe file */
+ if (_H (0) != 0x5a4d) /* It is not an exe file. */
{
close (f);
goto stub_end;
}
/* Compute the size of the stub (it is every thing up
- to the beginning of the coff image) */
+ to the beginning of the coff image). */
coff_start = (long) _H (2) * 512L;
if (_H (1))
coff_start += (long) _H (1) - 512L;
/* Currently there is only a fixed stub size of 2048 bytes
- supported */
+ supported. */
if (coff_start != 2048)
{
close (f);
@@ -370,7 +359,7 @@ create_go32_stub (abfd)
close (f);
goto stub_end;
}
- /* Now we found a correct stub (hopefully) */
+ /* Now we found a correct stub (hopefully). */
bfd_coff_go32stub (abfd)
= (PTR) bfd_alloc (abfd, (bfd_size_type) coff_start);
if (bfd_coff_go32stub (abfd) == NULL)
@@ -389,39 +378,35 @@ create_go32_stub (abfd)
}
stub_end:
/* There was something wrong above, so use now the standard builtin
- stub */
+ stub. */
if (bfd_coff_go32stub (abfd) == NULL)
{
bfd_coff_go32stub (abfd)
= (PTR) bfd_alloc (abfd, (bfd_size_type) STUBSIZE);
if (bfd_coff_go32stub (abfd) == NULL)
- {
- return;
- }
-
+ return;
memcpy (bfd_coff_go32stub (abfd), stub_bytes, STUBSIZE);
}
}
/* If ibfd was a stubbed coff image, copy the stub from that bfd
- to the new obfd.
- */
+ to the new obfd. */
static boolean
go32_stubbed_coff_bfd_copy_private_bfd_data (ibfd, obfd)
bfd *ibfd;
bfd *obfd;
{
- /* check if both are the same targets */
+ /* Check if both are the same targets. */
if (ibfd->xvec != obfd->xvec)
return true;
- /* check if both have a valid stub */
+ /* Check if both have a valid stub. */
if (bfd_coff_go32stub (ibfd) == NULL
|| bfd_coff_go32stub (obfd) == NULL)
return true;
- /* Now copy the stub */
+ /* Now copy the stub. */
memcpy (bfd_coff_go32stub (obfd), bfd_coff_go32stub (ibfd), STUBSIZE);
return true;
diff --git a/bfd/coff-tic4x.c b/bfd/coff-tic4x.c
index 561d161f82f..8afd04a614d 100644
--- a/bfd/coff-tic4x.c
+++ b/bfd/coff-tic4x.c
@@ -123,20 +123,20 @@ tic4x_relocation (abfd, reloc_entry, symbol, data, input_section,
reloc_howto_type tic4x_howto_table[] =
{
- HOWTO(R_RELWORD, 0, 2, 16, false, 0, complain_overflow_signed, tic4x_relocation, "RELWORD", true, 0x0000ffff, 0x0000ffff, false),
+ HOWTO(R_RELWORD, 0, 2, 16, false, 0, complain_overflow_signed, tic4x_relocation, "RELWORD", true, 0x0000ffff, 0x0000ffff, false),
HOWTO(R_REL24, 0, 2, 24, false, 0, complain_overflow_bitfield, tic4x_relocation, "REL24", true, 0x00ffffff, 0x00ffffff, false),
- HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_dont, tic4x_relocation, "RELLONG", true, 0xffffffff, 0xffffffff, false),
- HOWTO(R_PCRWORD, 0, 2, 16, true, 0, complain_overflow_signed, tic4x_relocation, "PCRWORD", true, 0x0000ffff, 0x0000ffff, false),
- HOWTO(R_PCR24, 0, 2, 24, true, 0, complain_overflow_signed, tic4x_relocation, "PCR24", true, 0x00ffffff, 0x00ffffff, false),
- HOWTO(R_PARTLS16, 0, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "PARTLS16", true, 0x0000ffff, 0x0000ffff, false),
- HOWTO(R_PARTMS8, 16, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "PARTMS8", true, 0x0000ffff, 0x0000ffff, false),
- HOWTO(R_RELWORD, 0, 2, 16, false, 0, complain_overflow_signed, tic4x_relocation, "ARELWORD", true, 0x0000ffff, 0x0000ffff, false),
- HOWTO(R_REL24, 0, 2, 24, false, 0, complain_overflow_signed, tic4x_relocation, "AREL24", true, 0x00ffffff, 0x00ffffff, false),
- HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_signed, tic4x_relocation, "ARELLONG", true, 0xffffffff, 0xffffffff, false),
- HOWTO(R_PCRWORD, 0, 2, 16, true, 0, complain_overflow_signed, tic4x_relocation, "APCRWORD", true, 0x0000ffff, 0x0000ffff, false),
- HOWTO(R_PCR24, 0, 2, 24, true, 0, complain_overflow_signed, tic4x_relocation, "APCR24", true, 0x00ffffff, 0x00ffffff, false),
- HOWTO(R_PARTLS16, 0, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "APARTLS16", true, 0x0000ffff, 0x0000ffff, false),
- HOWTO(R_PARTMS8, 16, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "APARTMS8", true, 0x0000ffff, 0x0000ffff, false),
+ HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_dont, tic4x_relocation, "RELLONG", true, 0xffffffff, 0xffffffff, false),
+ HOWTO(R_PCRWORD, 0, 2, 16, true, 0, complain_overflow_signed, tic4x_relocation, "PCRWORD", true, 0x0000ffff, 0x0000ffff, false),
+ HOWTO(R_PCR24, 0, 2, 24, true, 0, complain_overflow_signed, tic4x_relocation, "PCR24", true, 0x00ffffff, 0x00ffffff, false),
+ HOWTO(R_PARTLS16, 0, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "PARTLS16", true, 0x0000ffff, 0x0000ffff, false),
+ HOWTO(R_PARTMS8, 16, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "PARTMS8", true, 0x0000ffff, 0x0000ffff, false),
+ HOWTO(R_RELWORD, 0, 2, 16, false, 0, complain_overflow_signed, tic4x_relocation, "ARELWORD", true, 0x0000ffff, 0x0000ffff, false),
+ HOWTO(R_REL24, 0, 2, 24, false, 0, complain_overflow_signed, tic4x_relocation, "AREL24", true, 0x00ffffff, 0x00ffffff, false),
+ HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_signed, tic4x_relocation, "ARELLONG", true, 0xffffffff, 0xffffffff, false),
+ HOWTO(R_PCRWORD, 0, 2, 16, true, 0, complain_overflow_signed, tic4x_relocation, "APCRWORD", true, 0x0000ffff, 0x0000ffff, false),
+ HOWTO(R_PCR24, 0, 2, 24, true, 0, complain_overflow_signed, tic4x_relocation, "APCR24", true, 0x00ffffff, 0x00ffffff, false),
+ HOWTO(R_PARTLS16, 0, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "APARTLS16", true, 0x0000ffff, 0x0000ffff, false),
+ HOWTO(R_PARTMS8, 16, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "APARTMS8", true, 0x0000ffff, 0x0000ffff, false),
};
#define HOWTO_SIZE (sizeof(tic4x_howto_table) / sizeof(tic4x_howto_table[0]))
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index e47b4d0050f..694fb12f4d8 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -1246,7 +1246,7 @@ 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)\
+. boolean (*_bfd_coff_adjust_symndx)
. PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
. struct internal_reloc *, boolean *));
.
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index ee6c8fce545..21589c6945a 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -2196,7 +2196,7 @@ _bfd_coff_is_local_label_name (abfd, name)
bfd *abfd ATTRIBUTE_UNUSED;
const char *name;
{
- return name[0] == '.' && name[1] == 'L';
+ return (boolean) (name[0] == '.' && name[1] == 'L');
}
/* Provided a BFD, a section and an offset (in bytes, not octets) into the
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index eb9388fc71e..c1302ee878a 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -1322,6 +1322,9 @@ mark_relocs (finfo, input_bfd)
if ((a->flags & SEC_RELOC) == 0 || a->reloc_count < 1)
continue;
+ /* Don't mark relocs in excluded sections. */
+ if (a->output_section == bfd_abs_section_ptr)
+ continue;
/* Read in the relocs. */
internal_relocs = _bfd_coff_read_internal_relocs
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 4aabfedaf53..9270d7e9e85 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -139,8 +139,8 @@ case "${targ}" in
targ_underscore=yes
;;
arm-*-nto* | nto*arm*)
- targ_defvec=bfd_elf32_littlearmqnx_vec
- targ_selvecs=bfd_elf32_bigarmqnx_vec
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
;;
arm-*-riscix*)
targ_defvec=riscix_vec
@@ -370,8 +370,8 @@ case "${targ}" in
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386coff_vec
;;
- i[3456]86-*-nto-qnx*)
- targ_defvec=bfd_elf32_i386qnx_vec
+ i[3456]86-*-nto*)
+ targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386coff_vec
;;
i[3456]86-*-chorus*)
@@ -393,6 +393,11 @@ case "${targ}" in
targ_defvec=bfd_elf32_i386_vec
targ_selvecs="i386coff_vec i386aout_vec"
;;
+ i[3456]86-*-darwin* | i[3456]86-*-macos10* | i[3456]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[3456]86-sequent-bsd*)
targ_defvec=i386dynix_vec
targ_underscore=yes
@@ -691,11 +696,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"
+ targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec"
;;
mips*-dec-bsd*)
targ_defvec=aout_mips_little_vec
@@ -885,6 +890,11 @@ case "${targ}" in
targ_selvecs="rs6000coff_vec 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
;;
@@ -893,12 +903,12 @@ case "${targ}" in
targ_selvecs="nlm32_powerpc_vec rs6000coff_vec"
;;
powerpc-*-nto*)
- targ_defvec=bfd_elf32_powerpcqnx_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpcleqnx_vec ppcboot_vec"
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
;;
powerpcle-*-nto*)
- targ_defvec=bfd_elf32_powerpcleqnx_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpcqnx_vec ppcboot_vec"
+ 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* |\
@@ -915,10 +925,12 @@ case "${targ}" in
s390-*-linux*)
targ_defvec=bfd_elf32_s390_vec
+ targ64_selvecs=bfd_elf64_s390_vec
;;
#ifdef BFD64
s390x-*-linux*)
targ_defvec=bfd_elf64_s390_vec
+ targ_selvecs=bfd_elf32_s390_vec
;;
#endif
@@ -934,12 +946,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 */
@@ -947,14 +959,16 @@ 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*)
targ_defvec=bfd_elf32_shblin_vec
+ targ_selvecs=bfd_elf32_shlin_vec
;;
sh*-*-linux*)
targ_defvec=bfd_elf32_shlin_vec
+ targ_selvecs=bfd_elf32_shblin_vec
;;
#ifdef BFD64
@@ -981,7 +995,7 @@ case "${targ}" in
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*)
@@ -992,7 +1006,7 @@ case "${targ}" in
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*)
@@ -1017,8 +1031,8 @@ case "${targ}" in
targ_underscore=yes
;;
sh-*-nto*)
- targ_defvec=bfd_elf32_shqnx_vec
- targ_selvecs="bfd_elf32_shlqnx_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
+ 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)
diff --git a/bfd/configure b/bfd/configure
index 2ca10f7e37f..6eb4abbd3f8 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -1206,14 +1206,13 @@ fi
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 +1222,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:1226: 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 +1254,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:1258: 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 +1286,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:1290: 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
@@ -1402,7 +1401,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:1405: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1432,10 +1431,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:1435: 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:1438: 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 +1469,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:1473: 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 +1486,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:1490: 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 +1498,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:1502: 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 +1536,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:1540: 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 +1557,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:1561: 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
@@ -1731,13 +1730,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:1734: 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:1740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -1757,7 +1756,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:1760: 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,7 +1766,7 @@ 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:1770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -1794,7 +1793,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:1797: 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 +1855,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:1859: 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 +1926,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:1930: 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 +1958,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:1962: 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 +1993,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:1997: 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 +2025,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:2029: 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 +2092,8 @@ 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 2096 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
@@ -2113,7 +2112,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:2116: \"$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 +2130,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:2134: 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 +2143,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 <<EOF
-#line 2148 "configure"
+#line 2147 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2154: \"$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
@@ -2341,7 +2340,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:2344: 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,7 +2363,7 @@ fi
echo $ac_n "checking whether to install libbfd""... $ac_c" 1>&6
-echo "configure:2368: checking whether to install libbfd" >&5
+echo "configure:2367: 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"
@@ -2401,7 +2400,7 @@ fi
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2405: checking for executable suffix" >&5
+echo "configure:2404: 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,7 +2410,7 @@ 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:2414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -2441,7 +2440,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:2444: 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 +2470,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:2474: 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 +2521,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:2525: 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 +2553,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:2557: 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 +2564,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 2569 "configure"
+#line 2568 "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:2573: \"$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 +2595,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:2599: 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:2604: 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 +2609,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:2613: \"$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 +2628,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:2632: 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
@@ -2663,7 +2662,7 @@ fi
ALL_LINGUAS="fr tr ja es sv da"
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:2666: 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 +2677,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 2682 "configure"
+#line 2681 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2687: \"$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 +2694,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2699 "configure"
+#line 2698 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2704: \"$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 +2711,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2716 "configure"
+#line 2715 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2721: \"$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 +2744,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:2748: 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 +2772,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:2776: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2782 "configure"
+#line 2781 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2786,7 +2785,7 @@ else
#include <float.h>
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:2789: \"$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 +2802,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
-#line 2807 "configure"
+#line 2806 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2821,7 +2820,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
-#line 2825 "configure"
+#line 2824 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2842,7 +2841,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2846 "configure"
+#line 2845 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2853,7 +2852,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:2856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2877,12 +2876,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2881: checking for working const" >&5
+echo "configure:2880: 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 <<EOF
-#line 2886 "configure"
+#line 2885 "configure"
#include "confdefs.h"
int main() {
@@ -2931,7 +2930,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:2935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -2952,21 +2951,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2956: checking for inline" >&5
+echo "configure:2955: 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 <<EOF
-#line 2963 "configure"
+#line 2962 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:2970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -2992,12 +2991,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2996: checking for off_t" >&5
+echo "configure:2995: 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 <<EOF
-#line 3001 "configure"
+#line 3000 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3025,12 +3024,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3029: checking for size_t" >&5
+echo "configure:3028: 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 <<EOF
-#line 3034 "configure"
+#line 3033 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3060,19 +3059,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:3063: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3069 "configure"
+#line 3068 "configure"
#include "confdefs.h"
#include <alloca.h>
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:3075: \"$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 +3092,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3097: checking for alloca" >&5
+echo "configure:3096: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3102 "configure"
+#line 3101 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -3126,7 +3125,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:3130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3129: \"$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 +3157,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:3161: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3167 "configure"
+#line 3166 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -3188,12 +3187,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3192: checking for $ac_func" >&5
+echo "configure:3191: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3197 "configure"
+#line 3196 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3216,7 +3215,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3219: \"$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 +3242,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:3246: 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 +3250,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 3255 "configure"
+#line 3254 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -3270,7 +3269,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:3274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3273: \"$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
@@ -3295,17 +3294,17 @@ 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:3298: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3304 "configure"
+#line 3303 "configure"
#include "confdefs.h"
#include <$ac_hdr>
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:3308: \"$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 +3333,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:3337: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3343 "configure"
+#line 3342 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3362,7 +3361,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3365: \"$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 +3386,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3391: checking for working mmap" >&5
+echo "configure:3390: 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 +3394,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 3399 "configure"
+#line 3398 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3548,7 +3547,7 @@ main()
}
EOF
-if { (eval echo configure:3552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3551: \"$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
@@ -3576,17 +3575,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:3580: checking for $ac_hdr" >&5
+echo "configure:3579: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3585 "configure"
+#line 3584 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3589: \"$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*
@@ -3616,12 +3615,12 @@ done
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3620: checking for $ac_func" >&5
+echo "configure:3619: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3625 "configure"
+#line 3624 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3644,7 +3643,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3647: \"$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
@@ -3673,12 +3672,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3677: checking for $ac_func" >&5
+echo "configure:3676: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3682 "configure"
+#line 3681 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3701,7 +3700,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3704: \"$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
@@ -3735,19 +3734,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3739: checking for LC_MESSAGES" >&5
+echo "configure:3738: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3744 "configure"
+#line 3743 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:3751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3750: \"$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
@@ -3768,7 +3767,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3772: checking whether NLS is requested" >&5
+echo "configure:3771: 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"
@@ -3788,7 +3787,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3792: checking whether included gettext is requested" >&5
+echo "configure:3791: 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"
@@ -3807,17 +3806,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3811: checking for libintl.h" >&5
+echo "configure:3810: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3816 "configure"
+#line 3815 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3820: \"$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*
@@ -3834,19 +3833,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:3838: checking for gettext in libc" >&5
+echo "configure:3837: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3843 "configure"
+#line 3842 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:3850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3849: \"$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
@@ -3862,7 +3861,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:3866: checking for bindtextdomain in -lintl" >&5
+echo "configure:3865: 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
@@ -3870,7 +3869,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3874 "configure"
+#line 3873 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3881,7 +3880,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:3885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3884: \"$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
@@ -3897,19 +3896,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:3901: checking for gettext in libintl" >&5
+echo "configure:3900: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3906 "configure"
+#line 3905 "configure"
#include "confdefs.h"
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:3913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3912: \"$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
@@ -3937,7 +3936,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:3941: checking for $ac_word" >&5
+echo "configure:3940: 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
@@ -3971,12 +3970,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3975: checking for $ac_func" >&5
+echo "configure:3974: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3980 "configure"
+#line 3979 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3999,7 +3998,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4002: \"$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
@@ -4026,7 +4025,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:4030: checking for $ac_word" >&5
+echo "configure:4029: 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
@@ -4062,7 +4061,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:4066: checking for $ac_word" >&5
+echo "configure:4065: 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
@@ -4094,7 +4093,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 4098 "configure"
+#line 4097 "configure"
#include "confdefs.h"
int main() {
@@ -4102,7 +4101,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:4106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -4134,7 +4133,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:4138: checking for $ac_word" >&5
+echo "configure:4137: 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
@@ -4168,7 +4167,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:4172: checking for $ac_word" >&5
+echo "configure:4171: 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
@@ -4204,7 +4203,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:4208: checking for $ac_word" >&5
+echo "configure:4207: 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
@@ -4294,7 +4293,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:4298: checking for catalogs to be installed" >&5
+echo "configure:4297: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -4322,17 +4321,17 @@ echo "configure:4298: 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:4326: checking for linux/version.h" >&5
+echo "configure:4325: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4331 "configure"
+#line 4330 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4335: \"$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*
@@ -4410,7 +4409,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:4414: checking for a BSD compatible install" >&5
+echo "configure:4413: 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
@@ -4493,7 +4492,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:4497: checking for build system executable suffix" >&5
+echo "configure:4496: 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
@@ -4521,17 +4520,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:4525: checking for $ac_hdr" >&5
+echo "configure:4524: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4530 "configure"
+#line 4529 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4534: \"$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*
@@ -4561,17 +4560,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:4565: checking for $ac_hdr" >&5
+echo "configure:4564: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4570 "configure"
+#line 4569 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4575: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4574: \"$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*
@@ -4598,12 +4597,12 @@ fi
done
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:4602: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:4601: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4607 "configure"
+#line 4606 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -4612,7 +4611,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:4616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -4637,12 +4636,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:4641: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4640: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4646 "configure"
+#line 4645 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -4650,7 +4649,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:4654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -4675,7 +4674,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:4679: checking for opendir in -ldir" >&5
+echo "configure:4678: 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
@@ -4683,7 +4682,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4687 "configure"
+#line 4686 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4694,7 +4693,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4697: \"$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
@@ -4716,7 +4715,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4720: checking for opendir in -lx" >&5
+echo "configure:4719: 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
@@ -4724,7 +4723,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4728 "configure"
+#line 4727 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4735,7 +4734,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4760,12 +4759,12 @@ fi
for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4764: checking for $ac_func" >&5
+echo "configure:4763: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4769 "configure"
+#line 4768 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4788,7 +4787,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4791: \"$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
@@ -4823,12 +4822,12 @@ EOF
esac
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4827: checking whether strstr must be declared" >&5
+echo "configure:4826: checking whether strstr must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4832 "configure"
+#line 4831 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4849,7 +4848,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:4853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -4870,12 +4869,12 @@ EOF
fi
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:4874: checking whether malloc must be declared" >&5
+echo "configure:4873: checking whether malloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4879 "configure"
+#line 4878 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4896,7 +4895,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:4900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_malloc=no
else
@@ -4917,12 +4916,12 @@ EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:4921: checking whether realloc must be declared" >&5
+echo "configure:4920: checking whether realloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4926 "configure"
+#line 4925 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4943,7 +4942,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:4947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_realloc=no
else
@@ -4964,12 +4963,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:4968: checking whether free must be declared" >&5
+echo "configure:4967: checking whether free must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4973 "configure"
+#line 4972 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4990,7 +4989,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:4994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -5011,12 +5010,12 @@ EOF
fi
echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:5015: checking whether getenv must be declared" >&5
+echo "configure:5014: checking whether getenv must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5020 "configure"
+#line 5019 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -5037,7 +5036,7 @@ int main() {
char *(*pfn) = (char *(*)) getenv
; return 0; }
EOF
-if { (eval echo configure:5041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5040: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_getenv=no
else
@@ -5224,16 +5223,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:5228: checking for c_impl in struct core_dumpx" >&5
+echo "configure:5227: checking for c_impl in struct core_dumpx" >&5
cat > conftest.$ac_ext <<EOF
-#line 5230 "configure"
+#line 5229 "configure"
#include "confdefs.h"
#include <core.h>
int main() {
struct core_dumpx c; c.c_impl = 0;
; return 0; }
EOF
-if { (eval echo configure:5237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_ST_C_IMPL 1
@@ -5301,17 +5300,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:5305: checking for $ac_hdr" >&5
+echo "configure:5304: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5310 "configure"
+#line 5309 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5314: \"$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*
@@ -5339,12 +5338,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:5343: checking for prstatus_t in sys/procfs.h" >&5
+echo "configure:5342: checking for prstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5348 "configure"
+#line 5347 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5353,7 +5352,7 @@ int main() {
prstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prstatus_t=yes
else
@@ -5375,12 +5374,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:5379: checking for prstatus32_t in sys/procfs.h" >&5
+echo "configure:5378: checking for prstatus32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5384 "configure"
+#line 5383 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5389,7 +5388,7 @@ int main() {
prstatus32_t avar
; return 0; }
EOF
-if { (eval echo configure:5393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prstatus32_t=yes
else
@@ -5411,12 +5410,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:5415: checking for prstatus_t.pr_who in sys/procfs.h" >&5
+echo "configure:5414: checking for prstatus_t.pr_who in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5420 "configure"
+#line 5419 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5425,7 +5424,7 @@ int main() {
prstatus_t avar; void* aref = (void*) &avar.pr_who
; return 0; }
EOF
-if { (eval echo configure:5429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5428: \"$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
@@ -5447,12 +5446,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:5451: checking for prstatus32_t.pr_who in sys/procfs.h" >&5
+echo "configure:5450: checking for prstatus32_t.pr_who in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5456 "configure"
+#line 5455 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5461,7 +5460,7 @@ int main() {
prstatus32_t avar; void* aref = (void*) &avar.pr_who
; return 0; }
EOF
-if { (eval echo configure:5465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5464: \"$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
@@ -5483,12 +5482,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:5487: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:5486: checking for pstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5492 "configure"
+#line 5491 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5497,7 +5496,7 @@ int main() {
pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus_t=yes
else
@@ -5519,12 +5518,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:5523: checking for pxstatus_t in sys/procfs.h" >&5
+echo "configure:5522: checking for pxstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5528 "configure"
+#line 5527 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5533,7 +5532,7 @@ int main() {
pxstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pxstatus_t=yes
else
@@ -5555,12 +5554,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:5559: checking for pstatus32_t in sys/procfs.h" >&5
+echo "configure:5558: checking for pstatus32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5564 "configure"
+#line 5563 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5569,7 +5568,7 @@ int main() {
pstatus32_t avar
; return 0; }
EOF
-if { (eval echo configure:5573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus32_t=yes
else
@@ -5591,12 +5590,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:5595: checking for prpsinfo_t in sys/procfs.h" >&5
+echo "configure:5594: checking for prpsinfo_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5600 "configure"
+#line 5599 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5605,7 +5604,7 @@ int main() {
prpsinfo_t avar
; return 0; }
EOF
-if { (eval echo configure:5609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prpsinfo_t=yes
else
@@ -5627,12 +5626,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:5631: checking for prpsinfo32_t in sys/procfs.h" >&5
+echo "configure:5630: checking for prpsinfo32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5636 "configure"
+#line 5635 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5641,7 +5640,7 @@ int main() {
prpsinfo32_t avar
; return 0; }
EOF
-if { (eval echo configure:5645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes
else
@@ -5663,12 +5662,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:5667: checking for psinfo_t in sys/procfs.h" >&5
+echo "configure:5666: checking for psinfo_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5672 "configure"
+#line 5671 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5677,7 +5676,7 @@ int main() {
psinfo_t avar
; return 0; }
EOF
-if { (eval echo configure:5681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psinfo_t=yes
else
@@ -5699,12 +5698,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:5703: checking for psinfo32_t in sys/procfs.h" >&5
+echo "configure:5702: checking for psinfo32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5708 "configure"
+#line 5707 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5713,7 +5712,7 @@ int main() {
psinfo32_t avar
; return 0; }
EOF
-if { (eval echo configure:5717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psinfo32_t=yes
else
@@ -5735,12 +5734,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:5739: checking for lwpstatus_t in sys/procfs.h" >&5
+echo "configure:5738: checking for lwpstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5744 "configure"
+#line 5743 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5749,7 +5748,7 @@ int main() {
lwpstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5753: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpstatus_t=yes
else
@@ -5771,12 +5770,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:5775: checking for lwpxstatus_t in sys/procfs.h" >&5
+echo "configure:5774: checking for lwpxstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5780 "configure"
+#line 5779 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5785,7 +5784,7 @@ int main() {
lwpxstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes
else
@@ -5807,12 +5806,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:5811: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
+echo "configure:5810: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5816 "configure"
+#line 5815 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5821,7 +5820,7 @@ int main() {
lwpstatus_t avar; void* aref = (void*) &avar.pr_context
; return 0; }
EOF
-if { (eval echo configure:5825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5824: \"$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
@@ -5843,12 +5842,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:5847: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
+echo "configure:5846: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5852 "configure"
+#line 5851 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5857,7 +5856,7 @@ int main() {
lwpstatus_t avar; void* aref = (void*) &avar.pr_reg
; return 0; }
EOF
-if { (eval echo configure:5861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5860: \"$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
@@ -5879,12 +5878,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:5883: checking for win32_pstatus_t in sys/procfs.h" >&5
+echo "configure:5882: checking for win32_pstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5888 "configure"
+#line 5887 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5893,7 +5892,7 @@ int main() {
win32_pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes
else
@@ -5976,12 +5975,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
@@ -6012,6 +6013,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
@@ -6063,7 +6075,6 @@ do
bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
bfd_elf32_bigarm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
- bfd_elf32_bigarmqnx_vec) tb="$tb elfarmqnx-nabi.lo elfarm-nabi.lo elf32.lo $elf" ;;
bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
@@ -6075,9 +6086,8 @@ do
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_i386qnx_vec) tb="$tb elf32-i386qnx.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" ;;
@@ -6088,7 +6098,6 @@ do
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_littlearmqnx_vec) tb="$tb elfarmqnx-nabi.lo 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" ;;
@@ -6109,24 +6118,22 @@ do
bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";;
bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
- bfd_elf32_powerpcleqnx_vec) tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;;
- bfd_elf32_powerpcqnx_vec) tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;;
bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;;
# FIXME: We include cofflink.lo not because it's needed for
# bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
# 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_shlqnx_vec) tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
- bfd_elf32_shnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shqnx_vec) tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.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" ;;
@@ -6134,7 +6141,7 @@ 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_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 ;;
@@ -6153,8 +6160,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 ;;
@@ -6317,9 +6326,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" &&
@@ -6340,10 +6352,10 @@ case ${host64}-${target64}-${want64} in
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:6344: checking for gcc version with buggy 64-bit support" >&5
+echo "configure:6356: 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 <<EOF
-#line 6347 "configure"
+#line 6359 "configure"
#include "confdefs.h"
:__GNUC__:__GNUC_MINOR__:__i386__:
EOF
@@ -6380,6 +6392,7 @@ esac
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}"
@@ -6388,17 +6401,17 @@ 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:6392: checking for $ac_hdr" >&5
+echo "configure:6405: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6397 "configure"
+#line 6410 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6415: \"$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*
@@ -6427,12 +6440,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6431: checking for $ac_func" >&5
+echo "configure:6444: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6436 "configure"
+#line 6449 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6455,7 +6468,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6472: \"$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
@@ -6480,7 +6493,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6484: checking for working mmap" >&5
+echo "configure:6497: 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
@@ -6488,7 +6501,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 6492 "configure"
+#line 6505 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6641,7 +6654,7 @@ main()
}
EOF
-if { (eval echo configure:6645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6658: \"$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
@@ -6666,12 +6679,12 @@ fi
for ac_func in madvise mprotect
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6670: checking for $ac_func" >&5
+echo "configure:6683: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6675 "configure"
+#line 6688 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6694,7 +6707,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6711: \"$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
@@ -6827,7 +6840,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 <<EOF
@@ -6887,7 +6900,6 @@ s%@AUTOHEADER@%$AUTOHEADER%g
s%@MAKEINFO@%$MAKEINFO%g
s%@SET_MAKE@%$SET_MAKE%g
s%@bfd_version@%$bfd_version%g
-s%@bfd_version_date@%$bfd_version_date%g
s%@bfd_version_string@%$bfd_version_string%g
s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
@@ -6986,7 +6998,7 @@ EOF
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile bfd-in3.h:bfd-in2.h bfdver.h:version.h po/Makefile.in:po/Make-in"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
diff --git a/bfd/configure.in b/bfd/configure.in
index ba38dd423b2..cb39e8fdbd0 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -16,17 +16,11 @@ bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\
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
@@ -477,12 +471,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 +509,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
@@ -564,7 +571,6 @@ do
bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
bfd_elf32_bigarm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
- bfd_elf32_bigarmqnx_vec) tb="$tb elfarmqnx-nabi.lo elfarm-nabi.lo elf32.lo $elf" ;;
bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
@@ -576,9 +582,8 @@ do
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_i386qnx_vec) tb="$tb elf32-i386qnx.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" ;;
@@ -589,7 +594,6 @@ do
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_littlearmqnx_vec) tb="$tb elfarmqnx-nabi.lo 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" ;;
@@ -610,24 +614,22 @@ do
bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";;
bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
- bfd_elf32_powerpcleqnx_vec) tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;;
- bfd_elf32_powerpcqnx_vec) tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;;
bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;;
# FIXME: We include cofflink.lo not because it's needed for
# bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
# 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_shlqnx_vec) tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
- bfd_elf32_shnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shqnx_vec) tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.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" ;;
@@ -635,7 +637,7 @@ 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_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 ;;
@@ -654,8 +656,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 ;;
@@ -818,9 +822,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" &&
@@ -868,6 +875,7 @@ AC_SUBST(bfd_default_target_size)
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)
@@ -880,6 +888,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/bfd/doc/ChangeLog b/bfd/doc/ChangeLog
index f20113c7f70..a236bfb32fd 100644
--- a/bfd/doc/ChangeLog
+++ b/bfd/doc/ChangeLog
@@ -1,3 +1,11 @@
+2002-10-14 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.in: Regenerate.
+
+2002-10-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.in: Regenerated.
+
2002-08-29 John David Anglin <dave@hiauly1.hia.nrc.ca>
* chew.c (paramstuff, outputdots, perform, bang and usage): Remove
diff --git a/bfd/doc/Makefile.am b/bfd/doc/Makefile.am
index 0787143fcd9..da51daf9cd9 100644
--- a/bfd/doc/Makefile.am
+++ b/bfd/doc/Makefile.am
@@ -248,6 +248,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/bfd/doc/Makefile.in b/bfd/doc/Makefile.in
index 66a19d1adb8..ec09ffb70fc 100644
--- a/bfd/doc/Makefile.in
+++ b/bfd/doc/Makefile.in
@@ -119,7 +119,6 @@ bfd_default_target_size = @bfd_default_target_size@
bfd_libs = @bfd_libs@
bfd_machines = @bfd_machines@
bfd_version = @bfd_version@
-bfd_version_date = @bfd_version_date@
bfd_version_string = @bfd_version_string@
bfdincludedir = @bfdincludedir@
bfdlibdir = @bfdlibdir@
@@ -216,6 +215,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/bfd/dwarf2.c b/bfd/dwarf2.c
index 7c000b9890e..063982662bc 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -402,7 +402,7 @@ read_indirect_string (unit, buf, bytes_read_ptr)
return NULL;
}
- buf = stash->dwarf_str_buffer + offset;
+ buf = stash->dwarf_str_buffer + offset;
if (*buf == '\0')
return NULL;
return buf;
@@ -578,7 +578,8 @@ read_abbrevs (abfd, offset, stash)
/* Read in abbrev header. */
cur_abbrev->number = abbrev_number;
- cur_abbrev->tag = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
+ cur_abbrev->tag = (enum dwarf_tag)
+ read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
abbrev_ptr += bytes_read;
cur_abbrev->has_children = read_1_byte (abfd, abbrev_ptr);
abbrev_ptr += 1;
@@ -601,8 +602,10 @@ read_abbrevs (abfd, offset, stash)
return 0;
}
- cur_abbrev->attrs[cur_abbrev->num_attrs].name = abbrev_name;
- cur_abbrev->attrs[cur_abbrev->num_attrs++].form = abbrev_form;
+ cur_abbrev->attrs[cur_abbrev->num_attrs].name
+ = (enum dwarf_attribute) abbrev_name;
+ cur_abbrev->attrs[cur_abbrev->num_attrs++].form
+ = (enum dwarf_form) abbrev_form;
abbrev_name = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
abbrev_ptr += bytes_read;
abbrev_form = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
@@ -614,7 +617,7 @@ read_abbrevs (abfd, offset, stash)
abbrevs[hash_number] = cur_abbrev;
/* Get next abbreviation.
- Under Irix6 the abbreviations for a compilation unit are not
+ Under Irix6 the abbreviations for a compilation unit are not
always properly terminated with an abbrev number of 0.
Exit loop if we encounter an abbreviation which we have
already read (which means we are about to read the abbreviations
@@ -646,7 +649,7 @@ read_attribute_value (attr, form, unit, info_ptr)
struct dwarf_block *blk;
bfd_size_type amt;
- attr->form = form;
+ attr->form = (enum dwarf_form) form;
switch (form)
{
@@ -806,7 +809,8 @@ struct line_info_table
char* comp_dir;
char** dirs;
struct fileinfo* files;
- struct line_info* last_line;
+ struct line_info* last_line; /* largest VMA */
+ struct line_info* lcl_head; /* local head; used in 'add_line_info' */
};
struct funcinfo
@@ -817,6 +821,11 @@ 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. */
static void
add_line_info (table, address, filename, line, column, end_sequence)
struct line_info_table* table;
@@ -829,9 +838,72 @@ add_line_info (table, address, filename, line, column, end_sequence)
bfd_size_type amt = sizeof (struct line_info);
struct line_info* info = (struct line_info*) bfd_alloc (table->abfd, amt);
- info->prev_line = table->last_line;
- table->last_line = info;
+ /* Find the correct location for 'info'. Normally we will receive
+ new line_info data 1) in order and 2) with increasing VMAs.
+ However some compilers break the rules (cf. decode_line_info) and
+ so we include some heuristics for quickly finding the correct
+ location for 'info'. In particular, these heuristics optimize for
+ the common case in which the VMA sequence that we receive is a
+ list of locally sorted VMAs such as
+ p...z a...j (where a < j < p < z)
+ Note: table->lcl_head is used to head an *actual* or *possible*
+ sequence within the list (such as a...j) that is not directly
+ headed by table->last_line
+
+ Note: we may receive duplicate entries from 'decode_line_info'. */
+
+ while (1)
+ if (!table->last_line
+ || address >= table->last_line->address)
+ {
+ /* Normal case: add 'info' to the beginning of the list */
+ info->prev_line = table->last_line;
+ table->last_line = info;
+
+ /* lcl_head: initialize to head a *possible* sequence at the end. */
+ if (!table->lcl_head)
+ table->lcl_head = info;
+ break;
+ }
+ else if (!table->lcl_head->prev_line
+ && table->lcl_head->address > address)
+ {
+ /* Abnormal but easy: lcl_head is 1) at the *end* of the line
+ list and 2) the head of 'info'. */
+ info->prev_line = NULL;
+ table->lcl_head->prev_line = info;
+ break;
+ }
+ else if (table->lcl_head->prev_line
+ && table->lcl_head->address > address
+ && address >= table->lcl_head->prev_line->address)
+ {
+ /* Abnormal but easy: lcl_head is 1) in the *middle* of the line
+ list and 2) the head of 'info'. */
+ info->prev_line = table->lcl_head->prev_line;
+ table->lcl_head->prev_line = info;
+ break;
+ }
+ else
+ {
+ /* Abnormal and hard: Neither 'last_line' nor 'lcl_head' are valid
+ heads for 'info'. Reset 'lcl_head' and repeat. */
+ struct line_info* li2 = table->last_line; /* always non-NULL */
+ struct line_info* li1 = li2->prev_line;
+
+ while (li1)
+ {
+ if (li2->address > address && address >= li1->address)
+ break;
+
+ li2 = li1; /* always non-NULL */
+ li1 = li1->prev_line;
+ }
+ table->lcl_head = li2;
+ }
+
+ /* Set member data of 'info'. */
info->address = address;
info->filename = filename;
info->line = line;
@@ -908,7 +980,8 @@ arange_add (unit, low_pc, high_pc)
}
/* Need to allocate a new arange and insert it into the arange list. */
- arange = bfd_zalloc (unit->abfd, (bfd_size_type) sizeof (*arange));
+ arange = (struct arange *)
+ bfd_zalloc (unit->abfd, (bfd_size_type) sizeof (*arange));
arange->low = low_pc;
arange->high = high_pc;
@@ -982,6 +1055,7 @@ decode_line_info (unit, stash)
table->files = NULL;
table->last_line = NULL;
+ table->lcl_head = NULL;
line_ptr = stash->dwarf_line_buffer + unit->line_offset;
@@ -1091,10 +1165,10 @@ decode_line_info (unit, stash)
int basic_block = 0;
int end_sequence = 0;
/* eraxxon@alumni.rice.edu: Against the DWARF2 specs, some
- compilers generate address sequences that are wildly out of
- order using DW_LNE_set_address (e.g. Intel C++ 6.0 compiler
- for ia64-Linux). Thus, to determine the low and high
- address, we must compare on every DW_LNS_copy, etc. */
+ compilers generate address sequences that are wildly out of
+ order using DW_LNE_set_address (e.g. Intel C++ 6.0 compiler
+ for ia64-Linux). Thus, to determine the low and high
+ address, we must compare on every DW_LNS_copy, etc. */
bfd_vma low_pc = 0;
bfd_vma high_pc = 0;
@@ -1249,19 +1323,31 @@ lookup_address_in_line_info_table (table, addr, function, filename_ptr,
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;
- struct line_info* each_line;
+ struct line_info* each_line = NULL;
+ *filename_ptr = NULL;
if (!next_line)
return false;
each_line = next_line->prev_line;
+ /* Check for large addresses */
+ if (addr > next_line->address)
+ each_line = NULL; /* ensure we skip over the normal case */
+
+ /* Normal case: search the list; save */
while (each_line && next_line)
{
- if (!each_line->end_sequence
- && addr >= each_line->address && addr < next_line->address)
+ /* 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;
+ if (each_line->address <= addr && addr <= next_line->address)
{
+ 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
of the last line of the earlier one. This check is for GCC
@@ -1278,16 +1364,22 @@ lookup_address_in_line_info_table (table, addr, function, filename_ptr,
*filename_ptr = each_line->filename;
*linenumber_ptr = each_line->line;
}
- return true;
}
+
+ if (addr_match && !each_line->end_sequence)
+ return true; /* we have definitely found what we want */
+
next_line = each_line;
each_line = each_line->prev_line;
}
- /* At this point each_line is NULL but next_line is not. If we found the
- containing function in this compilation unit, return the first line we
- have a number for. This is also for compatibility with GCC 2.95. */
- if (function != NULL)
+ /* At this point each_line is NULL but next_line is not. If we found
+ a candidate end-of-sequence point in the loop above, we can return
+ that (compatibility with a bug in the Intel compiler); otherwise,
+ assuming that we found the containing function for this address in
+ this compilation unit, return the first line we have a number for
+ (compatibility with GCC 2.95). */
+ if (*filename_ptr == NULL && function != NULL)
{
*filename_ptr = next_line->filename;
*linenumber_ptr = next_line->line;
@@ -1645,18 +1737,18 @@ comp_unit_contains_address (unit, addr)
struct arange *arange;
if (unit->error)
- return 0;
+ return false;
arange = &unit->arange;
do
{
if (addr >= arange->low && addr < arange->high)
- return 1;
+ return true;
arange = arange->next;
}
while (arange);
- return 0;
+ return false;
}
/* If UNIT contains ADDR, set the output parameters to the values for
@@ -1701,7 +1793,7 @@ comp_unit_find_nearest_line (unit, addr, filename_ptr, functionname_ptr,
}
if (unit->first_child_die_ptr < unit->end_ptr
- && ! scan_unit_for_functions (unit))
+ && ! scan_unit_for_functions (unit))
{
unit->error = 1;
return false;
@@ -1714,7 +1806,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 line_p || func_p;
+ return (boolean) (line_p || func_p);
}
/* Locate a section in a BFD containing debugging info. The search starts
@@ -1821,7 +1913,7 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
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
+ Read them all in and produce one large stash. We do this in two
passes - in the first pass we just accumulate the section sizes.
In the second pass we read in the section's contents. The allows
us to avoid reallocing the data as we add sections to the stash. */
@@ -1917,7 +2009,7 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
stash->info_ptr += addr_size;
if (length > 0)
- {
+ {
each = parse_comp_unit (abfd, stash, length, offset_size);
stash->info_ptr += length;
diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index 47b65822340..4f129f602f6 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -3837,7 +3837,7 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
= backend->debug_swap.swap_ext_in;
bfd_size_type external_ext_size = backend->debug_swap.external_ext_size;
unsigned long ext_count;
- struct ecoff_link_hash_entry **sym_hash;
+ struct bfd_link_hash_entry **sym_hash;
char *ext_ptr;
char *ext_end;
bfd_size_type amt;
@@ -3846,10 +3846,10 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
amt = ext_count;
amt *= sizeof (struct bfd_link_hash_entry *);
- sym_hash = (struct ecoff_link_hash_entry **) bfd_alloc (abfd, amt);
+ sym_hash = (struct bfd_link_hash_entry **) bfd_alloc (abfd, amt);
if (!sym_hash)
return false;
- ecoff_data (abfd)->sym_hashes = sym_hash;
+ ecoff_data (abfd)->sym_hashes = (struct ecoff_link_hash_entry **) sym_hash;
ext_ptr = (char *) external_ext;
ext_end = ext_ptr + ext_count * external_ext_size;
@@ -3980,15 +3980,13 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
name = ssext + esym.asym.iss;
- h = NULL;
if (! (_bfd_generic_link_add_one_symbol
(info, abfd, name,
(flagword) (esym.weakext ? BSF_WEAK : BSF_GLOBAL),
- section, value, (const char *) NULL, true, true,
- (struct bfd_link_hash_entry **) &h)))
+ section, value, (const char *) NULL, true, true, sym_hash)))
return false;
- *sym_hash = h;
+ h = (struct ecoff_link_hash_entry *) *sym_hash;
/* If we are building an ECOFF hash table, save the external
symbol information. */
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index dcccc482f88..2fae2b4486d 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -235,11 +235,79 @@ enum elf_link_info_type
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
};
+/* Structures used by the eh_frame optimization code. */
+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;
+ 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. */
+ boolean table;
+};
+
/* Cached start, size and alignment of PT_TLS segment. */
struct elf_link_tls_segment
{
@@ -294,6 +362,9 @@ struct elf_link_hash_table
/* A pointer to information used to merge SEC_MERGE sections. */
PTR 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;
@@ -770,22 +841,6 @@ struct elf_backend_data
boolean (*elf_backend_write_section)
PARAMS ((bfd *, asection *, bfd_byte *));
- /* This function, if defined, sets up the file positions for non PT_LOAD
- segments, especially for segments containing non-allocated sections. */
- void (*set_nonloadable_filepos)
- PARAMS ((bfd *, Elf_Internal_Phdr *));
-
- /* This function, if defined, returns true if the section is contained
- within the segment. File positions are compared. */
- boolean (*is_contained_by_filepos)
- PARAMS ((asection *, Elf_Internal_Phdr *));
-
- /* This function, if defined, returns true if copy_private_bfd_data
- should be called. It provides a way of overriding default
- test conditions in _bfd_elf_copy_private_section_data. */
- boolean (*copy_private_bfd_data_p)
- PARAMS ((bfd *, asection *, bfd *, asection *));
-
/* The level of IRIX compatibility we're striving for.
MIPS ELF specific function. */
irix_compat_t (*elf_backend_mips_irix_compat)
@@ -1134,12 +1189,12 @@ struct elf_obj_tdata
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;
+
+ /* Used to determine if the e_flags field has been initialized */
+ boolean flags_init;
/* Number of symbol version definitions we are about to emit. */
unsigned int cverdefs;
@@ -1382,16 +1437,16 @@ extern void _bfd_elf_strtab_finalize
PARAMS ((struct elf_strtab_hash *));
extern boolean _bfd_elf_discard_section_eh_frame
- PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *,
+ PARAMS ((bfd *, struct bfd_link_info *, 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 *));
+ PARAMS ((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 *));
+ PARAMS ((bfd *, struct bfd_link_info *, asection *, bfd_byte *));
extern boolean _bfd_elf_write_section_eh_frame_hdr
- PARAMS ((bfd *, asection *));
+ PARAMS ((bfd *, struct bfd_link_info *));
extern boolean _bfd_elf_maybe_strip_eh_frame_hdr
PARAMS ((struct bfd_link_info *));
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index e80fc6c9d57..fa152abd9af 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -26,74 +26,6 @@ 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
@@ -282,11 +214,11 @@ int cie_compare (c1, c2)
deleted. */
boolean
-_bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
+_bfd_elf_discard_section_eh_frame (abfd, info, sec,
reloc_symbol_deleted_p, cookie)
bfd *abfd;
struct bfd_link_info *info;
- asection *sec, *ehdrsec;
+ asection *sec;
boolean (*reloc_symbol_deleted_p) PARAMS ((bfd_vma, PTR));
struct elf_reloc_cookie *cookie;
{
@@ -294,12 +226,12 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
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;
@@ -317,10 +249,8 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
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. */
@@ -414,7 +344,7 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
/* 64-bit .eh_frame is not supported. */
goto free_no_table;
buf += 4;
- if ((buf - ehbuf) + hdr.length > sec->_raw_size)
+ if ((bfd_size_type) (buf - ehbuf) + hdr.length > sec->_raw_size)
/* CIE/FDE not contained fully in this .eh_frame input section. */
goto free_no_table;
@@ -555,10 +485,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;
@@ -626,8 +555,7 @@ _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))
@@ -636,7 +564,6 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
be deleted. */
new_size -= hdr.length + 4;
sec_info->entry[sec_info->count].removed = 1;
- memset (rel, 0, sizeof (*rel));
}
else
{
@@ -654,7 +581,6 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
cie_usage_count++;
hdr_info->fde_count++;
}
- cookie->rel = rel;
if (cie.lsda_encoding != DW_EH_PE_omit)
{
unsigned int dummy;
@@ -745,36 +671,27 @@ free_no_table:
input sections. It finalizes the size of .eh_frame_hdr section. */
boolean
-_bfd_elf_discard_section_eh_frame_hdr (abfd, info, sec)
+_bfd_elf_discard_section_eh_frame_hdr (abfd, info)
bfd *abfd;
struct bfd_link_info *info;
- asection *sec;
{
+ 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;
-
- 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;
- }
+ asection *sec;
- hdr_info = (struct eh_frame_hdr_info *)
- elf_section_data (sec)->sec_info;
- if (hdr_info->strip)
+ htab = elf_hash_table (info);
+ hdr_info = &htab->eh_info;
+ sec = hdr_info->hdr_sec;
+ if (sec == NULL)
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;
+ elf_tdata (abfd)->eh_frame_hdr = sec;
return true;
}
@@ -787,21 +704,21 @@ boolean
_bfd_elf_maybe_strip_eh_frame_hdr (info)
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))
+ htab = elf_hash_table (info);
+ hdr_info = &htab->eh_info;
+ if (hdr_info->hdr_sec == NULL)
return true;
- hdr_info
- = bfd_zmalloc (sizeof (struct eh_frame_hdr_info));
- if (hdr_info == NULL)
- return false;
-
- elf_section_data (sec)->sec_info = hdr_info;
- elf_section_data (sec)->sec_info_type = ELF_INFO_TYPE_EH_FRAME_HDR;
+ 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)
@@ -816,11 +733,12 @@ _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;
+
+ hdr_info->table = true;
return true;
}
@@ -878,9 +796,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
@@ -891,12 +808,14 @@ _bfd_elf_eh_frame_section_offset (output_bfd, sec, offset)
contents. */
boolean
-_bfd_elf_write_section_eh_frame (abfd, sec, ehdrsec, contents)
+_bfd_elf_write_section_eh_frame (abfd, info, sec, contents)
bfd *abfd;
- asection *sec, *ehdrsec;
+ 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;
@@ -914,19 +833,13 @@ _bfd_elf_write_section_eh_frame (abfd, sec, ehdrsec, contents)
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;
- }
+ 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)
@@ -1174,24 +1087,21 @@ vma_compare (a, b)
sorted by increasing initial_loc) */
boolean
-_bfd_elf_write_section_eh_frame_hdr (abfd, sec)
+_bfd_elf_write_section_eh_frame_hdr (abfd, info)
bfd *abfd;
- asection *sec;
+ 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;
- 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)
+ 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;
diff --git a/bfd/elf.c b/bfd/elf.c
index c1e2d118071..c5987fe6df3 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2671,18 +2671,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 = (Elf_Internal_Shdr **) bfd_zalloc (abfd, amt);
if (i_shdrp == NULL)
return false;
amt = sizeof (Elf_Internal_Shdr);
- i_shdrp[0] = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt);
+ i_shdrp[0] = (Elf_Internal_Shdr *) bfd_zalloc (abfd, amt);
if (i_shdrp[0] == NULL)
{
bfd_release (abfd, i_shdrp);
return false;
}
- memset (i_shdrp[0], 0, sizeof (Elf_Internal_Shdr));
elf_elfsections (abfd) = i_shdrp;
@@ -3450,10 +3449,9 @@ 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);
@@ -3462,7 +3460,7 @@ map_sections_to_segments (abfd)
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;
@@ -3960,11 +3958,6 @@ Error: First section in segment (%s) starts at 0x%x whereas the segment starts a
}
}
- /* If additional nonloadable filepos adjustments are required,
- do them now. */
- if (bed->set_nonloadable_filepos)
- (*bed->set_nonloadable_filepos) (abfd, phdrs);
-
/* Clear out any program headers we allocated but did not use. */
for (; count < alloc; count++, p++)
{
@@ -4038,8 +4031,7 @@ 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;
@@ -4560,13 +4552,6 @@ copy_private_bfd_data (ibfd, obfd)
&& (section->lma + section->_raw_size \
<= SEGMENT_END (segment, base)))
- /* Returns true if the given section is contained within the
- given segment. Filepos addresses are compared in an elf
- backend function. */
-#define IS_CONTAINED_BY_FILEPOS(sec, seg, bed) \
- (bed->is_contained_by_filepos \
- && (*bed->is_contained_by_filepos) (sec, seg))
-
/* Special case: corefile "NOTE" section containing regs, prpsinfo etc. */
#define IS_COREFILE_NOTE(p, s) \
(p->p_type == PT_NOTE \
@@ -4602,9 +4587,7 @@ copy_private_bfd_data (ibfd, obfd)
? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \
: IS_CONTAINED_BY_VMA (section, segment)) \
&& (section->flags & SEC_ALLOC) != 0) \
- || IS_COREFILE_NOTE (segment, section) \
- || (IS_CONTAINED_BY_FILEPOS (section, segment, bed) \
- && (section->flags & SEC_ALLOC) == 0)) \
+ || IS_COREFILE_NOTE (segment, section)) \
&& section->output_section != NULL \
&& ! section->segment_mark)
@@ -4849,7 +4832,6 @@ copy_private_bfd_data (ibfd, obfd)
/* Match up the physical address of the segment with the
LMA address of the output section. */
if (IS_CONTAINED_BY_LMA (output_section, segment, map->p_paddr)
- || IS_CONTAINED_BY_FILEPOS (section, segment, bed)
|| IS_COREFILE_NOTE (segment, section)
|| (bed->want_p_paddr_set_to_zero &&
IS_CONTAINED_BY_VMA (output_section, segment))
@@ -5086,7 +5068,6 @@ copy_private_bfd_data (ibfd, obfd)
#undef SEGMENT_END
#undef IS_CONTAINED_BY_VMA
#undef IS_CONTAINED_BY_LMA
-#undef IS_CONTAINED_BY_FILEPOS
#undef IS_COREFILE_NOTE
#undef IS_SOLARIS_PT_INTERP
#undef INCLUDE_SECTION_IN_SEGMENT
@@ -5106,26 +5087,12 @@ _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec)
asection *osec;
{
Elf_Internal_Shdr *ihdr, *ohdr;
- const struct elf_backend_data *bed = get_elf_backend_data (ibfd);
if (ibfd->xvec->flavour != bfd_target_elf_flavour
|| obfd->xvec->flavour != bfd_target_elf_flavour)
return true;
- /* Copy over private BFD data if it has not already been copied.
- This must be done here, rather than in the copy_private_bfd_data
- entry point, because the latter is called after the section
- contents have been set, which means that the program headers have
- already been worked out. The backend function provides a way to
- override the test conditions and code path for the call to
- copy_private_bfd_data. */
- if (bed->copy_private_bfd_data_p)
- {
- if ((*bed->copy_private_bfd_data_p) (ibfd, isec, obfd, osec))
- if (! copy_private_bfd_data (ibfd, obfd))
- return false;
- }
- else if (elf_tdata (obfd)->segment_map == NULL && elf_tdata (ibfd)->phdr != NULL)
+ if (elf_tdata (obfd)->segment_map == NULL && elf_tdata (ibfd)->phdr != NULL)
{
asection *s;
@@ -6803,8 +6770,8 @@ 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;
@@ -7358,9 +7325,9 @@ _bfd_elf_section_offset (abfd, info, sec, offset)
switch (sec_data->sec_info_type)
{
case ELF_INFO_TYPE_STABS:
- return _bfd_stab_section_offset
- (abfd, &elf_hash_table (info)->merge_info, sec, &sec_data->sec_info,
- offset);
+ 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:
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index ff5c5f47189..fad1a1e86dd 100644
--- a/bfd/elf32-arc.c
+++ b/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.
@@ -39,7 +40,7 @@ static bfd_reloc_status_type arc_elf_b22_pcrel
/* 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[] =
{
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index 2d59601fd02..d0e7085ceca 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -17,6 +17,10 @@
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;
@@ -76,7 +80,7 @@ static boolean elf32_arm_finish_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
static struct bfd_hash_entry * elf32_arm_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-#ifdef USE_REL
+#if USE_REL
static void arm_add_to_rel
PARAMS ((bfd *, bfd_byte *, reloc_howto_type *, bfd_signed_vma));
#endif
@@ -363,13 +367,6 @@ 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;
-
#ifndef ELFARM_NABI_C_INCLUDED
boolean
bfd_elf32_arm_allocate_interworking_sections (info)
@@ -427,6 +424,7 @@ record_arm_to_thumb_glue (link_info, h)
asection * s;
char * tmp_name;
struct elf_link_hash_entry * myh;
+ struct bfd_link_hash_entry * bh;
struct elf32_arm_link_hash_table * globals;
bfd_vma val;
@@ -460,11 +458,11 @@ record_arm_to_thumb_glue (link_info, h)
/* The only trick here is using hash_table->arm_glue_size as the value. Even
though the section isn't allocated yet, this is where we will be putting
it. */
+ bh = NULL;
val = globals->arm_glue_size + 1;
_bfd_generic_link_add_one_symbol (link_info, globals->bfd_of_glue_owner,
tmp_name, BSF_GLOBAL, s, val,
- NULL, true, false,
- (struct bfd_link_hash_entry **) &myh);
+ NULL, true, false, &bh);
free (tmp_name);
@@ -482,6 +480,7 @@ record_thumb_to_arm_glue (link_info, h)
asection *s;
char *tmp_name;
struct elf_link_hash_entry *myh;
+ struct bfd_link_hash_entry *bh;
struct elf32_arm_link_hash_table *hash_table;
char bind;
bfd_vma val;
@@ -513,13 +512,14 @@ record_thumb_to_arm_glue (link_info, h)
return;
}
+ bh = NULL;
val = hash_table->thumb_glue_size + 1;
_bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner,
tmp_name, BSF_GLOBAL, s, val,
- NULL, true, false,
- (struct bfd_link_hash_entry **) &myh);
+ NULL, true, false, &bh);
/* If we mark it 'Thumb', the disassembler will do a better job. */
+ myh = (struct elf_link_hash_entry *) bh;
bind = ELF_ST_BIND (myh->type);
myh->type = ELF_ST_INFO (bind, STT_ARM_TFUNC);
@@ -536,13 +536,11 @@ record_thumb_to_arm_glue (link_info, h)
sprintf (tmp_name, CHANGE_TO_ARM, name);
- myh = NULL;
-
+ bh = NULL;
val = hash_table->thumb_glue_size + 4,
_bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner,
tmp_name, BSF_LOCAL, s, val,
- NULL, true, false,
- (struct bfd_link_hash_entry **) &myh);
+ NULL, true, false, &bh);
free (tmp_name);
@@ -1093,7 +1091,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))
@@ -1369,7 +1367,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. */
@@ -1401,7 +1399,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
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. */
{
@@ -1506,7 +1504,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
bfd_signed_vma reloc_signed_min = ~ reloc_signed_max;
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;
if (addend & ((howto->src_mask + 1) >> 1))
@@ -1744,7 +1742,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)
@@ -1836,7 +1834,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
Elf_Internal_Rela * relend;
const char * name;
-#ifndef USE_REL
+#if !USE_REL
if (info->relocateable)
return true;
#endif
@@ -1865,7 +1863,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
|| r_type == R_ARM_GNU_VTINHERIT)
continue;
-#ifdef USE_REL
+#if USE_REL
elf32_arm_info_to_howto (input_bfd, & bfd_reloc,
(Elf_Internal_Rel *) rel);
#else
@@ -1873,7 +1871,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
#endif
howto = bfd_reloc.howto;
-#ifdef USE_REL
+#if USE_REL
if (info->relocateable)
{
/* This is a relocateable link. We don't have to change
@@ -1906,7 +1904,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);
@@ -3220,19 +3218,7 @@ 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;
}
@@ -3648,9 +3634,7 @@ elf32_arm_reloc_type_class (rela)
#define ELF_ARCH bfd_arch_arm
#define ELF_MACHINE_CODE EM_ARM
-#ifndef ELF_MAXPAGESIZE
#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
@@ -3677,7 +3661,7 @@ elf32_arm_reloc_type_class (rela)
#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
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 8eff52dd5ad..dfbdbe75f68 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -1022,7 +1022,8 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
BFD_ASSERT (off != (bfd_vma) -1);
if (!elf_hash_table (info)->dynamic_sections_created
- || (! info->shared && h->dynindx == -1)
+ || (! info->shared
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|| (info->shared
&& (info->symbolic || h->dynindx == -1)
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c
index 1dec0b08a13..fe31b925c0a 100644
--- a/bfd/elf32-d10v.c
+++ b/bfd/elf32-d10v.c
@@ -43,7 +43,7 @@ static boolean elf32_d10v_relocate_section
asection **));
/* Use REL instead of RELA to save space. */
-#define USE_REL
+#define USE_REL 1
static reloc_howto_type elf_d10v_howto_table[] =
{
diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c
index c1c77ec0b43..9cb900b8b20 100644
--- a/bfd/elf32-h8300.c
+++ b/bfd/elf32-h8300.c
@@ -2,21 +2,21 @@
Copyright 1993, 1995, 1998, 1999, 2001, 2002
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"
@@ -61,8 +61,7 @@ static bfd_reloc_status_type special
/* This does not include any relocation information, but should be
good enough for GDB or objdump to read the file. */
-static reloc_howto_type h8_elf_howto_table[] =
-{
+static reloc_howto_type h8_elf_howto_table[] = {
#define R_H8_NONE_X 0
HOWTO (R_H8_NONE, /* type */
0, /* rightshift */
@@ -221,16 +220,14 @@ static reloc_howto_type h8_elf_howto_table[] =
/* This structure is used to map BFD reloc codes to H8 ELF relocs. */
-struct elf_reloc_map
-{
+struct elf_reloc_map {
bfd_reloc_code_real_type bfd_reloc_val;
unsigned char howto_index;
};
/* An array mapping BFD reloc codes to SH ELF relocs. */
-static const struct elf_reloc_map h8_reloc_map[] =
-{
+static const struct elf_reloc_map h8_reloc_map[] = {
{ BFD_RELOC_NONE, R_H8_NONE_X },
{ BFD_RELOC_32, R_H8_DIR32_X },
{ BFD_RELOC_16, R_H8_DIR16_X },
@@ -271,7 +268,7 @@ elf32_h8_info_to_howto (abfd, bfd_reloc, elf_reloc)
r = ELF32_R_TYPE (elf_reloc->r_info);
for (i = 0; i < sizeof (h8_elf_howto_table) / sizeof (reloc_howto_type); i++)
- if (h8_elf_howto_table[i].type== r)
+ if (h8_elf_howto_table[i].type == r)
{
bfd_reloc->howto = &h8_elf_howto_table[i];
return;
@@ -830,14 +827,34 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
elf_section_data (sec)->this_hdr.contents = contents;
symtab_hdr->contents = (unsigned char *) isymbuf;
+ /* Get the instruction code being relaxed. */
+ code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
+
/* If the previous instruction conditionally jumped around
this instruction, we may be able to reverse the condition
and redirect the previous instruction to the target of
this instruction.
Such sequences are used by the compiler to deal with
- long conditional branches. */
- if ((int) gap <= 130
+ long conditional branches.
+
+ Only perform this optimisation for jumps (code 0x5a) not
+ subroutine calls, as otherwise it could transform:
+
+ mov.w r0,r0
+ beq .L1
+ jsr @_bar
+ .L1: rts
+ _bar: rts
+ into:
+ mov.w r0,r0
+ bne _bar
+ rts
+ _bar: rts
+
+ which changes the call (jsr) into a branch (bne). */
+ if (code == 0x5a
+ && (int) gap <= 130
&& (int) gap >= -128
&& last_reloc
&& ELF32_R_TYPE (last_reloc->r_info) == R_H8_PCREL8
@@ -870,11 +887,10 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
= ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
ELF32_R_TYPE (R_H8_NONE));
- last_reloc->r_info
+ last_reloc->r_info
= ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- ELF32_R_TYPE (R_H8_PCREL8));
- last_reloc->r_addend = irel->r_addend;
-
+ ELF32_R_TYPE (R_H8_PCREL8));
+ last_reloc->r_addend = irel->r_addend;
code = bfd_get_8 (abfd,
contents + last_reloc->r_offset - 1);
@@ -894,9 +910,6 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
}
}
- /* We could not eliminate this jump, so just shorten it. */
- code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
-
if (code == 0x5e)
bfd_put_8 (abfd, 0x55, contents + irel->r_offset - 1);
else if (code == 0x5a)
@@ -938,18 +951,18 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
/* If the distance is within -126..+130 inclusive, then we can
relax this jump. +130 is valid since the target will move
two bytes closer if we do relax this branch. */
- if ((int)gap >= -126 && (int)gap <= 130)
+ if ((int) gap >= -126 && (int) gap <= 130)
{
- unsigned char code;
+ unsigned char code;
- /* Note that we've changed the relocs, section contents,
+ /* Note that we've changed the relocs, section contents,
etc. */
- elf_section_data (sec)->relocs = internal_relocs;
- elf_section_data (sec)->this_hdr.contents = contents;
+ elf_section_data (sec)->relocs = internal_relocs;
+ elf_section_data (sec)->this_hdr.contents = contents;
symtab_hdr->contents = (unsigned char *) isymbuf;
- /* Get the opcode. */
- code = bfd_get_8 (abfd, contents + irel->r_offset - 2);
+ /* Get the opcode. */
+ code = bfd_get_8 (abfd, contents + irel->r_offset - 2);
if (code == 0x58)
{
@@ -967,18 +980,18 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
abort ();
/* Fix the relocation's type. */
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
R_H8_PCREL8);
- irel->r_offset--;
+ irel->r_offset--;
- /* Delete two bytes of data. */
- if (!elf32_h8_relax_delete_bytes (abfd, sec,
+ /* Delete two bytes of data. */
+ if (!elf32_h8_relax_delete_bytes (abfd, sec,
irel->r_offset + 1, 2))
goto error_return;
- /* That will change things, so, we should relax again.
+ /* That will change things, so, we should relax again.
Note that this is not required, and it may be slow. */
- *again = true;
+ *again = true;
}
break;
}
@@ -990,53 +1003,53 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
bfd_vma value = symval + irel->r_addend;
if ((bfd_get_mach (abfd) == bfd_mach_h8300
- && value >= 0xff00
- && value <= 0xffff)
- || ((bfd_get_mach (abfd) == bfd_mach_h8300h
+ && value >= 0xff00
+ && value <= 0xffff)
+ || ((bfd_get_mach (abfd) == bfd_mach_h8300h
|| bfd_get_mach (abfd) == bfd_mach_h8300s)
&& value >= 0xffff00
&& value <= 0xffffff))
{
- unsigned char code;
+ unsigned char code;
- /* Note that we've changed the relocs, section contents,
+ /* Note that we've changed the relocs, section contents,
etc. */
- elf_section_data (sec)->relocs = internal_relocs;
- elf_section_data (sec)->this_hdr.contents = contents;
+ elf_section_data (sec)->relocs = internal_relocs;
+ elf_section_data (sec)->this_hdr.contents = contents;
symtab_hdr->contents = (unsigned char *) isymbuf;
- /* Get the opcode. */
- code = bfd_get_8 (abfd, contents + irel->r_offset - 2);
+ /* Get the opcode. */
+ code = bfd_get_8 (abfd, contents + irel->r_offset - 2);
- /* Sanity check. */
- if (code != 0x6a)
+ /* Sanity check. */
+ if (code != 0x6a)
abort ();
- code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
+ code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
- if ((code & 0xf0) == 0x00)
+ if ((code & 0xf0) == 0x00)
bfd_put_8 (abfd,
(code & 0xf) | 0x20,
- contents + irel->r_offset - 2);
- else if ((code & 0xf0) == 0x80)
+ contents + irel->r_offset - 2);
+ else if ((code & 0xf0) == 0x80)
bfd_put_8 (abfd,
(code & 0xf) | 0x30,
- contents + irel->r_offset - 2);
- else
+ contents + irel->r_offset - 2);
+ else
abort ();
- /* Fix the relocation's type. */
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ /* Fix the relocation's type. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
R_H8_DIR8);
- /* Delete two bytes of data. */
- if (!elf32_h8_relax_delete_bytes (abfd, sec,
+ /* Delete two bytes of data. */
+ if (!elf32_h8_relax_delete_bytes (abfd, sec,
irel->r_offset + 1, 2))
goto error_return;
- /* That will change things, so, we should relax again.
+ /* That will change things, so, we should relax again.
Note that this is not required, and it may be slow. */
- *again = true;
+ *again = true;
}
break;
}
@@ -1048,52 +1061,52 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
bfd_vma value = symval + irel->r_addend;
if ((bfd_get_mach (abfd) == bfd_mach_h8300
- && value >= 0xff00
- && value <= 0xffff)
- || ((bfd_get_mach (abfd) == bfd_mach_h8300h
+ && value >= 0xff00
+ && value <= 0xffff)
+ || ((bfd_get_mach (abfd) == bfd_mach_h8300h
|| bfd_get_mach (abfd) == bfd_mach_h8300s)
&& value >= 0xffff00
&& value <= 0xffffff))
{
- unsigned char code;
+ unsigned char code;
- /* Note that we've changed the relocs, section contents,
+ /* Note that we've changed the relocs, section contents,
etc. */
- elf_section_data (sec)->relocs = internal_relocs;
- elf_section_data (sec)->this_hdr.contents = contents;
+ elf_section_data (sec)->relocs = internal_relocs;
+ elf_section_data (sec)->this_hdr.contents = contents;
symtab_hdr->contents = (unsigned char *) isymbuf;
- /* Get the opcode. */
- code = bfd_get_8 (abfd, contents + irel->r_offset - 2);
+ /* Get the opcode. */
+ code = bfd_get_8 (abfd, contents + irel->r_offset - 2);
- /* Sanity check. */
- if (code != 0x6a)
+ /* Sanity check. */
+ if (code != 0x6a)
abort ();
- code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
+ code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
- if ((code & 0xf0) == 0x00)
+ if ((code & 0xf0) == 0x00)
bfd_put_8 (abfd,
(code & 0xf) | 0x20,
- contents + irel->r_offset - 2);
- else if ((code & 0xf0) == 0x80)
+ contents + irel->r_offset - 2);
+ else if ((code & 0xf0) == 0x80)
bfd_put_8 (abfd,
(code & 0xf) | 0x30,
- contents + irel->r_offset - 2);
- else
+ contents + irel->r_offset - 2);
+ else
abort ();
- /* Fix the relocation's type. */
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ /* Fix the relocation's type. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
R_H8_DIR8);
- /* Delete two bytes of data. */
- if (!elf32_h8_relax_delete_bytes (abfd, sec, irel->r_offset, 2))
+ /* Delete two bytes of data. */
+ if (!elf32_h8_relax_delete_bytes (abfd, sec, irel->r_offset, 2))
goto error_return;
- /* That will change things, so, we should relax again.
+ /* That will change things, so, we should relax again.
Note that this is not required, and it may be slow. */
- *again = true;
+ *again = true;
}
}
@@ -1107,34 +1120,34 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
if (value <= 0x7fff || value >= 0xff8000)
{
- unsigned char code;
+ unsigned char code;
- /* Note that we've changed the relocs, section contents,
+ /* Note that we've changed the relocs, section contents,
etc. */
- elf_section_data (sec)->relocs = internal_relocs;
- elf_section_data (sec)->this_hdr.contents = contents;
+ elf_section_data (sec)->relocs = internal_relocs;
+ elf_section_data (sec)->this_hdr.contents = contents;
symtab_hdr->contents = (unsigned char *) isymbuf;
- /* Get the opcode. */
- code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
+ /* Get the opcode. */
+ code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
- /* We just need to turn off bit 0x20. */
- code &= ~0x20;
+ /* We just need to turn off bit 0x20. */
+ code &= ~0x20;
- bfd_put_8 (abfd, code, contents + irel->r_offset - 1);
+ bfd_put_8 (abfd, code, contents + irel->r_offset - 1);
- /* Fix the relocation's type. */
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ /* Fix the relocation's type. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
R_H8_DIR16A8);
- /* Delete two bytes of data. */
- if (!elf32_h8_relax_delete_bytes (abfd, sec,
+ /* Delete two bytes of data. */
+ if (!elf32_h8_relax_delete_bytes (abfd, sec,
irel->r_offset + 1, 2))
goto error_return;
- /* That will change things, so, we should relax again.
+ /* That will change things, so, we should relax again.
Note that this is not required, and it may be slow. */
- *again = true;
+ *again = true;
}
break;
}
diff --git a/bfd/elf32-i386-fbsd.c b/bfd/elf32-i386-fbsd.c
deleted file mode 100644
index 500e0ebc048..00000000000
--- a/bfd/elf32-i386-fbsd.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Intel IA-32 specific support for 32-bit ELF on FreeBSD.
- Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#define TARGET_LITTLE_SYM bfd_elf32_i386_freebsd_vec
-#define TARGET_LITTLE_NAME "elf32-i386-freebsd"
-#define ELF_ARCH bfd_arch_i386
-#define ELF_MACHINE_CODE EM_386
-#define ELF_MAXPAGESIZE 0x1000
-
-#include "bfd.h"
-#include "sysdep.h"
-#include "elf-bfd.h"
-
-/* 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
- PARAMS ((bfd *, struct bfd_link_info *));
-
-static void
-elf_i386_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
-}
-
-#define elf_backend_post_process_headers elf_i386_post_process_headers
-
-#include "elf32-i386.c"
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 87e1e766464..ed601a76647 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2617,36 +2617,40 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
BFD_ASSERT (rel->r_offset >= 1);
val = bfd_get_8 (input_bfd, contents + rel->r_offset - 1);
BFD_ASSERT (rel->r_offset + 4 <= input_section->_raw_size);
- if (val != 0xa1)
- {
- BFD_ASSERT (rel->r_offset >= 2);
- type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2);
- }
if (val == 0xa1)
{
/* movl foo, %eax. */
bfd_put_8 (output_bfd, 0xb8, contents + rel->r_offset - 1);
}
- else if (type == 0x8b)
- {
- /* movl */
- BFD_ASSERT ((val & 0xc7) == 0x05);
- bfd_put_8 (output_bfd, 0xc7,
- contents + rel->r_offset - 2);
- bfd_put_8 (output_bfd, 0xc0 | ((val >> 3) & 7),
- contents + rel->r_offset - 1);
- }
- else if (type == 0x03)
+ else
{
- /* addl */
- BFD_ASSERT ((val & 0xc7) == 0x05);
- bfd_put_8 (output_bfd, 0x81,
- contents + rel->r_offset - 2);
- bfd_put_8 (output_bfd, 0xc0 | ((val >> 3) & 7),
- contents + rel->r_offset - 1);
+ BFD_ASSERT (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);
+ bfd_put_8 (output_bfd, 0xc7,
+ contents + rel->r_offset - 2);
+ bfd_put_8 (output_bfd,
+ 0xc0 | ((val >> 3) & 7),
+ contents + rel->r_offset - 1);
+ break;
+ case 0x03:
+ /* addl */
+ BFD_ASSERT ((val & 0xc7) == 0x05);
+ bfd_put_8 (output_bfd, 0x81,
+ contents + rel->r_offset - 2);
+ bfd_put_8 (output_bfd,
+ 0xc0 | ((val >> 3) & 7),
+ contents + rel->r_offset - 1);
+ break;
+ default:
+ BFD_FAIL ();
+ break;
+ }
}
- else
- BFD_FAIL ();
bfd_put_32 (output_bfd, -tpoff (info, relocation),
contents + rel->r_offset);
continue;
@@ -3344,13 +3348,11 @@ elf_i386_finish_dynamic_sections (output_bfd, info)
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
@@ -3385,6 +3387,45 @@ elf_i386_finish_dynamic_sections (output_bfd, info)
#define elf_backend_relocate_section elf_i386_relocate_section
#define elf_backend_size_dynamic_sections elf_i386_size_dynamic_sections
-#ifndef ELF32_I386_C_INCLUDED
#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
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+static void
+elf_i386_post_process_headers (abfd, link_info)
+ bfd *abfd;
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
+{
+ Elf_Internal_Ehdr *i_ehdrp;
+
+ i_ehdrp = elf_elfheader (abfd);
+
+ /* 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
+
+#define elf32_bed elf32_i386_fbsd_bed
+
+#include "elf32-target.h"
+
+#undef elf_backend_post_process_headers
+#undef elf32_bed
diff --git a/bfd/elf32-i386qnx.c b/bfd/elf32-i386qnx.c
deleted file mode 100644
index 523eecb5ee4..00000000000
--- a/bfd/elf32-i386qnx.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Intel 80386/80486 QNX specific support for 32-bit ELF
- Copyright 2002
- Free Software Foundation, Inc.
-
- This file is part of BFD, the Binary File Descriptor library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#define ELF32_I386_C_INCLUDED
-#include "elf32-i386.c"
-
-#include "elf32-qnx.h"
-
-#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_i386qnx_vec
-
-#include "elf32-target.h"
-
diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c
index 01946465ce1..67da85c058a 100644
--- a/bfd/elf32-ip2k.c
+++ b/bfd/elf32-ip2k.c
@@ -1671,6 +1671,7 @@ ip2k_elf_gc_sweep_hook (abfd, info, sec, relocs)
#define ELF_ARCH bfd_arch_ip2k
#define ELF_MACHINE_CODE EM_IP2K
+#define ELF_MACHINE_ALT1 EM_IP2K_OLD
#define ELF_MAXPAGESIZE 1 /* No pages on the IP2K */
#define elf_info_to_howto_rel NULL
@@ -1689,4 +1690,3 @@ ip2k_elf_gc_sweep_hook (abfd, info, sec, relocs)
#include "elf32-target.h"
-
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index a2e9e0baafe..7a7d500c811 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -88,7 +88,11 @@ asection * m32r_elf_gc_mark_hook
This only saves space in libraries and object files, but perhaps
relocs will be put in ROM? All in all though, REL relocs are a pain
to work with. */
-#define USE_REL
+#define USE_REL 1
+
+#ifndef USE_REL
+#define USE_REL 0
+#endif
static reloc_howto_type m32r_elf_howto_table[] =
{
@@ -847,6 +851,7 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
section already exists a new one is created that follows it which
screws of _SDA_BASE_ address calcs because output_offset != 0. */
struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *bh;
asection *s = bfd_get_section_by_name (abfd, ".sdata");
/* The following code was cobbled from elf32-ppc.c and elflink.c. */
@@ -863,10 +868,10 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
bfd_set_section_alignment (abfd, s, 2);
}
- h = (struct elf_link_hash_entry *)
- bfd_link_hash_lookup (info->hash, "_SDA_BASE_", false, false, false);
+ bh = bfd_link_hash_lookup (info->hash, "_SDA_BASE_",
+ false, false, false);
- if ((h == NULL || h->root.type == bfd_link_hash_undefined)
+ if ((bh == NULL || bh->type == bfd_link_hash_undefined)
&& !(_bfd_generic_link_add_one_symbol (info,
abfd,
"_SDA_BASE_",
@@ -876,8 +881,9 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
(const char *) NULL,
false,
get_elf_backend_data (abfd)->collect,
- (struct bfd_link_hash_entry **) &h)))
+ &bh)))
return false;
+ h = (struct elf_link_hash_entry *) bh;
h->type = STT_OBJECT;
}
@@ -980,7 +986,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
/* Assume success. */
boolean ret = true;
-#ifndef USE_REL
+#if !USE_REL
if (info->relocateable)
return true;
#endif
@@ -1024,7 +1030,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
howto = m32r_elf_howto_table + r_type;
r_symndx = ELF32_R_SYM (rel->r_info);
-#ifdef USE_REL
+#if USE_REL
if (info->relocateable)
{
/* This is a relocateable link. We don't have to change
@@ -1100,7 +1106,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
sym = local_syms + r_symndx;
sec = local_sections[r_symndx];
sym_name = "<local symbol>";
-#ifndef USE_REL
+#if !USE_REL
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
addend = rel->r_addend;
#else
@@ -1505,7 +1511,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again)
will be at least 4 bytes closer if we can relax. It'll actually
be 4 or 8 bytes closer, but we don't know which just yet and
the difference isn't significant enough to worry about. */
-#ifndef USE_REL /* put in for learning purposes */
+#if !USE_REL /* put in for learning purposes */
pcrel_value += irel->r_addend;
#else
addend = bfd_get_signed_16 (abfd, contents + irel->r_offset + 2);
@@ -1534,7 +1540,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again)
We OR in CODE just in case it's not a nop (technically,
CODE currently must be a nop, but for cleanness we
allow it to be anything). */
-#ifndef USE_REL /* put in for learning purposes */
+#if !USE_REL /* put in for learning purposes */
code = 0x7e000000 | MAKE_PARALLEL (code);
#else
code = (0x7e000000 + (((addend >> 2) & 0xff) << 16)) | MAKE_PARALLEL (code);
@@ -1544,7 +1550,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again)
else
{
/* Change the seth rN,foo to a bl24 foo. */
-#ifndef USE_REL /* put in for learning purposes */
+#if !USE_REL /* put in for learning purposes */
code = 0xfe000000;
#else
code = 0xfe000000 + ((addend >> 2) & 0xffffff);
@@ -2105,7 +2111,7 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
#define elf_backend_check_relocs m32r_elf_check_relocs
#define elf_backend_can_gc_sections 1
-#ifndef USE_REL
+#if !USE_REL
#define elf_backend_rela_normal 1
#endif
#if 0 /* not yet */
diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c
index f189be898ce..9f05a9e1d84 100644
--- a/bfd/elf32-m68hc11.c
+++ b/bfd/elf32-m68hc11.c
@@ -62,7 +62,7 @@ boolean _bfd_m68hc11_elf_set_private_flags PARAMS ((bfd *, flagword));
boolean _bfd_m68hc11_elf_print_private_bfd_data PARAMS ((bfd *, PTR));
/* Use REL instead of RELA to save space */
-#define USE_REL
+#define USE_REL 1
/* The Motorola 68HC11 microcontroler only addresses 64Kb.
We must handle 8 and 16-bit relocations. The 32-bit relocation
@@ -646,12 +646,11 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
Elf_Internal_Rela *irel, *irelend;
bfd_byte *contents = NULL;
bfd_byte *free_contents = NULL;
- Elf32_External_Sym *extsyms = NULL;
Elf32_External_Sym *free_extsyms = NULL;
Elf_Internal_Rela *prev_insn_branch = NULL;
Elf_Internal_Rela *prev_insn_group = NULL;
unsigned insn_group_value = 0;
- Elf_External_Sym_Shndx *shndx_buf = NULL;
+ Elf_Internal_Sym *isymbuf = NULL;
/* Assume nothing changes. */
*again = false;
@@ -693,7 +692,8 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
{
bfd_vma symval;
bfd_vma value;
- Elf_Internal_Sym isym;
+ Elf_Internal_Sym *isym;
+ asection *sym_sec;
/* If this isn't something that can be relaxed, then ignore
this reloc. */
@@ -777,53 +777,24 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
}
/* Read this BFD's symbols if we haven't done so already. */
- if (extsyms == NULL)
+ if (isymbuf == NULL && symtab_hdr->sh_info != 0)
{
- /* Get cached copy if it exists. */
- if (symtab_hdr->contents != NULL)
- extsyms = (Elf32_External_Sym *) symtab_hdr->contents;
- else
- {
- /* Go get them off disk. */
- bfd_size_type amt = symtab_hdr->sh_size;
- extsyms = (Elf32_External_Sym *) bfd_malloc (amt);
- if (extsyms == NULL)
- goto error_return;
- free_extsyms = extsyms;
- if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0
- || bfd_bread ((PTR) extsyms, amt, abfd) != amt)
- goto error_return;
- }
-
- if (shndx_hdr->sh_size != 0)
- {
- bfd_size_type amt;
-
- amt = symtab_hdr->sh_info * sizeof (Elf_External_Sym_Shndx);
- shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt);
- if (shndx_buf == NULL)
- goto error_return;
- if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0
- || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt)
- goto error_return;
- shndx_hdr->contents = (PTR) shndx_buf;
- }
+ 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 == NULL)
+ goto error_return;
}
/* Get the value of the symbol referred to by the reloc. */
if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
{
- Elf32_External_Sym *esym;
- Elf_External_Sym_Shndx *shndx;
- asection *sym_sec;
-
/* A local symbol. */
- esym = extsyms + ELF32_R_SYM (irel->r_info);
- shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0);
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
-
- sym_sec = bfd_section_from_elf_index (abfd, isym.st_shndx);
- symval = (isym.st_value
+ isym = isymbuf + ELF32_R_SYM (irel->r_info);
+ sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ symval = (isym->st_value
+ sym_sec->output_section->vma
+ sym_sec->output_offset);
}
@@ -847,9 +818,11 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
continue;
}
+ isym = 0;
+ sym_sec = h->root.u.def.section;
symval = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
+ + sym_sec->output_section->vma
+ + sym_sec->output_offset);
}
if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_RL_GROUP)
@@ -862,10 +835,36 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
continue;
prev_insn_group = irel;
- insn_group_value = isym.st_value;
+ insn_group_value = isym->st_value;
continue;
}
+ /* When we relax some bytes, the size of our section changes.
+ This affects the layout of next input sections that go in our
+ output section. When the symbol is part of another section that
+ will go in the same output section as the current one, it's
+ final address may now be incorrect (too far). We must let the
+ linker re-compute all section offsets before processing this
+ reloc. Code example:
+
+ Initial Final
+ .sect .text section size = 6 section size = 4
+ jmp foo
+ jmp bar
+ .sect .text.foo_bar output_offset = 6 output_offset = 4
+ foo: rts
+ bar: rts
+
+ If we process the reloc now, the jmp bar is replaced by a
+ relative branch to the initial bar address (output_offset 6). */
+ if (*again && sym_sec != sec
+ && sym_sec->output_section == sec->output_section)
+ {
+ prev_insn_group = 0;
+ prev_insn_branch = 0;
+ continue;
+ }
+
value = symval;
/* Try to turn a far branch to a near branch. */
if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_16
@@ -911,6 +910,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
irel->r_offset - 1, 3);
}
prev_insn_branch = 0;
+ *again = true;
}
/* Try to turn a 16 bit address into a 8 bit page0 address. */
@@ -932,6 +932,8 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
if (prev_insn_group)
{
+ unsigned long old_sec_size = sec->_cooked_size;
+
/* Note that we've changed the reldection contents, etc. */
elf_section_data (sec)->relocs = internal_relocs;
free_relocs = NULL;
@@ -939,7 +941,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
elf_section_data (sec)->this_hdr.contents = contents;
free_contents = NULL;
- symtab_hdr->contents = (bfd_byte *) extsyms;
+ symtab_hdr->contents = (bfd_byte *) isymbuf;
free_extsyms = NULL;
m68hc11_relax_group (abfd, sec, contents, offset,
@@ -949,6 +951,8 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
prev_insn_group = 0;
irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
R_M68HC11_NONE);
+ if (sec->_cooked_size != old_sec_size)
+ *again = true;
continue;
}
@@ -968,7 +972,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
elf_section_data (sec)->this_hdr.contents = contents;
free_contents = NULL;
- symtab_hdr->contents = (bfd_byte *) extsyms;
+ symtab_hdr->contents = (bfd_byte *) isymbuf;
free_extsyms = NULL;
/* Fix the opcode. */
@@ -984,8 +988,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
R_M68HC11_8);
- /* That will change things, so, we should relax again.
- Note that this is not required, and it may be slow. */
+ /* That will change things, so, we should relax again. */
*again = true;
}
else if (ELF32_R_TYPE (irel->r_info) == R_M68HC11_16)
@@ -1014,7 +1017,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
elf_section_data (sec)->this_hdr.contents = contents;
free_contents = NULL;
- symtab_hdr->contents = (bfd_byte *) extsyms;
+ symtab_hdr->contents = (bfd_byte *) isymbuf;
free_extsyms = NULL;
/* Shrink the branch. */
@@ -1027,6 +1030,8 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
R_M68HC11_NONE);
m68hc11_elf_relax_delete_bytes (abfd, sec,
irel->r_offset + 1, 1);
+ /* That will change things, so, we should relax again. */
+ *again = true;
}
}
}
@@ -1058,7 +1063,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
else
{
/* Cache the symbols for elf_link_input_bfd. */
- symtab_hdr->contents = (unsigned char *) extsyms;
+ symtab_hdr->contents = (unsigned char *) isymbuf;
}
free_extsyms = NULL;
}
@@ -1085,20 +1090,17 @@ m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count)
int count;
{
Elf_Internal_Shdr *symtab_hdr;
- Elf_Internal_Shdr *shndx_hdr;
- Elf32_External_Sym *extsyms;
unsigned int sec_shndx;
- Elf_External_Sym_Shndx *shndx;
bfd_byte *contents;
Elf_Internal_Rela *irel, *irelend;
bfd_vma toaddr;
- Elf32_External_Sym *esym, *esymend;
+ Elf_Internal_Sym *isymbuf, *isym, *isymend;
struct elf_link_hash_entry **sym_hashes;
struct elf_link_hash_entry **end_hashes;
unsigned int symcount;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
- extsyms = (Elf32_External_Sym *) symtab_hdr->contents;
+ isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
@@ -1112,8 +1114,9 @@ m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count)
/* Actually delete the bytes. */
memmove (contents + addr, contents + addr + count,
(size_t) (toaddr - addr - count));
- sec->_cooked_size -= count;
+ sec->_cooked_size -= count;
+
/* Adjust all the relocs. */
for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
{
@@ -1212,24 +1215,13 @@ m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count)
}
/* Adjust the local symbols defined in this section. */
- shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
- shndx = (Elf_External_Sym_Shndx *) shndx_hdr->contents;
- esym = extsyms;
- esymend = esym + symtab_hdr->sh_info;
- for (; esym < esymend; esym++, shndx = (shndx ? shndx + 1 : NULL))
+ isymend = isymbuf + symtab_hdr->sh_info;
+ for (isym = isymbuf; isym < isymend; isym++)
{
- Elf_Internal_Sym isym;
- Elf_External_Sym_Shndx dummy;
-
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
-
- if (isym.st_shndx == sec_shndx
- && isym.st_value > addr
- && isym.st_value < toaddr)
- {
- isym.st_value -= count;
- bfd_elf32_swap_symbol_out (abfd, &isym, esym, &dummy);
- }
+ if (isym->st_shndx == sec_shndx
+ && isym->st_value > addr
+ && isym->st_value < toaddr)
+ isym->st_value -= count;
}
/* Now adjust the global symbols defined in this section. */
diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c
index 9ab8780574c..ea12e3b999e 100644
--- a/bfd/elf32-m68hc12.c
+++ b/bfd/elf32-m68hc12.c
@@ -54,7 +54,7 @@ boolean _bfd_m68hc12_elf_print_private_bfd_data PARAMS ((bfd *, PTR));
/* Use REL instead of RELA to save space */
-#define USE_REL
+#define USE_REL 1
/* The Motorola 68HC11 microcontroler only addresses 64Kb.
We must handle 8 and 16-bit relocations. The 32-bit relocation
diff --git a/bfd/elf32-or32.c b/bfd/elf32-or32.c
index a61b09d4152..39219e94b09 100644
--- a/bfd/elf32-or32.c
+++ b/bfd/elf32-or32.c
@@ -38,7 +38,7 @@ static bfd_reloc_status_type or32_elf_jumptarg_reloc PARAMS ((bfd *, a
/* 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_or32_howto_table[] =
{
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 6faffd203c0..243ff1445fc 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -3849,7 +3849,4 @@ ppc_elf_grok_psinfo (abfd, note)
#define elf_backend_grok_psinfo ppc_elf_grok_psinfo
#define elf_backend_reloc_type_class ppc_elf_reloc_type_class
-#ifndef ELF32_PPC_C_INCLUDED
#include "elf32-target.h"
-#endif
-
diff --git a/bfd/elf32-ppcqnx.c b/bfd/elf32-ppcqnx.c
deleted file mode 100644
index 35fbe37ed06..00000000000
--- a/bfd/elf32-ppcqnx.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* PowerPC QNX specific support for 32-bit ELF
- Copyright 2002
- Free Software Foundation, Inc.
-
- This file is part of BFD, the Binary File Descriptor library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#define ELF32_PPC_C_INCLUDED
-#include "elf32-ppc.c"
-
-#include "elf32-qnx.h"
-
-#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_powerpcleqnx_vec
-#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_powerpcqnx_vec
-
-#include "elf32-target.h"
-
diff --git a/bfd/elf32-qnx.h b/bfd/elf32-qnx.h
deleted file mode 100644
index d4eefb81508..00000000000
--- a/bfd/elf32-qnx.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* QNX specific support for 32-bit ELF
- Copyright 2002 Free Software Foundation, Inc.
-
- This file is part of BFD, the Binary File Descriptor library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
- /* Returns the end address of the segment + 1. */
-#define SEGMENT_END(segment, start) \
- (start + (segment->p_memsz > segment->p_filesz \
- ? segment->p_memsz : segment->p_filesz))
-
-static boolean elf_qnx_copy_private_bfd_data_p
- PARAMS ((bfd *, asection *, bfd *, asection *));
-static boolean elf_qnx_is_contained_by_filepos
- PARAMS ((asection *, Elf_Internal_Phdr *));
-static void elf_qnx_set_nonloadable_filepos
- PARAMS ((bfd *, Elf_Internal_Phdr *));
-
-static boolean
-elf_qnx_copy_private_bfd_data_p (ibfd, isec, obfd, osec)
- bfd *ibfd;
- asection *isec;
- bfd *obfd;
- asection *osec;
-{
- /* We don't use these parameters, but another target might. */
- ibfd = ibfd;
- obfd = obfd;
- osec = osec;
-
- return isec->next == NULL;
-}
-
-static boolean
-elf_qnx_is_contained_by_filepos (section, segment)
- asection *section;
- Elf_Internal_Phdr *segment;
-{
- return ((bfd_vma) section->filepos >= segment->p_offset
- && ((bfd_vma) section->filepos + section->_raw_size
- <= SEGMENT_END (segment, segment->p_offset)));
-}
-
-static void
-elf_qnx_set_nonloadable_filepos (abfd, phdrs)
- bfd *abfd;
- Elf_Internal_Phdr *phdrs;
-{
- struct elf_segment_map *m;
- Elf_Internal_Phdr *p;
- file_ptr off = 0;
-
- for (m = elf_tdata (abfd)->segment_map, p = phdrs;
- m != NULL;
- m = m->next, p++)
- {
- unsigned int i;
- asection **secpp;
-
- for (i = 0, secpp = m->sections; i < m->count; i++, secpp++)
- {
- asection *sec;
-
- sec = *secpp;
-
- if (p->p_type == PT_LOAD)
- off = sec->filepos;
- else
- {
- if (i == 0)
- {
- if (sec->filepos)
- p->p_offset = sec->filepos;
- else
- p->p_offset = off;
- }
- if (!sec->filepos)
- {
- off += sec->_raw_size;
- p->p_filesz += sec->_raw_size;
- }
- }
- }
- }
- return;
-}
-
-#ifndef elf_backend_set_nonloadable_filepos
-#define elf_backend_set_nonloadable_filepos elf_qnx_set_nonloadable_filepos
-#endif
-
-#ifndef elf_backend_is_contained_by_filepos
-#define elf_backend_is_contained_by_filepos elf_qnx_is_contained_by_filepos
-#endif
-
-#ifndef elf_backend_copy_private_bfd_data_p
-#define elf_backend_copy_private_bfd_data_p elf_qnx_copy_private_bfd_data_p
-#endif
diff --git a/bfd/elf32-sh-lin.c b/bfd/elf32-sh-lin.c
deleted file mode 100644
index e0b434da08b..00000000000
--- a/bfd/elf32-sh-lin.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Hitachi SH specific support for 32-bit Linux
- Copyright 2000, 2001 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#define TARGET_BIG_SYM bfd_elf32_shblin_vec
-#define TARGET_BIG_NAME "elf32-shbig-linux"
-#define TARGET_LITTLE_SYM bfd_elf32_shlin_vec
-#define TARGET_LITTLE_NAME "elf32-sh-linux"
-#define ELF_ARCH bfd_arch_sh
-#define ELF_MACHINE_CODE EM_SH
-#define ELF_MAXPAGESIZE 0x10000
-#define elf_symbol_leading_char 0
-
-#include "bfd.h"
-#include "sysdep.h"
-#include "elf/internal.h"
-#include "elf-bfd.h"
-
-static boolean elf32_shlin_grok_prstatus
- PARAMS ((bfd *abfd, Elf_Internal_Note *note));
-static boolean elf32_shlin_grok_psinfo
- PARAMS ((bfd *abfd, Elf_Internal_Note *note));
-
-/* Support for core dump NOTE sections */
-static boolean
-elf32_shlin_grok_prstatus (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
-{
- int offset;
- unsigned int raw_size;
-
- switch (note->descsz)
- {
- default:
- return false;
-
- case 168: /* Linux/SH */
- /* 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 = 92;
-
- break;
- }
-
- /* Make a ".reg/999" section. */
- return _bfd_elfcore_make_pseudosection (abfd, ".reg",
- raw_size, note->descpos + offset);
-}
-
-static boolean
-elf32_shlin_grok_psinfo (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
-{
- switch (note->descsz)
- {
- default:
- return false;
-
- case 124: /* Linux/SH elf_prpsinfo */
- elf_tdata (abfd)->core_program
- = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
- elf_tdata (abfd)->core_command
- = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
- }
-
- /* Note that for some reason, a spurious space is tacked
- onto the end of the args in some (at least one anyway)
- implementations, so strip it off if it exists. */
-
- {
- char *command = elf_tdata (abfd)->core_command;
- int n = strlen (command);
-
- if (0 < n && command[n - 1] == ' ')
- command[n - 1] = '\0';
- }
-
- return true;
-}
-
-
-#define elf_backend_grok_prstatus elf32_shlin_grok_prstatus
-#define elf_backend_grok_psinfo elf32_shlin_grok_psinfo
-
-
-
-#include "elf32-sh.c"
diff --git a/bfd/elf32-sh-nbsd.c b/bfd/elf32-sh-nbsd.c
deleted file mode 100644
index 692b057db46..00000000000
--- a/bfd/elf32-sh-nbsd.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Hitachi SH specific support for 32-bit NetBSD
- Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#define TARGET_BIG_SYM bfd_elf32_shnbsd_vec
-#define TARGET_BIG_NAME "elf32-sh-nbsd"
-#define TARGET_LITTLE_SYM bfd_elf32_shlnbsd_vec
-#define TARGET_LITTLE_NAME "elf32-shl-nbsd"
-#define ELF_ARCH bfd_arch_sh
-#define ELF_MACHINE_CODE EM_SH
-#define ELF_MAXPAGESIZE 0x10000
-#define elf_symbol_leading_char 0
-
-#include "elf32-sh.c"
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 703ac4016be..f52245bcc34 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -59,6 +59,12 @@ static bfd_byte *sh_elf_get_relocated_section_contents
static void sh_elf_copy_indirect_symbol
PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *));
+static int sh_elf_optimized_tls_reloc
+ PARAMS ((struct bfd_link_info *, int, int));
+static boolean sh_elf_mkobject
+ PARAMS((bfd *));
+static boolean sh_elf_object_p
+ PARAMS((bfd *));
static boolean sh_elf_check_relocs
PARAMS ((bfd *, struct bfd_link_info *, asection *,
const Elf_Internal_Rela *));
@@ -82,6 +88,8 @@ static boolean create_got_section
PARAMS((bfd *, struct bfd_link_info *));
static boolean sh_elf_create_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
+static bfd_vma dtpoff_base
+ PARAMS ((struct bfd_link_info *));
static asection * sh_elf_gc_mark_hook
PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
struct elf_link_hash_entry *, Elf_Internal_Sym *));
@@ -97,6 +105,10 @@ static enum elf_reloc_type_class sh_elf_reloc_type_class
#ifdef INCLUDE_SHMEDIA
inline static void movi_shori_putval PARAMS ((bfd *, unsigned long, char *));
#endif
+static boolean elf32_shlin_grok_prstatus
+ PARAMS ((bfd *abfd, Elf_Internal_Note *note));
+static boolean elf32_shlin_grok_psinfo
+ PARAMS ((bfd *abfd, Elf_Internal_Note *note));
/* The name of the dynamic interpreter. This is put in the .interp
section. */
@@ -713,14 +725,119 @@ static reloc_howto_type sh_elf_howto_table[] =
EMPTY_HOWTO (141),
EMPTY_HOWTO (142),
EMPTY_HOWTO (143),
- EMPTY_HOWTO (144),
- EMPTY_HOWTO (145),
- EMPTY_HOWTO (146),
- EMPTY_HOWTO (147),
- EMPTY_HOWTO (148),
- EMPTY_HOWTO (149),
- EMPTY_HOWTO (150),
- EMPTY_HOWTO (151),
+
+ HOWTO (R_SH_TLS_GD_32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* */
+ "R_SH_TLS_GD_32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_SH_TLS_LD_32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* */
+ "R_SH_TLS_LD_32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_SH_TLS_LDO_32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* */
+ "R_SH_TLS_LDO_32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_SH_TLS_IE_32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* */
+ "R_SH_TLS_IE_32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_SH_TLS_LE_32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* */
+ "R_SH_TLS_LE_32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_SH_TLS_DTPMOD32, /* 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, /* */
+ "R_SH_TLS_DTPMOD32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_SH_TLS_DTPOFF32, /* 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, /* */
+ "R_SH_TLS_DTPOFF32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_SH_TLS_TPOFF32, /* 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, /* */
+ "R_SH_TLS_TPOFF32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
EMPTY_HOWTO (152),
EMPTY_HOWTO (153),
EMPTY_HOWTO (154),
@@ -1776,6 +1893,14 @@ static const struct elf_reloc_map sh_reloc_map[] =
{ BFD_RELOC_VTABLE_ENTRY, R_SH_GNU_VTENTRY },
{ BFD_RELOC_SH_LOOP_START, R_SH_LOOP_START },
{ BFD_RELOC_SH_LOOP_END, R_SH_LOOP_END },
+ { BFD_RELOC_SH_TLS_GD_32, R_SH_TLS_GD_32 },
+ { BFD_RELOC_SH_TLS_LD_32, R_SH_TLS_LD_32 },
+ { BFD_RELOC_SH_TLS_LDO_32, R_SH_TLS_LDO_32 },
+ { BFD_RELOC_SH_TLS_IE_32, R_SH_TLS_IE_32 },
+ { BFD_RELOC_SH_TLS_LE_32, R_SH_TLS_LE_32 },
+ { BFD_RELOC_SH_TLS_DTPMOD32, R_SH_TLS_DTPMOD32 },
+ { BFD_RELOC_SH_TLS_DTPOFF32, R_SH_TLS_DTPOFF32 },
+ { BFD_RELOC_SH_TLS_TPOFF32, R_SH_TLS_TPOFF32 },
{ BFD_RELOC_32_GOT_PCREL, R_SH_GOT32 },
{ BFD_RELOC_32_PLT_PCREL, R_SH_PLT32 },
{ BFD_RELOC_SH_COPY, R_SH_COPY },
@@ -1874,6 +1999,7 @@ sh_elf_info_to_howto (abfd, cache_ptr, dst)
BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_2 || r > R_SH_LAST_INVALID_RELOC_2);
BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_3 || r > R_SH_LAST_INVALID_RELOC_3);
BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_4 || r > R_SH_LAST_INVALID_RELOC_4);
+ BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_5 || r > R_SH_LAST_INVALID_RELOC_5);
cache_ptr->howto = &sh_elf_howto_table[r];
}
@@ -3047,7 +3173,7 @@ static const bfd_byte elf_sh_pic_plt_entry_be[PLT_ENTRY_SIZE] =
0x6f, 0xf0, 0xff, 0xf0, /* nop */
0x6f, 0xf0, 0xff, 0xf0, /* nop */
0xce, 0x00, 0x01, 0x10, /* movi -GOT_BIAS, r17 */
- 0x00, 0xca, 0x45, 0x10, /* sub.l r12, r17, r17 */
+ 0x00, 0xc8, 0x45, 0x10, /* add.l r12, r17, r17 */
0x89, 0x10, 0x09, 0x90, /* ld.l r17, 8, r25 */
0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */
0x89, 0x10, 0x05, 0x10, /* ld.l r17, 4, r17 */
@@ -3067,7 +3193,7 @@ static const bfd_byte elf_sh_pic_plt_entry_le[PLT_ENTRY_SIZE] =
0xf0, 0xff, 0xf0, 0x6f, /* nop */
0xf0, 0xff, 0xf0, 0x6f, /* nop */
0x10, 0x01, 0x00, 0xce, /* movi -GOT_BIAS, r17 */
- 0x10, 0x45, 0xca, 0x00, /* sub.l r12, r17, r17 */
+ 0x10, 0x45, 0xc8, 0x00, /* add.l r12, r17, r17 */
0x90, 0x09, 0x10, 0x89, /* ld.l r17, 8, r25 */
0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */
0x10, 0x05, 0x10, 0x89, /* ld.l r17, 4, r17 */
@@ -3383,15 +3509,56 @@ struct elf_sh_link_hash_entry
struct elf_link_hash_entry root;
#ifdef INCLUDE_SHMEDIA
- bfd_vma datalabel_got_offset;
+ union
+ {
+ bfd_signed_vma refcount;
+ bfd_vma offset;
+ } datalabel_got;
#endif
/* Track dynamic relocs copied for this symbol. */
struct elf_sh_dyn_relocs *dyn_relocs;
bfd_signed_vma gotplt_refcount;
+
+ enum {
+ GOT_UNKNOWN = 0, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE
+ } tls_type;
+
+ /* If true, R_SH_TLS_TPOFF32 relocation is generated. */
+ boolean tls_tpoff32;
+};
+
+#define sh_elf_hash_entry(ent) ((struct elf_sh_link_hash_entry *)(ent))
+
+struct sh_elf_obj_tdata
+{
+ struct elf_obj_tdata root;
+
+ /* tls_type for each local got entry. */
+ char *local_got_tls_type;
};
+#define sh_elf_tdata(abfd) \
+ ((struct sh_elf_obj_tdata *) (abfd)->tdata.any)
+
+#define sh_elf_local_got_tls_type(abfd) \
+ (sh_elf_tdata (abfd)->local_got_tls_type)
+
+/* Override the generic function because we need to store sh_elf_obj_tdata
+ as the specific tdata. */
+
+static boolean
+sh_elf_mkobject (abfd)
+ bfd *abfd;
+{
+ bfd_size_type amt = sizeof (struct sh_elf_obj_tdata);
+ abfd->tdata.any = bfd_zalloc (abfd, amt);
+ if (abfd->tdata.any == NULL)
+ return false;
+ return true;
+}
+
/* sh ELF linker hash table. */
struct elf_sh_link_hash_table
@@ -3409,6 +3576,13 @@ struct elf_sh_link_hash_table
/* Small local sym to section mapping cache. */
struct sym_sec_cache sym_sec;
+
+ /* A counter or offset to track a TLS got entry. */
+ union
+ {
+ bfd_signed_vma refcount;
+ bfd_vma offset;
+ } tls_ldm_got;
};
/* Traverse an sh ELF linker hash table. */
@@ -3450,14 +3624,13 @@ sh_elf_link_hash_newfunc (entry, table, string)
table, string));
if (ret != (struct elf_sh_link_hash_entry *) NULL)
{
- struct elf_sh_link_hash_entry *eh;
-
- eh = (struct elf_sh_link_hash_entry *) ret;
- eh->dyn_relocs = NULL;
- eh->gotplt_refcount = 0;
+ ret->dyn_relocs = NULL;
+ ret->gotplt_refcount = 0;
#ifdef INCLUDE_SHMEDIA
- ret->datalabel_got_offset = (bfd_vma) -1;
+ ret->datalabel_got.refcount = ret->root.got.refcount;
#endif
+ ret->tls_type = GOT_UNKNOWN;
+ ret->tls_tpoff32 = false;
}
return (struct bfd_hash_entry *) ret;
@@ -3491,6 +3664,7 @@ sh_elf_link_hash_table_create (abfd)
ret->sdynbss = NULL;
ret->srelbss = NULL;
ret->sym_sec.abfd = NULL;
+ ret->tls_ldm_got.refcount = 0;
return &ret->root.root;
}
@@ -3582,13 +3756,16 @@ sh_elf_create_dynamic_sections (abfd, info)
{
/* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
.plt section. */
- struct elf_link_hash_entry *h = NULL;
+ struct elf_link_hash_entry *h;
+ 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,
- (struct bfd_link_hash_entry **) &h)))
+ 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;
@@ -3943,6 +4120,7 @@ allocate_dynrelocs (h, inf)
{
asection *s;
boolean dyn;
+ int tls_type = sh_elf_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. */
@@ -3954,27 +4132,50 @@ allocate_dynrelocs (h, inf)
}
s = htab->sgot;
+ h->got.offset = s->_raw_size;
+ s->_raw_size += 4;
+ /* R_SH_TLS_GD needs 2 consecutive GOT slots. */
+ if (tls_type == GOT_TLS_GD)
+ s->_raw_size += 4;
+ dyn = htab->root.dynamic_sections_created;
+ /* R_SH_TLS_IE_32 needs one dynamic relocation,
+ R_SH_TLS_GD 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, h))
+ htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+ }
+ else
+ h->got.offset = (bfd_vma) -1;
+
#ifdef INCLUDE_SHMEDIA
- if (h->type == STT_DATALABEL)
- {
- struct elf_sh_link_hash_entry *hsh;
+ if (eh->datalabel_got.refcount > 0)
+ {
+ asection *s;
+ boolean dyn;
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
- hsh = (struct elf_sh_link_hash_entry *)h;
- hsh->datalabel_got_offset = s->_raw_size;
+ /* 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;
}
- else
- h->got.offset = s->_raw_size;
-#else
- h->got.offset = s->_raw_size;
-#endif
+
+ s = htab->sgot;
+ eh->datalabel_got.offset = s->_raw_size;
s->_raw_size += 4;
dyn = htab->root.dynamic_sections_created;
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
}
else
- h->got.offset = (bfd_vma) -1;
+ eh->datalabel_got.offset = (bfd_vma) -1;
+#endif
if (eh->dyn_relocs == NULL)
return true;
@@ -4006,6 +4207,9 @@ allocate_dynrelocs (h, inf)
}
else
{
+ if (sh_elf_hash_entry (h)->tls_tpoff32)
+ goto keep;
+
/* For the non-shared case, discard space for relocs against
symbols which turn out to need copy relocs or are not
dynamic. */
@@ -4113,6 +4317,7 @@ sh_elf_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;
@@ -4158,6 +4363,7 @@ sh_elf_size_dynamic_sections (output_bfd, info)
locsymcount *= 2;
#endif
end_local_got = local_got + locsymcount;
+ local_tls_type = sh_elf_local_got_tls_type (ibfd);
s = htab->sgot;
srel = htab->srelgot;
for (; local_got < end_local_got; ++local_got)
@@ -4166,14 +4372,28 @@ sh_elf_size_dynamic_sections (output_bfd, info)
{
*local_got = s->_raw_size;
s->_raw_size += 4;
+ if (*local_tls_type == GOT_TLS_GD)
+ s->_raw_size += 4;
if (info->shared)
srel->_raw_size += sizeof (Elf32_External_Rela);
}
else
*local_got = (bfd_vma) -1;
+ ++local_tls_type;
}
}
+ if (htab->tls_ldm_got.refcount > 0)
+ {
+ /* Allocate 2 got entries and 1 dynamic reloc for R_SH_TLS_LD_32
+ 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->root, allocate_dynrelocs, (PTR) info);
@@ -4309,6 +4529,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
asection *sgotplt;
asection *splt;
asection *sreloc;
+ asection *srelgot;
htab = sh_elf_hash_table (info);
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
@@ -4320,6 +4541,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
sgotplt = htab->sgotplt;
splt = htab->splt;
sreloc = NULL;
+ srelgot = NULL;
rel = relocs;
relend = relocs + input_section->reloc_count;
@@ -4335,6 +4557,8 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_vma addend = (bfd_vma) 0;
bfd_reloc_status_type r;
int seen_stt_datalabel = 0;
+ bfd_vma off;
+ int tls_type;
r_symndx = ELF32_R_SYM (rel->r_info);
@@ -4356,6 +4580,8 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
&& r_type <= (int) R_SH_LAST_INVALID_RELOC_3)
|| ( r_type >= (int) R_SH_FIRST_INVALID_RELOC_4
&& r_type <= (int) R_SH_LAST_INVALID_RELOC_4)
+ || ( r_type >= (int) R_SH_FIRST_INVALID_RELOC_5
+ && r_type <= (int) R_SH_LAST_INVALID_RELOC_5)
|| (r_type >= (int) R_SH_FIRST_INVALID_RELOC_2
&& r_type <= (int) R_SH_LAST_INVALID_RELOC_2))
{
@@ -4526,15 +4752,18 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
with them here. */
|| ((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) != 0))))
+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
+ || (sec->output_section == NULL
+ && (sh_elf_hash_entry (h)->tls_type == GOT_TLS_IE
+ || sh_elf_hash_entry (h)->tls_type == GOT_TLS_GD)))
relocation = 0;
else if (sec->output_section == NULL)
{
(*_bfd_error_handler)
- (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
+ (_("%s: 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;
+ return false;
}
else
relocation = ((h->root.u.def.value
@@ -4779,7 +5008,6 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (h != NULL)
{
- bfd_vma off;
boolean dyn;
off = h->got.offset;
@@ -4789,7 +5017,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
struct elf_sh_link_hash_entry *hsh;
hsh = (struct elf_sh_link_hash_entry *)h;
- off = hsh->datalabel_got_offset;
+ off = hsh->datalabel_got.offset;
}
#endif
BFD_ASSERT (off != (bfd_vma) -1);
@@ -4825,7 +5053,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
struct elf_sh_link_hash_entry *hsh;
hsh = (struct elf_sh_link_hash_entry *)h;
- hsh->datalabel_got_offset |= 1;
+ hsh->datalabel_got.offset |= 1;
}
else
#endif
@@ -4837,8 +5065,6 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- bfd_vma off;
-
#ifdef INCLUDE_SHMEDIA
if (rel->r_addend)
{
@@ -4872,11 +5098,14 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared)
{
- asection *srelgot;
Elf_Internal_Rela outrel;
- srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
- BFD_ASSERT (srelgot != NULL);
+ if (srelgot == NULL)
+ {
+ srelgot = bfd_get_section_by_name (dynobj,
+ ".rela.got");
+ BFD_ASSERT (srelgot != NULL);
+ }
outrel.r_offset = (sgot->output_section->vma
+ sgot->output_offset
@@ -5010,6 +5239,450 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
rel->r_offset, sec, start, end);
break;
}
+
+ case R_SH_TLS_GD_32:
+ case R_SH_TLS_IE_32:
+ r_type = sh_elf_optimized_tls_reloc (info, r_type, h == NULL);
+ tls_type = GOT_UNKNOWN;
+ if (h == NULL && local_got_offsets)
+ tls_type = sh_elf_local_got_tls_type (input_bfd) [r_symndx];
+ else if (h != NULL)
+ {
+ tls_type = sh_elf_hash_entry (h)->tls_type;
+ if (! info->shared
+ && (h->dynindx == -1
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+ && (tls_type == GOT_TLS_IE
+ || sh_elf_hash_entry (h)->tls_tpoff32))
+ r_type = R_SH_TLS_LE_32;
+ }
+
+ if (r_type == R_SH_TLS_GD_32 && tls_type == GOT_TLS_IE)
+ r_type = R_SH_TLS_IE_32;
+
+ if (r_type == R_SH_TLS_LE_32)
+ {
+ bfd_vma offset;
+ unsigned short insn;
+ int indx;
+ Elf_Internal_Rela outrel;
+
+ if (ELF32_R_TYPE (rel->r_info) == R_SH_TLS_GD_32)
+ {
+ /* GD->LE transition:
+ mov.l 1f,r4; mova 2f,r0; mov.l 2f,r1; add r0,r1;
+ jsr @r1; add r12,r4; bra 3f; nop; .align 2;
+ 1: .long x$TLSGD; 2: .long __tls_get_addr@PLT; 3:
+ We change it into:
+ mov.l 1f,r4; stc gbr,r0; add r4,r0; nop;
+ nop; nop; ...
+ 1: .long x@TPOFF; 2: .long __tls_get_addr@PLT; 3:. */
+
+ offset = rel->r_offset;
+ BFD_ASSERT (offset >= 16);
+ /* Size of GD instructions is 16 or 18. */
+ offset -= 16;
+ insn = bfd_get_16 (input_bfd, contents + offset + 0);
+ if ((insn & 0xff00) == 0xc700)
+ {
+ BFD_ASSERT (offset >= 2);
+ offset -= 2;
+ insn = bfd_get_16 (input_bfd, contents + offset + 0);
+ }
+
+ BFD_ASSERT ((insn & 0xff00) == 0xd400);
+ insn = bfd_get_16 (input_bfd, contents + offset + 2);
+ BFD_ASSERT ((insn & 0xff00) == 0xc700);
+ insn = bfd_get_16 (input_bfd, contents + offset + 4);
+ BFD_ASSERT ((insn & 0xff00) == 0xd100);
+ insn = bfd_get_16 (input_bfd, contents + offset + 6);
+ BFD_ASSERT (insn == 0x310c);
+ insn = bfd_get_16 (input_bfd, contents + offset + 8);
+ BFD_ASSERT (insn == 0x410b);
+ insn = bfd_get_16 (input_bfd, contents + offset + 10);
+ BFD_ASSERT (insn == 0x34cc);
+
+ bfd_put_16 (output_bfd, 0x0012, contents + offset + 2);
+ bfd_put_16 (output_bfd, 0x304c, contents + offset + 4);
+ bfd_put_16 (output_bfd, 0x0009, contents + offset + 6);
+ bfd_put_16 (output_bfd, 0x0009, contents + offset + 8);
+ bfd_put_16 (output_bfd, 0x0009, contents + offset + 10);
+ }
+ else
+ {
+ int index;
+
+ /* IE->LE transition:
+ mov.l 1f,r0; stc gbr,rN; mov.l @(r0,r12),rM;
+ bra 2f; add ...; .align 2; 1: x@GOTTPOFF; 2:
+ We change it into:
+ mov.l .Ln,rM; stc gbr,rN; nop; ...;
+ 1: x@TPOFF; 2:. */
+
+ offset = rel->r_offset;
+ BFD_ASSERT (offset >= 16);
+ /* Size of IE instructions is 10 or 12. */
+ offset -= 10;
+ insn = bfd_get_16 (input_bfd, contents + offset + 0);
+ if ((insn & 0xf0ff) == 0x0012)
+ {
+ BFD_ASSERT (offset >= 2);
+ offset -= 2;
+ insn = bfd_get_16 (input_bfd, contents + offset + 0);
+ }
+
+ BFD_ASSERT ((insn & 0xff00) == 0xd000);
+ index = insn & 0x00ff;
+ insn = bfd_get_16 (input_bfd, contents + offset + 2);
+ BFD_ASSERT ((insn & 0xf0ff) == 0x0012);
+ insn = bfd_get_16 (input_bfd, contents + offset + 4);
+ BFD_ASSERT ((insn & 0xf0ff) == 0x00ce);
+ insn = 0xd000 | (insn & 0x0f00) | index;
+ bfd_put_16 (output_bfd, insn, contents + offset + 0);
+ bfd_put_16 (output_bfd, 0x0009, contents + offset + 4);
+ }
+
+ if (sreloc == NULL)
+ {
+ const char *name;
+
+ name = (bfd_elf_string_from_elf_section
+ (input_bfd,
+ elf_elfheader (input_bfd)->e_shstrndx,
+ elf_section_data (input_section)->rel_hdr.sh_name));
+ if (name == NULL)
+ return false;
+
+ BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+ && strcmp (bfd_get_section_name (input_bfd,
+ input_section),
+ name + 5) == 0);
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ BFD_ASSERT (sreloc != NULL);
+ }
+
+ indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+ outrel.r_offset = (input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset);
+ outrel.r_info = ELF32_R_INFO (indx, R_SH_TLS_TPOFF32);
+ if (indx == 0)
+ outrel.r_addend = relocation - dtpoff_base (info);
+ else
+ outrel.r_addend = 0;
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+ (((Elf32_External_Rela *)
+ sreloc->contents)
+ + sreloc->reloc_count));
+ ++sreloc->reloc_count;
+
+ continue;
+ }
+
+ sgot = htab->sgot;
+ if (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;
+ Elf32_External_Rela *loc;
+ int dr_type, indx;
+
+ if (srelgot == NULL)
+ {
+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+ BFD_ASSERT (srelgot != NULL);
+ }
+
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset + off);
+
+ indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+ dr_type = (r_type == R_SH_TLS_GD_32 ? R_SH_TLS_DTPMOD32 :
+ R_SH_TLS_TPOFF32);
+ if (dr_type == R_SH_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 *) srelgot->contents;
+ loc += srelgot->reloc_count++;
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+
+ if (r_type == R_SH_TLS_GD_32)
+ {
+ if (indx == 0)
+ {
+ bfd_put_32 (output_bfd,
+ relocation - dtpoff_base (info),
+ sgot->contents + off + 4);
+ }
+ else
+ {
+ outrel.r_info = ELF32_R_INFO (indx,
+ R_SH_TLS_DTPOFF32);
+ outrel.r_offset += 4;
+ outrel.r_addend = 0;
+ srelgot->reloc_count++;
+ loc++;
+ 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 == (int) ELF32_R_TYPE (rel->r_info))
+ relocation = sgot->output_offset + off;
+ else
+ {
+ bfd_vma offset;
+ unsigned short insn;
+
+ /* GD->IE transition:
+ mov.l 1f,r4; mova 2f,r0; mov.l 2f,r1; add r0,r1;
+ jsr @r1; add r12,r4; bra 3f; nop; .align 2;
+ 1: .long x$TLSGD; 2: .long __tls_get_addr@PLT; 3:
+ We change it into:
+ mov.l 1f,r0; stc gbr,r4; mov.l @(r0,r12),r0; add r4,r0;
+ nop; nop; bra 3f; nop; .align 2;
+ 1: .long x@TPOFF; 2:...; 3:. */
+
+ offset = rel->r_offset;
+ BFD_ASSERT (offset >= 16);
+ /* Size of GD instructions is 16 or 18. */
+ offset -= 16;
+ insn = bfd_get_16 (input_bfd, contents + offset + 0);
+ if ((insn & 0xff00) == 0xc700)
+ {
+ BFD_ASSERT (offset >= 2);
+ offset -= 2;
+ insn = bfd_get_16 (input_bfd, contents + offset + 0);
+ }
+
+ BFD_ASSERT ((insn & 0xff00) == 0xd400);
+
+ /* Replace mov.l 1f,R4 with mov.l 1f,r0. */
+ bfd_put_16 (output_bfd, insn & 0xf0ff, contents + offset);
+
+ insn = bfd_get_16 (input_bfd, contents + offset + 2);
+ BFD_ASSERT ((insn & 0xff00) == 0xc700);
+ insn = bfd_get_16 (input_bfd, contents + offset + 4);
+ BFD_ASSERT ((insn & 0xff00) == 0xd100);
+ insn = bfd_get_16 (input_bfd, contents + offset + 6);
+ BFD_ASSERT (insn == 0x310c);
+ insn = bfd_get_16 (input_bfd, contents + offset + 8);
+ BFD_ASSERT (insn == 0x410b);
+ insn = bfd_get_16 (input_bfd, contents + offset + 10);
+ BFD_ASSERT (insn == 0x34cc);
+
+ bfd_put_16 (output_bfd, 0x0412, contents + offset + 2);
+ bfd_put_16 (output_bfd, 0x00ce, contents + offset + 4);
+ bfd_put_16 (output_bfd, 0x304c, contents + offset + 6);
+ bfd_put_16 (output_bfd, 0x0009, contents + offset + 8);
+ bfd_put_16 (output_bfd, 0x0009, contents + offset + 10);
+
+ bfd_put_32 (output_bfd, sgot->output_offset + off,
+ contents + rel->r_offset);
+
+ continue;
+ }
+
+ addend = rel->r_addend;
+
+ goto final_link_relocate;
+
+ case R_SH_TLS_LD_32:
+ if (! info->shared)
+ {
+ bfd_vma offset;
+ unsigned short insn;
+
+ /* LD->LE transition:
+ mov.l 1f,r4; mova 2f,r0; mov.l 2f,r1; add r0,r1;
+ jsr @r1; add r12,r4; bra 3f; nop; .align 2;
+ 1: .long x$TLSLD; 2: .long __tls_get_addr@PLT; 3:
+ We change it into:
+ stc gbr,r0; nop; nop; nop;
+ nop; nop; bra 3f; ...; 3:. */
+
+ offset = rel->r_offset;
+ BFD_ASSERT (offset >= 16);
+ /* Size of LD instructions is 16 or 18. */
+ offset -= 16;
+ insn = bfd_get_16 (input_bfd, contents + offset + 0);
+ if ((insn & 0xff00) == 0xc700)
+ {
+ BFD_ASSERT (offset >= 2);
+ offset -= 2;
+ insn = bfd_get_16 (input_bfd, contents + offset + 0);
+ }
+
+ BFD_ASSERT ((insn & 0xff00) == 0xd400);
+ insn = bfd_get_16 (input_bfd, contents + offset + 2);
+ BFD_ASSERT ((insn & 0xff00) == 0xc700);
+ insn = bfd_get_16 (input_bfd, contents + offset + 4);
+ BFD_ASSERT ((insn & 0xff00) == 0xd100);
+ insn = bfd_get_16 (input_bfd, contents + offset + 6);
+ BFD_ASSERT (insn == 0x310c);
+ insn = bfd_get_16 (input_bfd, contents + offset + 8);
+ BFD_ASSERT (insn == 0x410b);
+ insn = bfd_get_16 (input_bfd, contents + offset + 10);
+ BFD_ASSERT (insn == 0x34cc);
+
+ bfd_put_16 (output_bfd, 0x0012, contents + offset + 0);
+ bfd_put_16 (output_bfd, 0x0009, contents + offset + 2);
+ bfd_put_16 (output_bfd, 0x0009, contents + offset + 4);
+ bfd_put_16 (output_bfd, 0x0009, contents + offset + 6);
+ bfd_put_16 (output_bfd, 0x0009, contents + offset + 8);
+ bfd_put_16 (output_bfd, 0x0009, contents + offset + 10);
+
+ continue;
+ }
+
+ sgot = htab->sgot;
+ if (sgot == NULL)
+ abort ();
+
+ off = htab->tls_ldm_got.offset;
+ if (off & 1)
+ off &= ~1;
+ else
+ {
+ Elf_Internal_Rela outrel;
+ Elf32_External_Rela *loc;
+
+ srelgot = htab->srelgot;
+ if (srelgot == NULL)
+ abort ();
+
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset + off);
+ outrel.r_addend = 0;
+ outrel.r_info = ELF32_R_INFO (0, R_SH_TLS_DTPMOD32);
+ loc = (Elf32_External_Rela *) srelgot->contents;
+ loc += srelgot->reloc_count++;
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ htab->tls_ldm_got.offset |= 1;
+ }
+
+ relocation = sgot->output_offset + off;
+ addend = rel->r_addend;
+
+ goto final_link_relocate;
+
+ case R_SH_TLS_LDO_32:
+ if (! info->shared)
+ {
+ int indx;
+ Elf_Internal_Rela outrel;
+
+ if (sreloc == NULL)
+ {
+ const char *name;
+
+ name = (bfd_elf_string_from_elf_section
+ (input_bfd,
+ elf_elfheader (input_bfd)->e_shstrndx,
+ elf_section_data (input_section)->rel_hdr.sh_name));
+ if (name == NULL)
+ return false;
+
+ BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+ && strcmp (bfd_get_section_name (input_bfd,
+ input_section),
+ name + 5) == 0);
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ BFD_ASSERT (sreloc != NULL);
+ }
+
+ indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+ outrel.r_offset = (input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset);
+ outrel.r_info = ELF32_R_INFO (indx, R_SH_TLS_TPOFF32);
+ if (indx == 0)
+ outrel.r_addend = relocation - dtpoff_base (info);
+ else
+ outrel.r_addend = 0;
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+ (((Elf32_External_Rela *)
+ sreloc->contents)
+ + sreloc->reloc_count));
+ ++sreloc->reloc_count;
+
+ continue;
+ }
+ else
+ relocation -= dtpoff_base (info);
+
+ addend = rel->r_addend;
+ goto final_link_relocate;
+
+ case R_SH_TLS_LE_32:
+ {
+ int indx;
+ Elf_Internal_Rela outrel;
+
+ if (sreloc == NULL)
+ {
+ const char *name;
+
+ name = (bfd_elf_string_from_elf_section
+ (input_bfd,
+ elf_elfheader (input_bfd)->e_shstrndx,
+ elf_section_data (input_section)->rel_hdr.sh_name));
+ if (name == NULL)
+ return false;
+
+ BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+ && strcmp (bfd_get_section_name (input_bfd,
+ input_section),
+ name + 5) == 0);
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ BFD_ASSERT (sreloc != NULL);
+ }
+
+ indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+ outrel.r_offset = (input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset);
+ outrel.r_info = ELF32_R_INFO (indx, R_SH_TLS_TPOFF32);
+ if (indx == 0)
+ outrel.r_addend = relocation - dtpoff_base (info);
+ else
+ outrel.r_addend = 0;
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+ (((Elf32_External_Rela *)
+ sreloc->contents)
+ + sreloc->reloc_count));
+ ++sreloc->reloc_count;
+
+ continue;
+ }
}
relocation_done:
@@ -5157,6 +5830,20 @@ sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
return NULL;
}
+/* 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_segment is NULL, we should have signalled an error already. */
+ if (elf_hash_table (info)->tls_segment == NULL)
+ return 0;
+ return elf_hash_table (info)->tls_segment->start;
+}
+
static asection *
sh_elf_gc_mark_hook (sec, info, rel, h, sym)
asection *sec;
@@ -5224,119 +5911,170 @@ sh_elf_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_SH_GOT32:
- case R_SH_GOTOFF:
- case R_SH_GOTPC:
+ {
#ifdef INCLUDE_SHMEDIA
- case R_SH_GOT_LOW16:
- case R_SH_GOT_MEDLOW16:
- case R_SH_GOT_MEDHI16:
- case R_SH_GOT_HI16:
- case R_SH_GOT10BY4:
- case R_SH_GOT10BY8:
- case R_SH_GOTOFF_LOW16:
- case R_SH_GOTOFF_MEDLOW16:
- case R_SH_GOTOFF_MEDHI16:
- case R_SH_GOTOFF_HI16:
- case R_SH_GOTPC_LOW16:
- case R_SH_GOTPC_MEDLOW16:
- case R_SH_GOTPC_MEDHI16:
- case R_SH_GOTPC_HI16:
+ int seen_stt_datalabel = 0;
#endif
- 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_SH_DIR32:
- case R_SH_REL32:
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- struct elf_sh_link_hash_entry *eh;
- struct elf_sh_dyn_relocs **pp;
- struct elf_sh_dyn_relocs *p;
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-
- if (!info->shared && h->plt.refcount > 0)
- h->plt.refcount -= 1;
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx < symtab_hdr->sh_info)
+ h = NULL;
+ else
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+#ifdef INCLUDE_SHMEDIA
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ {
+ seen_stt_datalabel |= h->type == STT_DATALABEL;
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ }
+#endif
+ }
+ eh = (struct elf_sh_link_hash_entry *) h;
- eh = (struct elf_sh_link_hash_entry *) h;
+ switch (sh_elf_optimized_tls_reloc (info, ELF32_R_TYPE (rel->r_info),
+ ELF32_R_SYM (rel->r_info)
+ >= symtab_hdr->sh_info))
+ {
+ case R_SH_TLS_LD_32:
+ if (sh_elf_hash_table (info)->tls_ldm_got.refcount > 0)
+ sh_elf_hash_table (info)->tls_ldm_got.refcount -= 1;
+ break;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
+ case R_SH_GOT32:
+ case R_SH_GOTOFF:
+ case R_SH_GOTPC:
+#ifdef INCLUDE_SHMEDIA
+ case R_SH_GOT_LOW16:
+ case R_SH_GOT_MEDLOW16:
+ case R_SH_GOT_MEDHI16:
+ case R_SH_GOT_HI16:
+ case R_SH_GOT10BY4:
+ case R_SH_GOT10BY8:
+ case R_SH_GOTOFF_LOW16:
+ case R_SH_GOTOFF_MEDLOW16:
+ case R_SH_GOTOFF_MEDHI16:
+ case R_SH_GOTOFF_HI16:
+ case R_SH_GOTPC_LOW16:
+ case R_SH_GOTPC_MEDLOW16:
+ case R_SH_GOTPC_MEDHI16:
+ case R_SH_GOTPC_HI16:
+#endif
+ case R_SH_TLS_GD_32:
+ case R_SH_TLS_IE_32:
+ if (h != NULL)
+ {
+#ifdef INCLUDE_SHMEDIA
+ if (seen_stt_datalabel)
{
- if (ELF32_R_TYPE (rel->r_info) == R_SH_REL32)
- p->pc_count -= 1;
- p->count -= 1;
- if (p->count == 0)
- *pp = p->next;
- break;
+ if (eh->datalabel_got.refcount > 0)
+ eh->datalabel_got.refcount -= 1;
}
- }
- break;
+ else
+#endif
+ if (h->got.refcount > 0)
+ h->got.refcount -= 1;
+ }
+ else if (local_got_refcounts != NULL)
+ {
+#ifdef INCLUDE_SHMEDIA
+ if (rel->r_addend & 1)
+ {
+ if (local_got_refcounts[symtab_hdr->sh_info + r_symndx] > 0)
+ local_got_refcounts[symtab_hdr->sh_info + r_symndx] -= 1;
+ }
+ else
+#endif
+ if (local_got_refcounts[r_symndx] > 0)
+ local_got_refcounts[r_symndx] -= 1;
+ }
+ break;
+
+ case R_SH_DIR32:
+ case R_SH_REL32:
+ if (h != NULL)
+ {
+ struct elf_sh_dyn_relocs **pp;
+ struct elf_sh_dyn_relocs *p;
+
+
+ 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)
+ {
+ if (ELF32_R_TYPE (rel->r_info) == R_SH_REL32)
+ p->pc_count -= 1;
+ p->count -= 1;
+ if (p->count == 0)
+ *pp = p->next;
+ break;
+ }
+ }
+ break;
- case R_SH_PLT32:
+ case R_SH_PLT32:
#ifdef INCLUDE_SHMEDIA
- case R_SH_PLT_LOW16:
- case R_SH_PLT_MEDLOW16:
- case R_SH_PLT_MEDHI16:
- case R_SH_PLT_HI16:
+ case R_SH_PLT_LOW16:
+ case R_SH_PLT_MEDLOW16:
+ case R_SH_PLT_MEDHI16:
+ case R_SH_PLT_HI16:
#endif
- 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;
+ if (h != NULL)
+ {
+ if (h->plt.refcount > 0)
+ h->plt.refcount -= 1;
+ }
+ break;
- case R_SH_GOTPLT32:
+ case R_SH_GOTPLT32:
#ifdef INCLUDE_SHMEDIA
- case R_SH_GOTPLT_LOW16:
- case R_SH_GOTPLT_MEDLOW16:
- case R_SH_GOTPLT_MEDHI16:
- case R_SH_GOTPLT_HI16:
- case R_SH_GOTPLT10BY4:
- case R_SH_GOTPLT10BY8:
+ case R_SH_GOTPLT_LOW16:
+ case R_SH_GOTPLT_MEDLOW16:
+ case R_SH_GOTPLT_MEDHI16:
+ case R_SH_GOTPLT_HI16:
+ case R_SH_GOTPLT10BY4:
+ case R_SH_GOTPLT10BY8:
#endif
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx >= symtab_hdr->sh_info)
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- eh = (struct elf_sh_link_hash_entry *) h;
- if (eh->gotplt_refcount > 0)
- {
- eh->gotplt_refcount -= 1;
- if (h->plt.refcount > 0)
- h->plt.refcount -= 1;
- }
- else 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;
+ if (h != NULL)
+ {
+ if (eh->gotplt_refcount > 0)
+ {
+ eh->gotplt_refcount -= 1;
+ if (h->plt.refcount > 0)
+ h->plt.refcount -= 1;
+ }
+#ifdef INCLUDE_SHMEDIA
+ else if (seen_stt_datalabel)
+ {
+ if (eh->datalabel_got.refcount > 0)
+ eh->datalabel_got.refcount -= 1;
+ }
+#endif
+ else if (h->got.refcount > 0)
+ h->got.refcount -= 1;
+ }
+ else if (local_got_refcounts != NULL)
+ {
+#ifdef INCLUDE_SHMEDIA
+ if (rel->r_addend & 1)
+ {
+ if (local_got_refcounts[symtab_hdr->sh_info + r_symndx] > 0)
+ local_got_refcounts[symtab_hdr->sh_info + r_symndx] -= 1;
+ }
+ else
+#endif
+ if (local_got_refcounts[r_symndx] > 0)
+ local_got_refcounts[r_symndx] -= 1;
+ }
+ break;
- default:
- break;
- }
+ default:
+ break;
+ }
+ }
return true;
}
@@ -5349,6 +6087,9 @@ sh_elf_copy_indirect_symbol (bed, dir, ind)
struct elf_link_hash_entry *dir, *ind;
{
struct elf_sh_link_hash_entry *edir, *eind;
+#ifdef INCLUDE_SHMEDIA
+ bfd_signed_vma tmp;
+#endif
edir = (struct elf_sh_link_hash_entry *) dir;
eind = (struct elf_sh_link_hash_entry *) ind;
@@ -5387,10 +6128,50 @@ sh_elf_copy_indirect_symbol (bed, dir, ind)
}
edir->gotplt_refcount = eind->gotplt_refcount;
eind->gotplt_refcount = 0;
+#ifdef INCLUDE_SHMEDIA
+ tmp = edir->datalabel_got.refcount;
+ if (tmp < 1)
+ {
+ edir->datalabel_got.refcount = eind->datalabel_got.refcount;
+ eind->datalabel_got.refcount = tmp;
+ }
+ else
+ BFD_ASSERT (eind->datalabel_got.refcount < 1);
+#endif
+
+ 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
+sh_elf_optimized_tls_reloc (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_SH_TLS_GD_32:
+ case R_SH_TLS_IE_32:
+ if (is_local)
+ return R_SH_TLS_LE_32;
+ return R_SH_TLS_IE_32;
+ case R_SH_TLS_LD_32:
+ return R_SH_TLS_LE_32;
+ }
+
+ return r_type;
+}
+
/* Look through the relocs for a section during the first phase.
Since we don't do .gots or .plts, we just need to consider the
virtual table relocs for gc. */
@@ -5412,6 +6193,8 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
asection *sgot;
asection *srelgot;
asection *sreloc;
+ unsigned int r_type;
+ int tls_type, old_tls_type;
sgot = NULL;
srelgot = NULL;
@@ -5435,17 +6218,42 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
{
struct elf_link_hash_entry *h;
unsigned long r_symndx;
+#ifdef INCLUDE_SHMEDIA
+ int seen_stt_datalabel = 0;
+#endif
r_symndx = ELF32_R_SYM (rel->r_info);
+ r_type = ELF32_R_TYPE (rel->r_info);
+
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+#ifdef INCLUDE_SHMEDIA
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ {
+ seen_stt_datalabel |= h->type == STT_DATALABEL;
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ }
+#endif
+ }
+
+ r_type = sh_elf_optimized_tls_reloc (info, r_type, h == NULL);
+ if (! info->shared
+ && r_type == R_SH_TLS_IE_32
+ && h != NULL
+ && h->root.type != bfd_link_hash_undefined
+ && h->root.type != bfd_link_hash_undefweak
+ && (h->dynindx == -1
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ r_type = R_SH_TLS_LE_32;
/* Some relocs require a global offset table. */
if (htab->sgot == NULL)
{
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (r_type)
{
case R_SH_GOTPLT32:
case R_SH_GOT32:
@@ -5473,6 +6281,9 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
case R_SH_GOTPC_MEDHI16:
case R_SH_GOTPC_HI16:
#endif
+ case R_SH_TLS_GD_32:
+ case R_SH_TLS_LD_32:
+ case R_SH_TLS_IE_32:
if (dynobj == NULL)
htab->root.dynobj = dynobj = abfd;
if (! create_got_section (dynobj, info))
@@ -5484,7 +6295,7 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
}
}
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (r_type)
{
/* This relocation describes the C++ object vtable hierarchy.
Reconstruct it for later use during GC. */
@@ -5501,6 +6312,12 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
break;
force_got:
+ case R_SH_TLS_IE_32:
+ if (info->shared)
+ info->flags |= DF_STATIC_TLS;
+
+ /* FALLTHROUGH */
+ case R_SH_TLS_GD_32:
case R_SH_GOT32:
#ifdef INCLUDE_SHMEDIA
case R_SH_GOT_LOW16:
@@ -5510,8 +6327,34 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
case R_SH_GOT10BY4:
case R_SH_GOT10BY8:
#endif
+ switch (r_type)
+ {
+ default:
+ tls_type = GOT_NORMAL;
+ break;
+ case R_SH_TLS_GD_32:
+ tls_type = GOT_TLS_GD;
+ break;
+ case R_SH_TLS_IE_32:
+ tls_type = GOT_TLS_IE;
+ break;
+ }
+
if (h != NULL)
- h->got.refcount += 1;
+ {
+#ifdef INCLUDE_SHMEDIA
+ if (seen_stt_datalabel)
+ {
+ struct elf_sh_link_hash_entry *eh =
+ (struct elf_sh_link_hash_entry *)h;
+
+ eh->datalabel_got.refcount += 1;
+ }
+ else
+#endif
+ h->got.refcount += 1;
+ old_tls_type = sh_elf_hash_entry (h)->tls_type;
+ }
else
{
bfd_signed_vma *local_got_refcounts;
@@ -5530,14 +6373,59 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
codelabel local GOT offsets. */
size *= 2;
#endif
+ size += symtab_hdr->sh_info;
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;
+#ifdef INCLUDE_SHMEDIA
+ /* Take care of both the datalabel and codelabel local
+ GOT offsets. */
+ sh_elf_local_got_tls_type (abfd)
+ = (char *) (local_got_refcounts + 2 * symtab_hdr->sh_info);
+#else
+ sh_elf_local_got_tls_type (abfd)
+ = (char *) (local_got_refcounts + symtab_hdr->sh_info);
+#endif
+ }
+#ifdef INCLUDE_SHMEDIA
+ if (rel->r_addend & 1)
+ local_got_refcounts[symtab_hdr->sh_info + r_symndx] += 1;
+ else
+#endif
+ local_got_refcounts[r_symndx] += 1;
+ old_tls_type = sh_elf_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 = GOT_TLS_IE;
+ else
+ {
+ (*_bfd_error_handler)
+ (_("%s: `%s' accessed both as normal and thread local symbol"),
+ bfd_archive_filename (abfd), h->root.root.string);
+ return false;
}
- local_got_refcounts[r_symndx] += 1;
}
+
+ if (old_tls_type != tls_type)
+ {
+ if (h != NULL)
+ sh_elf_hash_entry (h)->tls_type = tls_type;
+ else
+ sh_elf_local_got_tls_type (abfd) [r_symndx] = tls_type;
+ }
+
+ break;
+
+ case R_SH_TLS_LD_32:
+ sh_elf_hash_table(info)->tls_ldm_got.refcount += 1;
break;
case R_SH_GOTPLT32:
@@ -5620,7 +6508,7 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
symbol. */
if ((info->shared
&& (sec->flags & SEC_ALLOC) != 0
- && (ELF32_R_TYPE (rel->r_info) != R_SH_REL32
+ && (r_type != R_SH_REL32
|| (h != NULL
&& (! info->symbolic
|| h->root.type == bfd_link_hash_defweak
@@ -5710,11 +6598,110 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
}
p->count += 1;
- if (ELF32_R_TYPE (rel->r_info) == R_SH_REL32)
+ if (r_type == R_SH_REL32)
p->pc_count += 1;
}
break;
+
+ case R_SH_TLS_LE_32:
+ if (info->shared)
+ {
+ (*_bfd_error_handler) (_("%s: TLS local exec code cannot be linked into shared objects"),
+ bfd_archive_filename (abfd));
+ return false;
+ }
+
+ if (ELF32_R_TYPE (rel->r_info) == R_SH_TLS_LD_32)
+ break;
+
+ /* FALLTHROUGH */
+ case R_SH_TLS_LDO_32:
+ /* We make a R_SH_TLS_TPOFF32 relocation. Count it as a
+ copy relocation. */
+ if (! info->shared)
+ {
+ struct elf_sh_dyn_relocs *p;
+ struct elf_sh_dyn_relocs **head;
+
+ if (dynobj == NULL)
+ htab->root.dynobj = dynobj = abfd;
+
+ if (sreloc == NULL)
+ {
+ const char *name;
+
+ name = (bfd_elf_string_from_elf_section
+ (abfd,
+ elf_elfheader (abfd)->e_shstrndx,
+ elf_section_data (sec)->rel_hdr.sh_name));
+ if (name == NULL)
+ return false;
+
+ BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+ && strcmp (bfd_get_section_name (abfd, sec),
+ name + 5) == 0);
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ if (sreloc == NULL)
+ {
+ flagword flags;
+
+ sreloc = bfd_make_section (dynobj, name);
+ flags = (SEC_HAS_CONTENTS | SEC_READONLY
+ | SEC_IN_MEMORY | SEC_LINKER_CREATED);
+ if ((sec->flags & SEC_ALLOC) != 0)
+ flags |= SEC_ALLOC | SEC_LOAD;
+ if (sreloc == NULL
+ || ! bfd_set_section_flags (dynobj, sreloc, flags)
+ || ! bfd_set_section_alignment (dynobj, sreloc, 2))
+ return false;
+ }
+ elf_section_data (sec)->sreloc = sreloc;
+ if (sec->flags & SEC_READONLY)
+ info->flags |= DF_TEXTREL;
+ }
+
+ /* If this is a global symbol, we count the number of
+ relocations we need for this symbol. */
+ if (h != NULL)
+ head = &((struct elf_sh_link_hash_entry *) h)->dyn_relocs;
+ else
+ {
+ asection *s;
+
+ /* Track dynamic relocs needed for local syms too. */
+ s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
+ sec, r_symndx);
+ if (s == NULL)
+ return false;
+
+ head = ((struct elf_sh_dyn_relocs **)
+ &elf_section_data (s)->local_dynrel);
+ }
+
+ p = *head;
+ if (p == NULL || p->sec != sec)
+ {
+ bfd_size_type amt = sizeof (*p);
+ p = ((struct elf_sh_dyn_relocs *) bfd_alloc (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 (h)
+ sh_elf_hash_entry (h)->tls_tpoff32 = true;
+ }
+ break;
+
+ default:
+ break;
}
}
@@ -5835,6 +6822,29 @@ sh_elf_merge_private_data (ibfd, obfd)
}
#endif /* not sh_elf_merge_private_data */
+/* Override the generic function because we need to store sh_elf_obj_tdata
+ as the specific tdata. We set also the machine architecture from flags
+ here. */
+
+static boolean
+sh_elf_object_p (abfd)
+ bfd *abfd;
+{
+ struct sh_elf_obj_tdata *new_tdata;
+ bfd_size_type amt = sizeof (struct sh_elf_obj_tdata);
+
+ if (sh_elf_set_mach_from_flags (abfd) == false)
+ return false;
+
+ /* Allocate our special target data. */
+ 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;
+}
+
/* Finish up dynamic symbol handling. We set the contents of various
dynamic sections here. */
@@ -5991,7 +7001,9 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
}
}
- if (h->got.offset != (bfd_vma) -1)
+ if (h->got.offset != (bfd_vma) -1
+ && sh_elf_hash_entry (h)->tls_type != GOT_TLS_GD
+ && sh_elf_hash_entry (h)->tls_type != GOT_TLS_IE)
{
asection *sgot;
asection *srel;
@@ -6037,6 +7049,60 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
++srel->reloc_count;
}
+#ifdef INCLUDE_SHMEDIA
+ {
+ struct elf_sh_link_hash_entry *eh;
+
+ eh = (struct elf_sh_link_hash_entry *) h;
+ if (eh->datalabel_got.offset != (bfd_vma) -1)
+ {
+ asection *sgot;
+ asection *srel;
+ Elf_Internal_Rela rel;
+
+ /* This symbol has a datalabel entry in the global offset table.
+ Set it up. */
+
+ sgot = htab->sgot;
+ srel = htab->srelgot;
+ BFD_ASSERT (sgot != NULL && srel != NULL);
+
+ rel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + (eh->datalabel_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))
+ {
+ rel.r_info = ELF32_R_INFO (0, R_SH_RELATIVE);
+ rel.r_addend = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
+ else
+ {
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents
+ + eh->datalabel_got.offset);
+ rel.r_info = ELF32_R_INFO (h->dynindx, R_SH_GLOB_DAT);
+ rel.r_addend = 0;
+ }
+
+ bfd_elf32_swap_reloca_out (output_bfd, &rel,
+ ((Elf32_External_Rela *) srel->contents
+ + srel->reloc_count));
+ ++srel->reloc_count;
+ }
+ }
+#endif
+
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{
asection *s;
@@ -6262,7 +7328,71 @@ sh_elf_reloc_type_class (rela)
}
}
-#ifndef ELF_ARCH
+/* Support for Linux core dump NOTE sections */
+static boolean
+elf32_shlin_grok_prstatus (abfd, note)
+ bfd *abfd;
+ Elf_Internal_Note *note;
+{
+ int offset;
+ unsigned int raw_size;
+
+ switch (note->descsz)
+ {
+ default:
+ return false;
+
+ case 168: /* Linux/SH */
+ /* 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 = 92;
+
+ break;
+ }
+
+ /* Make a ".reg/999" section. */
+ return _bfd_elfcore_make_pseudosection (abfd, ".reg",
+ raw_size, note->descpos + offset);
+}
+
+static boolean
+elf32_shlin_grok_psinfo (abfd, note)
+ bfd *abfd;
+ Elf_Internal_Note *note;
+{
+ switch (note->descsz)
+ {
+ default:
+ return false;
+
+ case 124: /* Linux/SH elf_prpsinfo */
+ elf_tdata (abfd)->core_program
+ = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
+ elf_tdata (abfd)->core_command
+ = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
+ }
+
+ /* Note that for some reason, a spurious space is tacked
+ onto the end of the args in some (at least one anyway)
+ implementations, so strip it off if it exists. */
+
+ {
+ char *command = elf_tdata (abfd)->core_command;
+ int n = strlen (command);
+
+ if (0 < n && command[n - 1] == ' ')
+ command[n - 1] = '\0';
+ }
+
+ return true;
+}
+
#define TARGET_BIG_SYM bfd_elf32_sh_vec
#define TARGET_BIG_NAME "elf32-sh"
#define TARGET_LITTLE_SYM bfd_elf32_shl_vec
@@ -6272,7 +7402,6 @@ sh_elf_reloc_type_class (rela)
#define ELF_MAXPAGESIZE 128
#define elf_symbol_leading_char '_'
-#endif /* ELF_ARCH */
#define bfd_elf32_bfd_reloc_type_lookup sh_elf_reloc_type_lookup
#define elf_info_to_howto sh_elf_info_to_howto
@@ -6280,7 +7409,8 @@ sh_elf_reloc_type_class (rela)
#define elf_backend_relocate_section sh_elf_relocate_section
#define bfd_elf32_bfd_get_relocated_section_contents \
sh_elf_get_relocated_section_contents
-#define elf_backend_object_p sh_elf_set_mach_from_flags
+#define bfd_elf32_mkobject sh_elf_mkobject
+#define elf_backend_object_p sh_elf_object_p
#define bfd_elf32_bfd_set_private_bfd_flags \
sh_elf_set_private_flags
#define bfd_elf32_bfd_copy_private_bfd_data \
@@ -6315,7 +7445,51 @@ sh_elf_reloc_type_class (rela)
#define elf_backend_got_header_size 12
#define elf_backend_plt_header_size PLT_ENTRY_SIZE
-#ifndef ELF32_SH_C_INCLUDED
+#ifndef INCLUDE_SHMEDIA
+
#include "elf32-target.h"
-#endif
+/* NetBSD support. */
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM bfd_elf32_shnbsd_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf32-sh-nbsd"
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM bfd_elf32_shlnbsd_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf32-shl-nbsd"
+#undef ELF_MAXPAGESIZE
+#define ELF_MAXPAGESIZE 0x10000
+#undef elf_symbol_leading_char
+#define elf_symbol_leading_char 0
+
+#define elf32_bed elf32_sh_nbsd_bed
+
+#include "elf32-target.h"
+
+#undef elf32_bed
+
+/* Linux support. */
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM bfd_elf32_shblin_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf32-shbig-linux"
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM bfd_elf32_shlin_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf32-sh-linux"
+
+#undef elf_backend_grok_prstatus
+#define elf_backend_grok_prstatus elf32_shlin_grok_prstatus
+#undef elf_backend_grok_psinfo
+#define elf_backend_grok_psinfo elf32_shlin_grok_psinfo
+
+#define elf32_bed elf32_sh_lin_bed
+
+#include "elf32-target.h"
+
+#undef elf_backend_grok_prstatus
+#undef elf_backend_grok_psinfo
+#undef elf32_bed
+
+#endif /* INCLUDE_SHMEDIA */
diff --git a/bfd/elf32-sh64-com.c b/bfd/elf32-sh64-com.c
index ae2cab4e690..df0c463e263 100644
--- a/bfd/elf32-sh64-com.c
+++ b/bfd/elf32-sh64-com.c
@@ -127,7 +127,7 @@ sh64_address_in_cranges (cranges, addr, rangep)
else
{
cranges_contents
- = bfd_malloc (cranges->_cooked_size == 0
+ = bfd_malloc (cranges->_cooked_size != 0
? cranges->_cooked_size : cranges->_raw_size);
if (cranges_contents == NULL)
return false;
diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c
index 7a38fb22410..c0df73d4d82 100644
--- a/bfd/elf32-sh64.c
+++ b/bfd/elf32-sh64.c
@@ -89,18 +89,6 @@ static void sh64_find_section_for_address PARAMS ((bfd *, asection *, PTR));
define it true here. */
#define _bfd_sh_align_load_span(a,b,c,d,e,f,g,h,i,j) true
-#ifndef ELF_ARCH
-#define TARGET_BIG_SYM bfd_elf32_sh64_vec
-#define TARGET_BIG_NAME "elf32-sh64"
-#define TARGET_LITTLE_SYM bfd_elf32_sh64l_vec
-#define TARGET_LITTLE_NAME "elf32-sh64l"
-#define ELF_ARCH bfd_arch_sh
-#define ELF_MACHINE_CODE EM_SH
-#define ELF_MAXPAGESIZE 128
-
-#define elf_symbol_leading_char '_'
-#endif /* ELF_ARCH */
-
#define GOT_BIAS (-((long)-32768))
#define INCLUDE_SHMEDIA
#include "elf32-sh.c"
@@ -411,16 +399,19 @@ sh64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
if (h == NULL)
{
/* No previous datalabel symbol. Make one. */
+ struct bfd_link_hash_entry *bh = NULL;
+ struct elf_backend_data *bed = get_elf_backend_data (abfd);
+
if (! _bfd_generic_link_add_one_symbol (info, abfd, dl_name,
flags, *secp, *valp,
*namep, false,
- get_elf_backend_data (abfd)->collect,
- (struct bfd_link_hash_entry **) &h))
+ bed->collect, &bh))
{
free (dl_name);
return false;
}
+ h = (struct elf_link_hash_entry *) bh;
h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
h->type = STT_DATALABEL;
}
@@ -742,3 +733,50 @@ sh64_elf_final_write_processing (abfd, linker)
}
}
}
+
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM bfd_elf32_sh64_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf32-sh64"
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM bfd_elf32_sh64l_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf32-sh64l"
+
+#include "elf32-target.h"
+
+/* NetBSD support. */
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM bfd_elf32_sh64nbsd_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf32-sh64-nbsd"
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM bfd_elf32_sh64lnbsd_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf32-sh64l-nbsd"
+#undef ELF_MAXPAGESIZE
+#define ELF_MAXPAGESIZE 0x10000
+#undef elf_symbol_leading_char
+#define elf_symbol_leading_char 0
+
+#define elf32_bed elf32_sh64_nbsd_bed
+
+#include "elf32-target.h"
+
+#undef elf32_bed
+
+/* Linux support. */
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM bfd_elf32_sh64blin_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf32-sh64big-linux"
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM bfd_elf32_sh64lin_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf32-sh64-linux"
+
+#define elf32_bed elf32_sh64_lin_bed
+
+#include "elf32-target.h"
+
+#undef elf32_bed
diff --git a/bfd/elf32-shqnx.c b/bfd/elf32-shqnx.c
deleted file mode 100644
index a27c0f20fa3..00000000000
--- a/bfd/elf32-shqnx.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Hitachi SH QNX specific support for 32-bit ELF
- Copyright 2002 Free Software Foundation, Inc.
-
- This file is part of BFD, the Binary File Descriptor library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#define ELF32_SH_C_INCLUDED
-#include "elf32-sh.c"
-
-#include "elf32-qnx.h"
-
-#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_shlqnx_vec
-#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_shqnx_vec
-
-#include "elf32-target.h"
-
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 57ed958b32f..bf92ccf98f3 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -2388,7 +2388,7 @@ v850_elf_relax_delete_bytes (abfd, sec, addr, toaddr, count)
if (isym.st_value + isym.st_size >= toaddr)
isym.st_size += count;
- bfd_elf32_swap_symbol_out (abfd, & isym, shndx, esym);
+ bfd_elf32_swap_symbol_out (abfd, & isym, esym, shndx);
}
else if (isym.st_shndx == sec_shndx
&& isym.st_value < addr + count)
@@ -2401,7 +2401,7 @@ v850_elf_relax_delete_bytes (abfd, sec, addr, toaddr, count)
&& isym.st_value < addr + count)
isym.st_value = addr;
- bfd_elf32_swap_symbol_out (abfd, & isym, shndx, esym);
+ bfd_elf32_swap_symbol_out (abfd, & isym, esym, shndx);
}
}
@@ -2426,7 +2426,7 @@ v850_elf_relax_delete_bytes (abfd, sec, addr, toaddr, count)
if ((sym_hash)->root.u.def.value + isym.st_size >= toaddr)
{
isym.st_size += count;
- bfd_elf32_swap_symbol_out (abfd, & isym, shndx, esym);
+ bfd_elf32_swap_symbol_out (abfd, & isym, esym, shndx);
}
(sym_hash)->root.u.def.value -= count;
@@ -2445,7 +2445,7 @@ v850_elf_relax_delete_bytes (abfd, sec, addr, toaddr, count)
&& (sym_hash)->root.u.def.value < addr + count)
(sym_hash)->root.u.def.value = addr;
- bfd_elf32_swap_symbol_out (abfd, & isym, shndx, esym);
+ bfd_elf32_swap_symbol_out (abfd, & isym, esym, shndx);
}
if (shndx)
diff --git a/bfd/elf64-alpha-fbsd.c b/bfd/elf64-alpha-fbsd.c
deleted file mode 100644
index 061b0b81030..00000000000
--- a/bfd/elf64-alpha-fbsd.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Alpha specific support for 64-bit ELF on FreeBSD.
- Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#define TARGET_LITTLE_SYM bfd_elf64_alpha_freebsd_vec
-#define TARGET_LITTLE_NAME "elf64-alpha-freebsd"
-#define ELF_ARCH bfd_arch_alpha
-#define ELF_MACHINE_CODE EM_ALPHA
-#define ELF_MAXPAGESIZE 0x10000
-
-#include "bfd.h"
-#include "sysdep.h"
-#include "elf-bfd.h"
-
-/* 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_alpha_post_process_headers
- PARAMS ((bfd *, struct bfd_link_info *));
-
-static void
-elf_alpha_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
-}
-
-#define elf_backend_post_process_headers elf_alpha_post_process_headers
-
-#include "elf64-alpha.c"
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index e1d095d5231..ab053f96bfa 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -2480,6 +2480,7 @@ elf64_alpha_create_dynamic_sections (abfd, info)
{
asection *s;
struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *bh;
/* We need to create .plt, .rela.plt, .got, and .rela.got sections. */
@@ -2495,13 +2496,13 @@ elf64_alpha_create_dynamic_sections (abfd, info)
/* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
.plt section. */
- h = NULL;
+ 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,
- (struct bfd_link_hash_entry **) &h)))
+ 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;
@@ -2539,13 +2540,13 @@ elf64_alpha_create_dynamic_sections (abfd, info)
dynobj's .got section. We don't do this in the linker script
because we don't want to define the symbol if we are not creating
a global offset table. */
- h = NULL;
+ bh = NULL;
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,
- (struct bfd_link_hash_entry **) &h)))
+ 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;
@@ -3099,7 +3100,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
case R_ALPHA_REFLONG:
case R_ALPHA_REFQUAD:
- if (info->shared || maybe_dynamic)
+ if ((info->shared && (sec->flags & SEC_ALLOC)) || maybe_dynamic)
need = NEED_DYNREL;
break;
@@ -4576,7 +4577,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
case STO_ALPHA_NOPV:
break;
case STO_ALPHA_STD_GPLOAD:
- addend += 8;
+ value += 8;
break;
default:
if (h != NULL)
@@ -5509,13 +5510,11 @@ static const struct elf_size_info alpha_elf_size_info =
NULL
};
-#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
@@ -5581,3 +5580,42 @@ static const struct elf_size_info alpha_elf_size_info =
#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
+
+#define elf64_bed elf64_alpha_fbsd_bed
+
+#include "elf64-target.h"
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index aef822a02f2..3c8e00f2b4a 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -1855,6 +1855,11 @@ elf64_hppa_size_dynamic_sections (output_bfd, info)
return false;
}
+ /* Force DT_FLAGS to always be set.
+ Required by HPUX 11.00 patch PHSS_26559. */
+ if (!add_dynamic_entry (DT_FLAGS, (info)->flags))
+ return false;
+
if (plt)
{
if (!add_dynamic_entry (DT_PLTRELSZ, 0)
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index bf98c9136c8..f06d0658a7e 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -2073,7 +2073,7 @@ mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, rel_hdr)
rela.r_addend = 0;
}
- /* Each entry represents up to three actual relocations. */
+ /* Each entry represents exactly three actual relocations. */
used_sym = false;
used_ssym = false;
@@ -2096,27 +2096,6 @@ mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, rel_hdr)
break;
}
- if (type == R_MIPS_NONE)
- {
- /* There are no more relocations in this entry. If this
- is the first entry, we need to generate a dummy
- relocation so that the generic linker knows that
- there has been a break in the sequence of relocations
- applying to a particular address. */
- if (ir == 0)
- {
- relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
- if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
- relent->address = rela.r_offset;
- else
- relent->address = rela.r_offset - asect->vma;
- relent->addend = 0;
- relent->howto = &howto_table[(int) R_MIPS_NONE];
- ++relent;
- }
- break;
- }
-
/* Some types require symbols, whereas some do not. */
switch (type)
{
@@ -2194,7 +2173,7 @@ mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, rel_hdr)
}
}
- asect->reloc_count += relent - relents;
+ asect->reloc_count += (relent - relents) / 3;
if (allocated != NULL)
free (allocated);
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index 8b76f34e038..939d12f7b38 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -2170,8 +2170,11 @@ _bfd_mmix_finalize_linker_allocated_gregs (abfd, link_info)
n_gregs = gregdata->n_allocated_bpo_gregs;
+ /* We need to have a _raw_size contents even though there's only
+ _cooked_size worth of data, since the generic relocation machinery
+ will allocate and copy that much temporarily. */
bpo_gregs_section->contents
- = contents = bfd_alloc (bpo_greg_owner, bpo_gregs_section->_cooked_size);
+ = contents = bfd_alloc (bpo_greg_owner, bpo_gregs_section->_raw_size);
if (contents == NULL)
return false;
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 91610aae7e8..384348e957e 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -1658,6 +1658,7 @@ ppc64_elf_merge_private_bfd_data (ibfd, obfd)
{
/* Check if we have the same endianess. */
if (ibfd->xvec->byteorder != obfd->xvec->byteorder
+ && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
&& obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
{
const char *msg;
@@ -1785,19 +1786,19 @@ struct ppc_dyn_relocs
ppc_stub_plt_branch:
Similar to the above, but a 24 bit branch in the stub section won't
reach its destination.
- . addis %r12,%r2,xxx@ha
- . ld %r11,xxx@l(%r12)
+ . addis %r12,%r2,xxx@toc@ha
+ . ld %r11,xxx@toc@l(%r12)
. mtctr %r11
. bctr
ppc_stub_plt_call:
Used to call a function in a shared library.
- . addis %r12,%r2,xxx@ha
+ . addis %r12,%r2,xxx@toc@ha
. std %r2,40(%r1)
- . ld %r11,xxx+0@l(%r12)
- . ld %r2,xxx+8@l(%r12)
+ . ld %r11,xxx+0@toc@l(%r12)
+ . ld %r2,xxx+8@toc@l(%r12)
. mtctr %r11
- . ld %r11,xxx+16@l(%r12)
+ . ld %r11,xxx+16@toc@l(%r12)
. bctr
*/
@@ -1971,8 +1972,6 @@ 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
@@ -3166,6 +3165,7 @@ func_desc_adjust (h, inf)
{
bfd *abfd;
asymbol *newsym;
+ struct bfd_link_hash_entry *bh;
abfd = h->root.u.undef.abfd;
newsym = bfd_make_empty_symbol (abfd);
@@ -3176,13 +3176,14 @@ func_desc_adjust (h, inf)
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,
- (struct bfd_link_hash_entry **) &fdh)))
+ 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;
}
@@ -3536,8 +3537,8 @@ ppc64_elf_hide_symbol (info, h, force_local)
}
}
-static boolean
-edit_opd (obfd, info)
+boolean
+ppc64_elf_edit_opd (obfd, info)
bfd *obfd;
struct bfd_link_info *info;
{
@@ -3554,6 +3555,7 @@ 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;
@@ -3561,9 +3563,16 @@ edit_opd (obfd, info)
if (sec == NULL)
continue;
+ amt = sec->_raw_size * sizeof (long) / 24;
adjust = (long *) elf_section_data (sec)->tdata;
- BFD_ASSERT (adjust != NULL);
- memset (adjust, 0, (size_t) sec->_raw_size * sizeof (long) / 24);
+ if (adjust == NULL)
+ {
+ /* Must be a ld -r link. ie. check_relocs hasn't been
+ called. */
+ adjust = (long *) bfd_zalloc (obfd, amt);
+ elf_section_data (sec)->tdata = adjust;
+ }
+ memset (adjust, 0, (size_t) amt);
if (sec->output_section == bfd_abs_section_ptr)
continue;
@@ -3675,12 +3684,16 @@ edit_opd (obfd, info)
break;
}
- if (sym_sec->output_section == bfd_abs_section_ptr)
- {
- /* OK, we've found a function that's excluded from the
- link. */
- need_edit = true;
- }
+ /* opd entries are always for functions defined in the
+ current input bfd. If the symbol isn't defined in the
+ input bfd, then we won't be using the function in this
+ bfd; It must be defined in a linkonce section in another
+ bfd, or is weak. It's also possible that we are
+ discarding the function due to a linker script /DISCARD/,
+ which we test for via the output_section. */
+ if (sym_sec->owner != ibfd
+ || sym_sec->output_section == bfd_abs_section_ptr)
+ need_edit = true;
offset += 24;
}
@@ -3754,21 +3767,37 @@ edit_opd (obfd, info)
sym->st_shndx);
}
- skip = sym_sec->output_section == bfd_abs_section_ptr;
+ skip = (sym_sec->owner != ibfd
+ || sym_sec->output_section == bfd_abs_section_ptr);
if (skip)
{
- if (h != NULL)
+ if (h != NULL && sym_sec->owner == ibfd)
{
/* Arrange for the function descriptor sym
to be dropped. */
- struct elf_link_hash_entry *fdh;
+ struct ppc_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 = (struct ppc_link_hash_entry *) fh->oh;
+ if (fdh == NULL)
+ {
+ const char *fd_name;
+ struct ppc_link_hash_table *htab;
+
+ fd_name = h->root.root.string + 1;
+ htab = ppc_hash_table (info);
+ fdh = (struct ppc_link_hash_entry *)
+ elf_link_hash_lookup (&htab->elf, fd_name,
+ false, false, false);
+ fdh->is_func_descriptor = 1;
+ fdh->oh = &fh->elf;
+ fh->is_func = 1;
+ fh->oh = &fdh->elf;
+ }
+
+ fdh->elf.root.u.def.value = 0;
+ fdh->elf.root.u.def.section = sym_sec;
}
}
else
@@ -3781,13 +3810,28 @@ edit_opd (obfd, info)
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 *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;
+ fdh = (struct ppc_link_hash_entry *) fh->oh;
+ if (fdh == NULL)
+ {
+ const char *fd_name;
+ struct ppc_link_hash_table *htab;
+
+ fd_name = h->root.root.string + 1;
+ htab = ppc_hash_table (info);
+ fdh = (struct ppc_link_hash_entry *)
+ elf_link_hash_lookup (&htab->elf, fd_name,
+ false, false, false);
+ fdh->is_func_descriptor = 1;
+ fdh->oh = &fh->elf;
+ fh->is_func = 1;
+ fh->oh = &fdh->elf;
+ }
+
+ fdh->elf.root.u.def.value = wptr - sec->contents;
}
else
{
@@ -3797,8 +3841,7 @@ edit_opd (obfd, info)
for the function descriptor sym which we
don't have at the moment. So keep an
array of adjustments. */
- adjust[(rel->r_offset + wptr - rptr) / 24]
- = wptr - rptr;
+ adjust[rel->r_offset / 24] = wptr - rptr;
}
if (wptr != rptr)
@@ -4138,9 +4181,6 @@ ppc64_elf_size_dynamic_sections (output_bfd, info)
}
}
- 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);
@@ -5161,6 +5201,7 @@ ppc64_elf_build_stubs (info)
}
bfd_put_32 (htab->sglink->owner,
B_DOT | ((htab->sglink->contents - p) & 0x3fffffc), p);
+ indx++;
p += 4;
}
htab->sglink->_cooked_size = p - htab->sglink->contents;
diff --git a/bfd/elf64-ppc.h b/bfd/elf64-ppc.h
index cabc38816f0..21178d556d7 100644
--- a/bfd/elf64-ppc.h
+++ b/bfd/elf64-ppc.h
@@ -19,6 +19,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
boolean ppc64_elf_mark_entry_syms
PARAMS ((struct bfd_link_info *));
+boolean ppc64_elf_edit_opd
+ PARAMS ((bfd *, struct bfd_link_info *));
bfd_vma ppc64_elf_toc
PARAMS ((bfd *));
int ppc64_elf_setup_section_lists
diff --git a/bfd/elf64-sh64-nbsd.c b/bfd/elf64-sh64-nbsd.c
deleted file mode 100644
index 43e4eaf42ed..00000000000
--- a/bfd/elf64-sh64-nbsd.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* SuperH SH64 specific support for 64-bit NetBSD
- Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#define TARGET_BIG_SYM bfd_elf64_sh64nbsd_vec
-#define TARGET_BIG_NAME "elf64-sh64-nbsd"
-#define TARGET_LITTLE_SYM bfd_elf64_sh64lnbsd_vec
-#define TARGET_LITTLE_NAME "elf64-sh64l-nbsd"
-#define ELF_ARCH bfd_arch_sh
-#define ELF_MACHINE_CODE EM_SH
-#define ELF_MAXPAGESIZE 0x10000
-#define elf_symbol_leading_char 0
-
-#include "elf64-sh64.c"
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index 4fb695f1011..da02505d5c5 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -1588,6 +1588,35 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section,
continue;
}
+ else if (! howto->partial_inplace)
+ {
+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
+ relocation |= ((sym->st_other & STO_SH5_ISA32) != 0);
+ }
+ else if ((sec->flags & SEC_MERGE)
+ && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ {
+ asection *msec;
+
+ if (howto->rightshift || howto->src_mask != 0xffffffff)
+ {
+ (*_bfd_error_handler)
+ (_("%s(%s+0x%lx): %s relocation against SEC_MERGE section"),
+ bfd_archive_filename (input_bfd),
+ bfd_get_section_name (input_bfd, input_section),
+ (long) rel->r_offset, howto->name);
+ return false;
+ }
+
+ addend = bfd_get_32 (input_bfd, contents + rel->r_offset);
+ msec = sec;
+ addend =
+ _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend)
+ - relocation;
+ addend += msec->output_section->vma + msec->output_offset;
+ bfd_put_32 (input_bfd, addend, contents + rel->r_offset);
+ addend = 0;
+ }
}
else
{
@@ -2915,16 +2944,19 @@ sh64_elf64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
if (h == NULL)
{
/* No previous datalabel symbol. Make one. */
+ struct bfd_link_hash_entry *bh = NULL;
+ struct elf_backend_data *bed = get_elf_backend_data (abfd);
+
if (! _bfd_generic_link_add_one_symbol (info, abfd, dl_name,
flags, *secp, *valp,
*namep, false,
- get_elf_backend_data (abfd)->collect,
- (struct bfd_link_hash_entry **) &h))
+ bed->collect, &bh))
{
free (dl_name);
return false;
}
+ h = (struct elf_link_hash_entry *) bh;
h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
h->type = STT_DATALABEL;
}
@@ -3108,7 +3140,7 @@ static const bfd_byte elf_sh64_pic_plt_entry_be[PLT_ENTRY_SIZE] =
0x6f, 0xf0, 0xff, 0xf0, /* nop */
0x6f, 0xf0, 0xff, 0xf0, /* nop */
0xce, 0x00, 0x01, 0x10, /* movi -GOT_BIAS, r17 */
- 0x00, 0xcb, 0x45, 0x10, /* sub r12, r17, r17 */
+ 0x00, 0xc9, 0x45, 0x10, /* add r12, r17, r17 */
0x8d, 0x10, 0x09, 0x90, /* ld.q r17, 16, r25 */
0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */
0x8d, 0x10, 0x05, 0x10, /* ld.q r17, 8, r17 */
@@ -3128,7 +3160,7 @@ static const bfd_byte elf_sh64_pic_plt_entry_le[PLT_ENTRY_SIZE] =
0xf0, 0xff, 0xf0, 0x6f, /* nop */
0xf0, 0xff, 0xf0, 0x6f, /* nop */
0x10, 0x01, 0x00, 0xce, /* movi -GOT_BIAS, r17 */
- 0x10, 0x45, 0xcb, 0x00, /* sub r12, r17, r17 */
+ 0x10, 0x45, 0xc9, 0x00, /* add r12, r17, r17 */
0x90, 0x09, 0x10, 0x8d, /* ld.q r17, 16, r25 */
0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */
0x10, 0x05, 0x10, 0x8d, /* ld.q r17, 8, r17 */
@@ -3287,13 +3319,15 @@ sh64_elf64_create_dynamic_sections (abfd, info)
{
/* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
.plt section. */
- struct elf_link_hash_entry *h = NULL;
+ struct elf_link_hash_entry *h;
+ 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,
- (struct bfd_link_hash_entry **) &h)))
+ (bfd_vma) 0, (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;
@@ -4124,8 +4158,6 @@ sh64_elf64_finish_dynamic_sections (output_bfd, info)
return true;
}
-
-#ifndef ELF_ARCH
#define TARGET_BIG_SYM bfd_elf64_sh64_vec
#define TARGET_BIG_NAME "elf64-sh64"
#define TARGET_LITTLE_SYM bfd_elf64_sh64l_vec
@@ -4135,7 +4167,6 @@ sh64_elf64_finish_dynamic_sections (output_bfd, info)
#define ELF_MAXPAGESIZE 128
#define elf_symbol_leading_char '_'
-#endif /* ELF_ARCH */
#define bfd_elf64_bfd_reloc_type_lookup sh_elf64_reloc_type_lookup
#define elf_info_to_howto sh_elf64_info_to_howto
@@ -4190,3 +4221,34 @@ sh64_elf64_finish_dynamic_sections (output_bfd, info)
#define elf_backend_plt_header_size PLT_ENTRY_SIZE
#include "elf64-target.h"
+
+/* NetBSD support. */
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM bfd_elf64_sh64nbsd_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf64-sh64-nbsd"
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM bfd_elf64_sh64lnbsd_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf64-sh64l-nbsd"
+#undef ELF_MAXPAGESIZE
+#define ELF_MAXPAGESIZE 0x10000
+#undef elf_symbol_leading_char
+#define elf_symbol_leading_char 0
+
+#define elf64_bed elf64_sh64_nbsd_bed
+
+#include "elf64-target.h"
+
+/* Linux support. */
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM bfd_elf64_sh64blin_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf64-sh64big-linux"
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM bfd_elf64_sh64lin_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf64-sh64-linux"
+
+#define INCLUDED_TARGET_FILE
+#include "elf64-target.h"
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index f79d76c30bd..ae4e57a2266 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -1563,6 +1563,9 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
if (s->_raw_size == 0)
s->_raw_size = PLT_HEADER_SIZE;
+ /* To simplify matters later, just store the plt index here. */
+ h->plt.offset = 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
@@ -1572,12 +1575,9 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
&& (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->root.u.def.value = sparc64_elf_plt_entry_offset (h->plt.offset);
}
- /* To simplify matters later, just store the plt index here. */
- h->plt.offset = s->_raw_size / PLT_ENTRY_SIZE;
-
/* Make room for this entry. */
s->_raw_size += PLT_ENTRY_SIZE;
@@ -2164,11 +2164,9 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
+ outrel.r_addend = relocation + rel->r_addend;
if (r_type == R_SPARC_64)
- {
- outrel.r_info = ELF64_R_INFO (0, R_SPARC_RELATIVE);
- outrel.r_addend = relocation + rel->r_addend;
- }
+ outrel.r_info = ELF64_R_INFO (0, R_SPARC_RELATIVE);
else
{
long indx;
@@ -2198,6 +2196,13 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
osec = sec->output_section;
indx = elf_section_data (osec)->dynindx;
+ /* We are turning this relocation into one
+ against a section symbol, so subtract out
+ the output section's address but not the
+ offset of the input section in the output
+ section. */
+ outrel.r_addend -= osec->vma;
+
/* FIXME: we really should be able to link non-pic
shared libraries. */
if (indx == 0)
@@ -2216,7 +2221,6 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
ELF64_R_TYPE_INFO (
ELF64_R_TYPE_DATA (rel->r_info),
r_type));
- outrel.r_addend = relocation + rel->r_addend;
}
}
@@ -2580,11 +2584,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. */
+ overflows for discarded entries. */
if (r_type == R_SPARC_32
- && (input_section->flags & SEC_DEBUGGING) != 0
- && strcmp (bfd_section_name (input_bfd, input_section),
- ".stab") == 0)
+ && _bfd_elf_section_offset (output_bfd, info, input_section,
+ rel->r_offset) == (bfd_vma) -1)
break;
if (h != NULL)
diff --git a/bfd/elfarm-nabi.c b/bfd/elfarm-nabi.c
index 1c07dc8ca60..dcf6808226d 100644
--- a/bfd/elfarm-nabi.c
+++ b/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"
@@ -749,6 +749,4 @@ elf32_arm_nabi_grok_psinfo (abfd, note)
#define elf_backend_grok_prstatus elf32_arm_nabi_grok_prstatus
#define elf_backend_grok_psinfo elf32_arm_nabi_grok_psinfo
-#ifndef ELFARM_NABI_C_INCLUDED
#include "elf32-arm.h"
-#endif
diff --git a/bfd/elfarmqnx-nabi.c b/bfd/elfarmqnx-nabi.c
deleted file mode 100644
index 7647b3da730..00000000000
--- a/bfd/elfarmqnx-nabi.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* ARM new abi QNX specific support for 32-bit ELF
- Copyright 2002 Free Software Foundation, Inc.
-
- This file is part of BFD, the Binary File Descriptor library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#define ELFARM_NABI_C_INCLUDED
-#include "elfarm-nabi.c"
-
-#include "elf32-qnx.h"
-
-#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_littlearmqnx_vec
-#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_bigarmqnx_vec
-
-/* QNX Neutrino for ARM has a max pagesize of 0x1000. */
-#undef ELF_MAXPAGESIZE
-#define ELF_MAXPAGESIZE 0x1000
-
-#include "elf32-arm.h"
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 4f54cd35ccc..f523972fab4 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -505,16 +505,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.
@@ -536,11 +526,10 @@ elf_object_p (abfd)
char *shstrtab; /* Internal copy of section header stringtab */
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. */
@@ -584,24 +573,14 @@ elf_object_p (abfd)
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)
+ preserve.marker = bfd_zalloc (abfd, amt);
+ if (preserve.marker == 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 (!bfd_preserve_save (abfd, &preserve))
goto got_no_match;
+ elf_tdata (abfd) = preserve.marker;
+
/* Now that we know the byte order, swap in the rest of the header */
i_ehdrp = elf_elfheader (abfd);
elf_swap_ehdr_in (abfd, &x_ehdr, i_ehdrp);
@@ -633,8 +612,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;
@@ -844,11 +825,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 +841,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;
}
diff --git a/bfd/elfcore.h b/bfd/elfcore.h
index 7db5f72e333..264ff554fe2 100644
--- a/bfd/elfcore.h
+++ b/bfd/elfcore.h
@@ -85,18 +85,18 @@ elf_core_file_p (abfd)
unsigned int phindex;
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_get_error () != bfd_error_system_call)
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
+ goto wrong;
+ else
+ goto fail;
}
/* Check the magic number. */
@@ -126,24 +126,14 @@ elf_core_file_p (abfd)
/* 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))
+ preserve.marker = bfd_zalloc (abfd, amt);
+ if (preserve.marker == NULL)
+ goto fail;
+ if (!bfd_preserve_save (abfd, &preserve))
goto fail;
+ elf_tdata (abfd) = preserve.marker;
+
/* Swap in the rest of the header, now that we have the byte order. */
i_ehdrp = elf_elfheader (abfd);
elf_swap_ehdr_in (abfd, &x_ehdr, i_ehdrp);
@@ -248,7 +238,7 @@ elf_core_file_p (abfd)
goto wrong;
}
- bfd_hash_table_free (&preserve.section_htab);
+ bfd_preserve_finish (abfd, &preserve);
return abfd->xvec;
wrong:
@@ -264,17 +254,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/bfd/elflink.c b/bfd/elflink.c
index f8cc645ad76..d6da588a153 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -33,6 +33,7 @@ _bfd_elf_create_got_section (abfd, info)
flagword flags;
register asection *s;
struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *bh;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
int ptralign;
@@ -79,12 +80,13 @@ _bfd_elf_create_got_section (abfd, info)
(or .got.plt) section. We don't do this in the linker script
because we don't want to define the symbol if we are not creating
a global offset table. */
- h = NULL;
+ 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, (struct bfd_link_hash_entry **) &h)))
+ 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;
@@ -151,13 +153,15 @@ _bfd_elf_create_dynamic_sections (abfd, info)
{
/* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
.plt section. */
- struct elf_link_hash_entry *h = NULL;
+ struct elf_link_hash_entry *h;
+ 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,
- (struct bfd_link_hash_entry **) &h)))
+ 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;
@@ -546,29 +550,27 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults)
if (lsect->sym_name)
{
- struct elf_link_hash_entry *h = NULL;
+ struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *bh;
+
#ifdef DEBUG
fprintf (stderr, "Adding %s to section %s\n",
lsect->sym_name,
lsect->name);
#endif
- h = (struct elf_link_hash_entry *)
- bfd_link_hash_lookup (info->hash, lsect->sym_name, false, false, false);
-
- if ((h == NULL || h->root.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,
- (struct bfd_link_hash_entry **) &h)))
- return (elf_linker_section_t *)0;
+ bh = bfd_link_hash_lookup (info->hash, lsect->sym_name,
+ false, false, false);
+
+ 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;
if ((defaults->which != LINKER_SECTION_SDATA)
&& (defaults->which != LINKER_SECTION_SDATA2))
@@ -579,7 +581,7 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults)
if (info->shared
&& ! _bfd_elf_link_record_dynamic_symbol (info, h))
- return (elf_linker_section_t *)0;
+ return (elf_linker_section_t *) 0;
}
}
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 85160e90257..721b361ee31 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -921,6 +921,7 @@ elf_add_default_symbol (abfd, info, h, name, sym, psec, value,
boolean size_change_ok;
char *shortname;
struct elf_link_hash_entry *hi;
+ struct bfd_link_hash_entry *bh;
struct elf_backend_data *bed;
boolean collect;
boolean dynamic;
@@ -979,11 +980,12 @@ elf_add_default_symbol (abfd, info, h, name, sym, psec, value,
if (! override)
{
+ bh = &hi->root;
if (! (_bfd_generic_link_add_one_symbol
(info, abfd, shortname, BSF_INDIRECT, bfd_ind_section_ptr,
- (bfd_vma) 0, name, false, collect,
- (struct bfd_link_hash_entry **) &hi)))
+ (bfd_vma) 0, name, false, collect, &bh)))
return false;
+ hi = (struct elf_link_hash_entry *) bh;
}
else
{
@@ -1098,11 +1100,12 @@ elf_add_default_symbol (abfd, info, h, name, sym, psec, value,
}
else
{
+ bh = &hi->root;
if (! (_bfd_generic_link_add_one_symbol
(info, abfd, shortname, BSF_INDIRECT,
- bfd_ind_section_ptr, (bfd_vma) 0, name, false,
- collect, (struct bfd_link_hash_entry **) &hi)))
+ bfd_ind_section_ptr, (bfd_vma) 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
@@ -1295,6 +1298,14 @@ elf_link_add_object_symbols (abfd, info)
const char *name;
bfd_size_type oldsize;
bfd_size_type strindex;
+ struct bfd_link_needed_list *rpath = NULL, *runpath = NULL;
+
+ /* 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
+ && elf_section_data (s)->sec_info_type == ELF_INFO_TYPE_JUST_SYMS)
+ 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.
@@ -1324,8 +1335,6 @@ elf_link_add_object_symbols (abfd, info)
Elf_External_Dyn *extdynend;
int elfsec;
unsigned long shlink;
- int rpath;
- int runpath;
dynbuf = (Elf_External_Dyn *) bfd_malloc (s->_raw_size);
if (dynbuf == NULL)
@@ -1342,8 +1351,6 @@ elf_link_add_object_symbols (abfd, info)
extdyn = dynbuf;
extdynend = extdyn + s->_raw_size / sizeof (Elf_External_Dyn);
- rpath = 0;
- runpath = 0;
for (; extdyn < extdynend; extdyn++)
{
Elf_Internal_Dyn dyn;
@@ -1387,13 +1394,6 @@ elf_link_add_object_symbols (abfd, info)
char *fnm, *anm;
unsigned int tagv = dyn.d_un.d_val;
- /* When we see DT_RPATH before DT_RUNPATH, we have
- to clear runpath. Do _NOT_ bfd_release, as that
- frees all more recently bfd_alloc'd blocks as
- well. */
- if (rpath && hash_table->runpath)
- hash_table->runpath = NULL;
-
amt = sizeof (struct bfd_link_needed_list);
n = (struct bfd_link_needed_list *) bfd_alloc (abfd, amt);
fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv);
@@ -1407,13 +1407,11 @@ elf_link_add_object_symbols (abfd, info)
n->name = anm;
n->by = abfd;
n->next = NULL;
- for (pn = & hash_table->runpath;
+ for (pn = & runpath;
*pn != NULL;
pn = &(*pn)->next)
;
*pn = n;
- runpath = 1;
- rpath = 0;
}
/* Ignore DT_RPATH if we have seen DT_RUNPATH. */
if (!runpath && dyn.d_tag == DT_RPATH)
@@ -1439,18 +1437,32 @@ elf_link_add_object_symbols (abfd, info)
n->name = anm;
n->by = abfd;
n->next = NULL;
- for (pn = & hash_table->runpath;
+ for (pn = & rpath;
*pn != NULL;
pn = &(*pn)->next)
;
*pn = n;
- rpath = 1;
}
}
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
@@ -2196,10 +2208,9 @@ elf_link_add_object_symbols (abfd, info)
}
}
- /* If this is a non-traditional, non-relocateable link, try to
- optimize the handling of the .stab/.stabstr sections. */
+ /* If this is a non-traditional link, try to optimize the handling
+ of the .stab/.stabstr sections. */
if (! dynamic
- && ! info->relocateable
&& ! info->traditional_format
&& info->hash->creator->flavour == bfd_target_elf_flavour
&& is_elf_hash_table (info)
@@ -2292,6 +2303,7 @@ elf_link_create_dynamic_sections (abfd, info)
flagword flags;
register asection *s;
struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *bh;
struct elf_backend_data *bed;
if (! is_elf_hash_table (info))
@@ -2329,6 +2341,7 @@ elf_link_create_dynamic_sections (abfd, info)
|| ! 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;
}
/* Create sections to hold version informations. These are removed
@@ -2384,12 +2397,12 @@ elf_link_create_dynamic_sections (abfd, info)
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. */
- h = NULL;
+ bh = NULL;
if (! (_bfd_generic_link_add_one_symbol
(info, abfd, "_DYNAMIC", BSF_GLOBAL, s, (bfd_vma) 0,
- (const char *) NULL, false, get_elf_backend_data (abfd)->collect,
- (struct bfd_link_hash_entry **) &h)))
+ (const char *) 0, 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;
@@ -3326,19 +3339,20 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
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. */
- h = NULL;
+ bh = NULL;
if (! (_bfd_generic_link_add_one_symbol
(info, dynobj, t->name, BSF_GLOBAL, bfd_abs_section_ptr,
(bfd_vma) 0, (const char *) NULL, false,
- get_elf_backend_data (dynobj)->collect,
- (struct bfd_link_hash_entry **) &h)))
+ 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;
@@ -4480,6 +4494,8 @@ struct elf_final_link_info
size_t symbuf_count;
/* Number of symbols which fit in symbuf. */
size_t symbuf_size;
+ /* And same for symshndxbuf. */
+ size_t shndxbuf_size;
};
static boolean elf_link_output_sym
@@ -4655,8 +4671,9 @@ struct elf_link_sort_rela
enum elf_reloc_type_class type;
union
{
- Elf_Internal_Rel rel;
- Elf_Internal_Rela rela;
+ /* We use these as arrays of size int_rels_per_ext_rel. */
+ Elf_Internal_Rel rel[1];
+ Elf_Internal_Rela rela[1];
} u;
};
@@ -4676,13 +4693,13 @@ elf_link_sort_cmp1 (A, B)
return 1;
if (relativea > relativeb)
return -1;
- if (ELF_R_SYM (a->u.rel.r_info) < ELF_R_SYM (b->u.rel.r_info))
+ if (ELF_R_SYM (a->u.rel->r_info) < ELF_R_SYM (b->u.rel->r_info))
return -1;
- if (ELF_R_SYM (a->u.rel.r_info) > ELF_R_SYM (b->u.rel.r_info))
+ if (ELF_R_SYM (a->u.rel->r_info) > ELF_R_SYM (b->u.rel->r_info))
return 1;
- if (a->u.rel.r_offset < b->u.rel.r_offset)
+ if (a->u.rel->r_offset < b->u.rel->r_offset)
return -1;
- if (a->u.rel.r_offset > b->u.rel.r_offset)
+ if (a->u.rel->r_offset > b->u.rel->r_offset)
return 1;
return 0;
}
@@ -4706,9 +4723,9 @@ elf_link_sort_cmp2 (A, B)
return -1;
if (copya > copyb)
return 1;
- if (a->u.rel.r_offset < b->u.rel.r_offset)
+ if (a->u.rel->r_offset < b->u.rel->r_offset)
return -1;
- if (a->u.rel.r_offset > b->u.rel.r_offset)
+ if (a->u.rel->r_offset > b->u.rel->r_offset)
return 1;
return 0;
}
@@ -4726,6 +4743,7 @@ elf_link_sort_relocs (abfd, info, psec)
size_t i, j, ret;
struct elf_link_sort_rela *rela;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ int i2e = bed->s->int_rels_per_ext_rel;
reldyn = bfd_get_section_by_name (abfd, ".rela.dyn");
if (reldyn == NULL || reldyn->_raw_size == 0)
@@ -4749,7 +4767,23 @@ elf_link_sort_relocs (abfd, info, psec)
if (size != reldyn->_raw_size)
return 0;
- rela = (struct elf_link_sort_rela *) bfd_zmalloc (sizeof (*rela) * count);
+ /* We waste some memory here when N = i2e is greater than 1, since
+ we allocate space for N * sizeof (*rela) where sizeof (*rela) +
+ (N - 1) * sizeof (Elf_Internal_Rel/Rela) would do. Also, we use
+ rela[k] only when k is a multiple of N, and then we index the
+ array within the union, such that rela[k].u.rel[i], i < N, is the
+ (i+1)th internal relocation corresponding to the (k/N)th external
+ relocation. This is done such that the relocation swap-in and
+ swap-out functions can gen pointers to arrays of internal
+ relocations that form a single external relocation.
+
+ If C permitted arrays of structures with dynamic sizes, we could
+ do better, but trying to avoid wasting space at the end of the
+ chunk from rela[k] to rela[k+N-1] would require us to allocate a
+ separate array of pointers and since most ports have N == 1, this
+ would be more wasteful. */
+ rela = (struct elf_link_sort_rela *) bfd_zmalloc
+ (sizeof (*rela) * count * i2e);
if (rela == NULL)
{
(*info->callbacks->warning)
@@ -4770,15 +4804,16 @@ elf_link_sort_relocs (abfd, info, psec)
erel = (Elf_External_Rel *) o->contents;
erelend = (Elf_External_Rel *) (o->contents + o->_raw_size);
- s = rela + o->output_offset / sizeof (Elf_External_Rel);
- for (; erel < erelend; erel++, s++)
+ s = rela + (o->output_offset / sizeof (Elf_External_Rel) * i2e);
+ for (; erel < erelend; erel++, s += i2e)
{
if (bed->s->swap_reloc_in)
- (*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel, &s->u.rel);
+ (*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel,
+ s->u.rel);
else
- elf_swap_reloc_in (abfd, erel, &s->u.rel);
+ elf_swap_reloc_in (abfd, erel, s->u.rel);
- s->type = (*bed->elf_backend_reloc_type_class) (&s->u.rela);
+ s->type = (*bed->elf_backend_reloc_type_class) (s->u.rela);
}
}
else
@@ -4788,30 +4823,34 @@ elf_link_sort_relocs (abfd, info, psec)
erela = (Elf_External_Rela *) o->contents;
erelaend = (Elf_External_Rela *) (o->contents + o->_raw_size);
- s = rela + o->output_offset / sizeof (Elf_External_Rela);
- for (; erela < erelaend; erela++, s++)
+ s = rela + (o->output_offset / sizeof (Elf_External_Rela) * i2e);
+ for (; erela < erelaend; erela++, s += i2e)
{
if (bed->s->swap_reloca_in)
(*bed->s->swap_reloca_in) (dynobj, (bfd_byte *) erela,
- &s->u.rela);
+ s->u.rela);
else
- elf_swap_reloca_in (dynobj, erela, &s->u.rela);
+ elf_swap_reloca_in (dynobj, erela, s->u.rela);
- s->type = (*bed->elf_backend_reloc_type_class) (&s->u.rela);
+ s->type = (*bed->elf_backend_reloc_type_class) (s->u.rela);
}
}
}
- qsort (rela, (size_t) count, sizeof (*rela), elf_link_sort_cmp1);
- for (ret = 0; ret < count && rela[ret].type == reloc_class_relative; ret++)
+ qsort (rela, (size_t) count, sizeof (*rela) * i2e, elf_link_sort_cmp1);
+ for (ret = 0; ret < count * i2e && rela[ret].type == reloc_class_relative;
+ ret += i2e)
;
- for (i = ret, j = ret; i < count; i++)
+ for (i = ret, j = ret; i < count * i2e; i += i2e)
{
- if (ELF_R_SYM (rela[i].u.rel.r_info) != ELF_R_SYM (rela[j].u.rel.r_info))
+ if (ELF_R_SYM (rela[i].u.rel->r_info)
+ != ELF_R_SYM (rela[j].u.rel->r_info))
j = i;
- rela[i].offset = rela[j].u.rel.r_offset;
+ rela[i].offset = rela[j].u.rel->r_offset;
}
- qsort (rela + ret, (size_t) count - ret, sizeof (*rela), elf_link_sort_cmp2);
+ ret /= i2e;
+ qsort (rela + ret, (size_t) count - ret,
+ sizeof (*rela) * i2e, elf_link_sort_cmp2);
for (o = dynobj->sections; o != NULL; o = o->next)
if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED))
@@ -4825,14 +4864,14 @@ elf_link_sort_relocs (abfd, info, psec)
erel = (Elf_External_Rel *) o->contents;
erelend = (Elf_External_Rel *) (o->contents + o->_raw_size);
- s = rela + o->output_offset / sizeof (Elf_External_Rel);
- for (; erel < erelend; erel++, s++)
+ s = rela + (o->output_offset / sizeof (Elf_External_Rel) * i2e);
+ for (; erel < erelend; erel++, s += i2e)
{
if (bed->s->swap_reloc_out)
- (*bed->s->swap_reloc_out) (abfd, &s->u.rel,
+ (*bed->s->swap_reloc_out) (abfd, s->u.rel,
(bfd_byte *) erel);
else
- elf_swap_reloc_out (abfd, &s->u.rel, erel);
+ elf_swap_reloc_out (abfd, s->u.rel, erel);
}
}
else
@@ -4842,14 +4881,14 @@ elf_link_sort_relocs (abfd, info, psec)
erela = (Elf_External_Rela *) o->contents;
erelaend = (Elf_External_Rela *) (o->contents + o->_raw_size);
- s = rela + o->output_offset / sizeof (Elf_External_Rela);
- for (; erela < erelaend; erela++, s++)
+ s = rela + (o->output_offset / sizeof (Elf_External_Rela) * i2e);
+ for (; erela < erelaend; erela++, s += i2e)
{
if (bed->s->swap_reloca_out)
- (*bed->s->swap_reloca_out) (dynobj, &s->u.rela,
+ (*bed->s->swap_reloca_out) (dynobj, s->u.rela,
(bfd_byte *) erela);
else
- elf_swap_reloca_out (dynobj, &s->u.rela, erela);
+ elf_swap_reloca_out (dynobj, s->u.rela, erela);
}
}
}
@@ -4882,6 +4921,7 @@ elf_bfd_final_link (abfd, info)
Elf_Internal_Sym elfsym;
unsigned int i;
Elf_Internal_Shdr *symtab_hdr;
+ Elf_Internal_Shdr *symtab_shndx_hdr;
Elf_Internal_Shdr *symstrtab_hdr;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
struct elf_outext_info eoinfo;
@@ -4935,6 +4975,7 @@ elf_bfd_final_link (abfd, info)
finfo.symbuf = NULL;
finfo.symshndxbuf = NULL;
finfo.symbuf_count = 0;
+ finfo.shndxbuf_size = 0;
finfo.first_tls_sec = NULL;
for (o = abfd->sections; o != (asection *) NULL; o = o->next)
if ((o->flags & SEC_THREAD_LOCAL) != 0
@@ -5155,9 +5196,7 @@ elf_bfd_final_link (abfd, info)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* sh_name is set in prep_headers. */
symtab_hdr->sh_type = SHT_SYMTAB;
- symtab_hdr->sh_flags = 0;
- symtab_hdr->sh_addr = 0;
- symtab_hdr->sh_size = 0;
+ /* sh_flags, sh_addr and sh_size all start off zero. */
symtab_hdr->sh_entsize = sizeof (Elf_External_Sym);
/* sh_link is set in assign_section_numbers. */
/* sh_info is set below. */
@@ -5184,9 +5223,11 @@ elf_bfd_final_link (abfd, info)
goto error_return;
if (elf_numsections (abfd) > SHN_LORESERVE)
{
- amt = finfo.symbuf_size;
+ /* 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 = (Elf_External_Sym_Shndx *) bfd_malloc (amt);
+ finfo.symshndxbuf = (Elf_External_Sym_Shndx *) bfd_zmalloc (amt);
if (finfo.symshndxbuf == NULL)
goto error_return;
}
@@ -5246,7 +5287,7 @@ elf_bfd_final_link (abfd, info)
if (! elf_link_output_sym (&finfo, (const char *) NULL,
&elfsym, o))
goto error_return;
- if (i == SHN_LORESERVE)
+ if (i == SHN_LORESERVE - 1)
i += SHN_HIRESERVE + 1 - SHN_LORESERVE;
}
}
@@ -5521,6 +5562,24 @@ elf_bfd_final_link (abfd, info)
/* 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 ((PTR) 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;
@@ -5795,17 +5854,10 @@ elf_bfd_final_link (abfd, info)
goto error_return;
}
- if (info->eh_frame_hdr && elf_hash_table (info)->dynobj)
+ if (info->eh_frame_hdr)
{
- o = bfd_get_section_by_name (elf_hash_table (info)->dynobj,
- ".eh_frame_hdr");
- if (o
- && (elf_section_data (o)->sec_info_type
- == ELF_INFO_TYPE_EH_FRAME_HDR))
- {
- if (! _bfd_elf_write_section_eh_frame_hdr (abfd, o))
- goto error_return;
- }
+ if (! _bfd_elf_write_section_eh_frame_hdr (abfd, info))
+ goto error_return;
}
if (finfo.symstrtab != NULL)
@@ -5829,7 +5881,7 @@ elf_bfd_final_link (abfd, info)
if (finfo.symbuf != NULL)
free (finfo.symbuf);
if (finfo.symshndxbuf != NULL)
- free (finfo.symbuf);
+ free (finfo.symshndxbuf);
for (o = abfd->sections; o != NULL; o = o->next)
{
if ((o->flags & SEC_RELOC) != 0
@@ -5863,7 +5915,7 @@ elf_bfd_final_link (abfd, info)
if (finfo.symbuf != NULL)
free (finfo.symbuf);
if (finfo.symshndxbuf != NULL)
- free (finfo.symbuf);
+ free (finfo.symshndxbuf);
for (o = abfd->sections; o != NULL; o = o->next)
{
if ((o->flags & SEC_RELOC) != 0
@@ -5922,11 +5974,24 @@ elf_link_output_sym (finfo, name, elfsym, input_sec)
dest = finfo->symbuf + finfo->symbuf_count;
destshndx = finfo->symshndxbuf;
if (destshndx != NULL)
- destshndx += finfo->symbuf_count;
- elf_swap_symbol_out (finfo->output_bfd, elfsym, (PTR) dest, (PTR) destshndx);
- ++finfo->symbuf_count;
+ {
+ if (bfd_get_symcount (finfo->output_bfd) >= finfo->shndxbuf_size)
+ {
+ bfd_size_type amt;
- ++ bfd_get_symcount (finfo->output_bfd);
+ 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);
+ }
+
+ elf_swap_symbol_out (finfo->output_bfd, elfsym, (PTR) dest, (PTR) destshndx);
+ finfo->symbuf_count += 1;
+ bfd_get_symcount (finfo->output_bfd) += 1;
return true;
}
@@ -5951,20 +6016,6 @@ elf_link_flush_output_syms (finfo)
return false;
hdr->sh_size += amt;
-
- if (finfo->symshndxbuf != NULL)
- {
- hdr = &elf_tdata (finfo->output_bfd)->symtab_shndx_hdr;
- pos = hdr->sh_offset + hdr->sh_size;
- amt = finfo->symbuf_count * sizeof (Elf_External_Sym_Shndx);
- if (bfd_seek (finfo->output_bfd, pos, SEEK_SET) != 0
- || (bfd_bwrite ((PTR) finfo->symshndxbuf, amt, finfo->output_bfd)
- != amt))
- return false;
-
- hdr->sh_size += amt;
- }
-
finfo->symbuf_count = 0;
}
@@ -6781,12 +6832,7 @@ elf_link_input_bfd (finfo, input_bfd)
from discarded sections and section symbols from
removed link-once sections. Complain about relocs
against discarded sections. Zero relocs against removed
- link-once sections. We should really complain if
- anything in the final link tries to use it, but
- DWARF-based exception handling might have an entry in
- .eh_frame to describe a routine in the linkonce section,
- and it turns out to be hard to remove the .eh_frame
- entry too. FIXME. */
+ link-once sections. */
if (!finfo->info->relocateable
&& !elf_section_ignore_discarded_relocs (o))
{
@@ -6815,20 +6861,12 @@ elf_link_input_bfd (finfo, input_bfd)
|| h->root.type == bfd_link_hash_defweak)
&& elf_discarded_section (h->root.u.def.section))
{
-#if BFD_VERSION_DATE < 20031005
if ((o->flags & SEC_DEBUGGING) != 0)
{
-#if BFD_VERSION_DATE > 20021005
- (*finfo->info->callbacks->warning)
- (finfo->info,
- _("warning: relocation against removed section; zeroing"),
- NULL, input_bfd, o, rel->r_offset);
-#endif
BFD_ASSERT (r_symndx != 0);
memset (rel, 0, sizeof (*rel));
}
else
-#endif
{
if (! ((*finfo->info->callbacks->undefined_symbol)
(finfo->info, h->root.root.string,
@@ -6844,23 +6882,15 @@ elf_link_input_bfd (finfo, input_bfd)
if (sec != NULL && elf_discarded_section (sec))
{
-#if BFD_VERSION_DATE < 20031005
if ((o->flags & SEC_DEBUGGING) != 0
|| (sec->flags & SEC_LINK_ONCE) != 0)
{
-#if BFD_VERSION_DATE > 20021005
- (*finfo->info->callbacks->warning)
- (finfo->info,
- _("warning: relocation against removed section"),
- NULL, input_bfd, o, rel->r_offset);
-#endif
BFD_ASSERT (r_symndx != 0);
rel->r_info
= ELF_R_INFO (0, ELF_R_TYPE (rel->r_info));
rel->r_addend = 0;
}
else
-#endif
{
boolean ok;
const char *msg
@@ -6951,6 +6981,16 @@ elf_link_input_bfd (finfo, input_bfd)
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. */
+ memset (irela, 0, sizeof (*irela));
+ continue;
+ }
+
irela->r_offset += o->output_offset;
/* Relocs in an executable have to be virtual addresses. */
@@ -7124,19 +7164,14 @@ elf_link_input_bfd (finfo, input_bfd)
return false;
break;
case ELF_INFO_TYPE_MERGE:
- if (! (_bfd_write_merged_section
- (output_bfd, o, elf_section_data (o)->sec_info)))
+ if (! _bfd_write_merged_section (output_bfd, o,
+ elf_section_data (o)->sec_info))
return false;
break;
case ELF_INFO_TYPE_EH_FRAME:
{
- asection *ehdrsec;
-
- ehdrsec
- = bfd_get_section_by_name (elf_hash_table (finfo->info)->dynobj,
- ".eh_frame_hdr");
- if (! (_bfd_elf_write_section_eh_frame (output_bfd, o, ehdrsec,
- contents)))
+ if (! _bfd_elf_write_section_eh_frame (output_bfd, finfo->info,
+ o, contents))
return false;
}
break;
@@ -8308,7 +8343,7 @@ elf_reloc_symbol_deleted_p (offset, cookie)
for (; rcookie->rel < rcookie->relend; rcookie->rel++)
{
- unsigned long r_symndx = ELF_R_SYM (rcookie->rel->r_info);
+ unsigned long r_symndx;
if (! rcookie->bad_symtab)
if (rcookie->rel->r_offset > offset)
@@ -8316,6 +8351,10 @@ elf_reloc_symbol_deleted_p (offset, cookie)
if (rcookie->rel->r_offset != offset)
continue;
+ r_symndx = ELF_R_SYM (rcookie->rel->r_info);
+ if (r_symndx == SHN_UNDEF)
+ return true;
+
if (r_symndx >= rcookie->locsymcount
|| ELF_ST_BIND (rcookie->locsyms[r_symndx].st_info) != STB_LOCAL)
{
@@ -8367,24 +8406,18 @@ elf_bfd_discard_info (output_bfd, info)
struct bfd_link_info *info;
{
struct elf_reloc_cookie cookie;
- asection *stab, *eh, *ehdr;
+ asection *stab, *eh;
Elf_Internal_Shdr *symtab_hdr;
struct elf_backend_data *bed;
bfd *abfd;
+ unsigned int count;
boolean ret = false;
- boolean strip = info->strip == strip_all || info->strip == strip_debugger;
- if (info->relocateable
- || info->traditional_format
+ if (info->traditional_format
|| info->hash->creator->flavour != bfd_target_elf_flavour
|| ! is_elf_hash_table (info))
return false;
- ehdr = NULL;
- if (elf_hash_table (info)->dynobj != NULL)
- ehdr = bfd_get_section_by_name (elf_hash_table (info)->dynobj,
- ".eh_frame_hdr");
-
for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next)
{
if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
@@ -8395,27 +8428,22 @@ elf_bfd_discard_info (output_bfd, info)
if ((abfd->flags & DYNAMIC) != 0)
continue;
- eh = NULL;
- if (ehdr)
- {
- eh = bfd_get_section_by_name (abfd, ".eh_frame");
- if (eh && (eh->_raw_size == 0
- || bfd_is_abs_section (eh->output_section)))
- eh = NULL;
- }
+ eh = bfd_get_section_by_name (abfd, ".eh_frame");
+ if (eh != NULL
+ && (eh->_raw_size == 0
+ || bfd_is_abs_section (eh->output_section)))
+ eh = NULL;
- stab = NULL;
- if (!strip)
- {
- stab = bfd_get_section_by_name (abfd, ".stab");
- if (stab && (stab->_raw_size == 0
- || bfd_is_abs_section (stab->output_section)))
- stab = NULL;
- }
- if ((! stab
- || elf_section_data(stab)->sec_info_type != ELF_INFO_TYPE_STABS)
- && ! eh
- && (strip || ! bed->elf_backend_discard_info))
+ stab = bfd_get_section_by_name (abfd, ".stab");
+ if (stab != NULL
+ && (stab->_raw_size == 0
+ || bfd_is_abs_section (stab->output_section)
+ || elf_section_data (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;
@@ -8424,8 +8452,7 @@ elf_bfd_discard_info (output_bfd, info)
cookie.bad_symtab = elf_bad_symtab (abfd);
if (cookie.bad_symtab)
{
- cookie.locsymcount =
- symtab_hdr->sh_size / sizeof (Elf_External_Sym);
+ cookie.locsymcount = symtab_hdr->sh_size / sizeof (Elf_External_Sym);
cookie.extsymoff = 0;
}
else
@@ -8444,16 +8471,19 @@ elf_bfd_discard_info (output_bfd, info)
return false;
}
- if (stab)
+ if (stab != NULL)
{
- cookie.rels = (NAME(_bfd_elf,link_read_relocs)
- (abfd, stab, (PTR) NULL, (Elf_Internal_Rela *) NULL,
- info->keep_memory));
- if (cookie.rels)
+ cookie.rels = NULL;
+ count = stab->reloc_count;
+ if (count != 0)
+ cookie.rels = (NAME(_bfd_elf,link_read_relocs)
+ (abfd, stab, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ info->keep_memory));
+ if (cookie.rels != NULL)
{
cookie.rel = cookie.rels;
- cookie.relend =
- cookie.rels + stab->reloc_count * bed->s->int_rels_per_ext_rel;
+ 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,
elf_reloc_symbol_deleted_p,
@@ -8464,39 +8494,32 @@ elf_bfd_discard_info (output_bfd, info)
}
}
- if (eh)
+ if (eh != NULL)
{
cookie.rels = NULL;
- cookie.rel = NULL;
- cookie.relend = NULL;
- if (eh->reloc_count)
+ count = eh->reloc_count;
+ if (count != 0)
cookie.rels = (NAME(_bfd_elf,link_read_relocs)
(abfd, eh, (PTR) NULL, (Elf_Internal_Rela *) NULL,
info->keep_memory));
- if (cookie.rels)
- {
- cookie.rel = cookie.rels;
- cookie.relend =
- cookie.rels + eh->reloc_count * bed->s->int_rels_per_ext_rel;
- }
- if (_bfd_elf_discard_section_eh_frame (abfd, info, eh, ehdr,
+ 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,
elf_reloc_symbol_deleted_p,
&cookie))
- {
- /* Relocs have been edited. Ensure edited version is
- used later in relocate_section. */
- elf_section_data (eh)->relocs = cookie.rels;
- ret = true;
- }
- if (cookie.rels && elf_section_data (eh)->relocs != cookie.rels)
+ ret = true;
+
+ if (cookie.rels != NULL
+ && elf_section_data (eh)->relocs != cookie.rels)
free (cookie.rels);
}
- if (bed->elf_backend_discard_info)
- {
- if (bed->elf_backend_discard_info (abfd, &cookie, info))
- ret = true;
- }
+ 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)
@@ -8508,8 +8531,10 @@ elf_bfd_discard_info (output_bfd, info)
}
}
- if (ehdr && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info, ehdr))
+ if (info->eh_frame_hdr
+ && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info))
ret = true;
+
return ret;
}
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index 2a29347365f..ddd86fbfda5 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -647,13 +647,14 @@ static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] =
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 */
@@ -666,6 +667,7 @@ 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.
@@ -1282,6 +1284,7 @@ elfNN_ia64_aix_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
{
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);
@@ -1290,9 +1293,10 @@ elfNN_ia64_aix_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
(info, abfd, *namep, BSF_GLOBAL,
bfd_get_section_by_name (abfd, ".bss"),
bed->got_symbol_offset, (const char *) NULL, false,
- bed->collect, (struct bfd_link_hash_entry **) &h)))
+ 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;
@@ -3200,13 +3204,11 @@ elfNN_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type,
{
Elf_Internal_Rela outrel;
- offset += sec->output_section->vma + sec->output_offset;
-
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. */
@@ -3214,6 +3216,8 @@ 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
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 3c8bb5d8be8..bc81458987a 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -345,7 +345,7 @@ static bfd_reloc_status_type mips_elf_calculate_relocation
PARAMS ((bfd *, bfd *, asection *, struct bfd_link_info *,
const Elf_Internal_Rela *, bfd_vma, reloc_howto_type *,
Elf_Internal_Sym *, asection **, bfd_vma *, const char **,
- boolean *));
+ boolean *, boolean));
static bfd_vma mips_elf_obtain_contents
PARAMS ((reloc_howto_type *, const Elf_Internal_Rela *, bfd *, bfd_byte *));
static boolean mips_elf_perform_relocation
@@ -1901,6 +1901,7 @@ mips_elf_create_got_section (abfd, info)
flagword flags;
register asection *s;
struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *bh;
struct mips_got_info *g;
bfd_size_type amt;
@@ -1920,13 +1921,14 @@ mips_elf_create_got_section (abfd, info)
/* Define the symbol _GLOBAL_OFFSET_TABLE_. We don't do this in the
linker script because we don't want to define the symbol if we
are not creating a global offset table. */
- h = NULL;
+ bh = NULL;
if (! (_bfd_generic_link_add_one_symbol
(info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
(bfd_vma) 0, (const char *) NULL, false,
- get_elf_backend_data (abfd)->collect,
- (struct bfd_link_hash_entry **) &h)))
+ get_elf_backend_data (abfd)->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;
@@ -2004,7 +2006,7 @@ static bfd_reloc_status_type
mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
relocation, addend, howto, local_syms,
local_sections, valuep, namep,
- require_jalxp)
+ require_jalxp, save_addend)
bfd *abfd;
bfd *input_bfd;
asection *input_section;
@@ -2017,6 +2019,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
bfd_vma *valuep;
const char **namep;
boolean *require_jalxp;
+ boolean save_addend;
{
/* The eventual value we will return. */
bfd_vma value;
@@ -2041,7 +2044,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
struct mips_elf_link_hash_entry *h = NULL;
/* True if the symbol referred to by this relocation is a local
symbol. */
- boolean local_p;
+ boolean local_p, was_local_p;
/* True if the symbol referred to by this relocation is "_gp_disp". */
boolean gp_disp_p = false;
Elf_Internal_Shdr *symtab_hdr;
@@ -2069,6 +2072,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
local_p = mips_elf_local_relocation_p (input_bfd, relocation,
local_sections, false);
+ was_local_p = local_p;
if (! elf_bad_symtab (input_bfd))
extsymoff = symtab_hdr->sh_info;
else
@@ -2456,10 +2460,19 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
order. We don't need to do anything special here; the
differences are handled in mips_elf_perform_relocation. */
case R_MIPS_GPREL16:
- if (local_p)
- value = mips_elf_sign_extend (addend, 16) + symbol + gp0 - gp;
- else
- value = mips_elf_sign_extend (addend, 16) + symbol - gp;
+ /* Only sign-extend the addend if it was extracted from the
+ instruction. If the addend was separate, leave it alone,
+ otherwise we may lose significant bits. */
+ if (howto->partial_inplace)
+ addend = mips_elf_sign_extend (addend, 16);
+ value = symbol + addend - gp;
+ /* If the symbol was local, any earlier relocatable links will
+ have adjusted its addend with the gp offset, so compensate
+ for that now. Don't do it for symbols forced local in this
+ link, though, since they won't have had the gp offset applied
+ to them before. */
+ if (was_local_p)
+ value += gp0;
overflowed_p = mips_elf_overflow_p (value, 16);
break;
@@ -2492,7 +2505,9 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
break;
case R_MIPS_GPREL32:
- value = (addend + symbol + gp0 - gp) & howto->dst_mask;
+ value = (addend + symbol + gp0 - gp);
+ if (!save_addend)
+ value &= howto->dst_mask;
break;
case R_MIPS_PC16:
@@ -2938,6 +2953,12 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec,
know where the shared library will wind up at load-time. */
outrel[0].r_info = ELF_R_INFO (output_bfd, (unsigned long) indx,
R_MIPS_REL32);
+ outrel[1].r_info = ELF_R_INFO (output_bfd, (unsigned long) 0,
+ ABI_64_P (output_bfd)
+ ? R_MIPS_64
+ : R_MIPS_NONE);
+ outrel[2].r_info = ELF_R_INFO (output_bfd, (unsigned long) 0,
+ R_MIPS_NONE);
/* Adjust the output offset of the relocation to reference the
correct location in the output file. */
@@ -3825,15 +3846,17 @@ _bfd_mips_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
&& strcmp (*namep, "__rld_obj_head") == 0)
{
struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *bh;
/* Mark __rld_obj_head as dynamic. */
- h = NULL;
+ bh = NULL;
if (! (_bfd_generic_link_add_one_symbol
(info, abfd, *namep, BSF_GLOBAL, *secp,
(bfd_vma) *valp, (const char *) NULL, false,
- get_elf_backend_data (abfd)->collect,
- (struct bfd_link_hash_entry **) &h)))
+ get_elf_backend_data (abfd)->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;
@@ -3889,6 +3912,7 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info)
struct bfd_link_info *info;
{
struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *bh;
flagword flags;
register asection *s;
const char * const *namep;
@@ -3947,13 +3971,14 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info)
{
for (namep = mips_elf_dynsym_rtproc_names; *namep != NULL; namep++)
{
- h = NULL;
+ bh = NULL;
if (! (_bfd_generic_link_add_one_symbol
(info, abfd, *namep, BSF_GLOBAL, bfd_und_section_ptr,
(bfd_vma) 0, (const char *) NULL, false,
- get_elf_backend_data (abfd)->collect,
- (struct bfd_link_hash_entry **) &h)))
+ get_elf_backend_data (abfd)->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_SECTION;
@@ -3989,26 +4014,17 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info)
if (!info->shared)
{
- h = NULL;
- if (SGI_COMPAT (abfd))
- {
- if (!(_bfd_generic_link_add_one_symbol
- (info, abfd, "_DYNAMIC_LINK", BSF_GLOBAL, bfd_abs_section_ptr,
- (bfd_vma) 0, (const char *) NULL, false,
- get_elf_backend_data (abfd)->collect,
- (struct bfd_link_hash_entry **) &h)))
- return false;
- }
- else
- {
- /* For normal mips it is _DYNAMIC_LINKING. */
- if (!(_bfd_generic_link_add_one_symbol
- (info, abfd, "_DYNAMIC_LINKING", BSF_GLOBAL,
- bfd_abs_section_ptr, (bfd_vma) 0, (const char *) NULL, false,
- get_elf_backend_data (abfd)->collect,
- (struct bfd_link_hash_entry **) &h)))
- return false;
- }
+ const char *name;
+
+ name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING";
+ bh = NULL;
+ if (!(_bfd_generic_link_add_one_symbol
+ (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr,
+ (bfd_vma) 0, (const char *) 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_NON_ELF;
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
h->type = STT_SECTION;
@@ -4025,26 +4041,15 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info)
s = bfd_get_section_by_name (abfd, ".rld_map");
BFD_ASSERT (s != NULL);
- h = NULL;
- if (SGI_COMPAT (abfd))
- {
- if (!(_bfd_generic_link_add_one_symbol
- (info, abfd, "__rld_map", BSF_GLOBAL, s,
- (bfd_vma) 0, (const char *) NULL, false,
- get_elf_backend_data (abfd)->collect,
- (struct bfd_link_hash_entry **) &h)))
- return false;
- }
- else
- {
- /* For normal mips the symbol is __RLD_MAP. */
- if (!(_bfd_generic_link_add_one_symbol
- (info, abfd, "__RLD_MAP", BSF_GLOBAL, s,
- (bfd_vma) 0, (const char *) NULL, false,
- get_elf_backend_data (abfd)->collect,
- (struct bfd_link_hash_entry **) &h)))
- return false;
- }
+ name = SGI_COMPAT (abfd) ? "__rld_map" : "__RLD_MAP";
+ bh = NULL;
+ if (!(_bfd_generic_link_add_one_symbol
+ (info, abfd, name, BSF_GLOBAL, s,
+ (bfd_vma) 0, (const char *) 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_NON_ELF;
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
h->type = STT_OBJECT;
@@ -5261,7 +5266,8 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
input_section, info, rel,
addend, howto, local_syms,
local_sections, &value,
- &name, &require_jalx))
+ &name, &require_jalx,
+ use_saved_addend_p))
{
case bfd_reloc_continue:
/* There's nothing to do. */
@@ -6131,7 +6137,12 @@ _bfd_mips_elf_modify_segment_map (abfd)
.dynamic end up in PT_DYNAMIC. However, we do have to insert a
PT_OPTIONS segment immediately following the program header
table. */
- if (NEWABI_P (abfd))
+ if (NEWABI_P (abfd)
+ /* On non-IRIX6 new abi, we'll have already created a segment
+ for this section, so don't create another. I'm not sure this
+ is not also the case for IRIX 6, but I can't test it right
+ now. */
+ && IRIX_COMPAT (abfd) == ict_irix6)
{
for (s = abfd->sections; s; s = s->next)
if (elf_section_data (s)->this_hdr.sh_type == SHT_MIPS_OPTIONS)
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 8da72568f27..f5b6a35ad02 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -385,15 +385,6 @@
#ifndef elf_backend_write_section
#define elf_backend_write_section NULL
#endif
-#ifndef elf_backend_set_nonloadable_filepos
-#define elf_backend_set_nonloadable_filepos NULL
-#endif
-#ifndef elf_backend_is_contained_by_filepos
-#define elf_backend_is_contained_by_filepos NULL
-#endif
-#ifndef elf_backend_copy_private_bfd_data_p
-#define elf_backend_copy_private_bfd_data_p NULL
-#endif
#ifndef elf_backend_mips_irix_compat
#define elf_backend_mips_irix_compat NULL
#endif
@@ -407,9 +398,6 @@
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. */
@@ -495,9 +483,6 @@ static const struct elf_backend_data elfNN_bed =
elf_backend_discard_info,
elf_backend_ignore_discarded_relocs,
elf_backend_write_section,
- elf_backend_set_nonloadable_filepos,
- elf_backend_is_contained_by_filepos,
- elf_backend_copy_private_bfd_data_p,
elf_backend_mips_irix_compat,
elf_backend_mips_rtype_to_howto,
elf_backend_ecoff_debug_swap,
diff --git a/bfd/format.c b/bfd/format.c
index 1efa9e24547..33291d0f944 100644
--- a/bfd/format.c
+++ b/bfd/format.c
@@ -119,8 +119,9 @@ bfd_check_format_matches (abfd, format, matching)
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;
@@ -132,7 +133,7 @@ bfd_check_format_matches (abfd, format, matching)
}
if (abfd->format != bfd_unknown)
- return abfd->format == format;
+ return (boolean) (abfd->format == format);
/* Since the target type was defaulted, check them
all in the hope that one will be uniquely recognized. */
@@ -145,8 +146,8 @@ 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 = (const bfd_target **) bfd_malloc (amt);
if (!matching_vector)
return false;
}
@@ -170,7 +171,7 @@ bfd_check_format_matches (abfd, format, matching)
abfd->xvec = right_targ; /* Set the target as returned. */
if (matching)
- free (matching_vector);
+ free ((PTR) matching_vector);
return true; /* File position has moved, BTW. */
}
@@ -193,7 +194,7 @@ bfd_check_format_matches (abfd, format, matching)
abfd->format = bfd_unknown;
if (matching)
- free (matching_vector);
+ free ((PTR) matching_vector);
bfd_set_error (bfd_error_file_not_recognized);
@@ -236,7 +237,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 +260,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)
@@ -268,7 +269,7 @@ bfd_check_format_matches (abfd, format, matching)
abfd->format = bfd_unknown;
if (matching)
- free (matching_vector);
+ free ((PTR) matching_vector);
return false;
}
@@ -289,7 +290,27 @@ bfd_check_format_matches (abfd, format, matching)
{
memcpy (matching_vector,
matching_vector + _bfd_target_vector_entries,
- sizeof (char *) * match_count);
+ sizeof (*matching_vector) * match_count);
+ }
+ }
+ }
+
+ if (match_count > 1 && bfd_associated_vector != NULL)
+ {
+ 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)
+ {
+ match_count = 1;
+ break;
}
}
}
@@ -299,7 +320,7 @@ bfd_check_format_matches (abfd, format, matching)
abfd->xvec = right_targ; /* Change BFD's target permanently. */
if (matching)
- free (matching_vector);
+ free ((PTR) matching_vector);
return true; /* File position has moved, BTW. */
}
@@ -312,7 +333,7 @@ bfd_check_format_matches (abfd, format, matching)
bfd_set_error (bfd_error_file_not_recognized);
if (matching)
- free (matching_vector);
+ free ((PTR) matching_vector);
}
else
{
@@ -320,8 +341,15 @@ 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;
+ }
}
}
@@ -355,7 +383,7 @@ bfd_set_format (abfd, format)
}
if (abfd->format != bfd_unknown)
- return abfd->format == format;
+ return (boolean) (abfd->format == format);
/* Presume the answer is yes. */
abfd->format = format;
diff --git a/bfd/gen-aout.c b/bfd/gen-aout.c
index 1bba14adb5b..b6720e87dc9 100644
--- a/bfd/gen-aout.c
+++ b/bfd/gen-aout.c
@@ -21,6 +21,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "/usr/include/a.out.h"
#include <stdio.h>
+#ifndef _
+#define _(X) X
+#endif
+
int
main (argc, argv)
int argc; char** argv;
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index 776dcd62f91..00d5bd3a6b9 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -567,6 +567,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. */
diff --git a/bfd/libbfd.c b/bfd/libbfd.c
index 29170a0d561..f21abbcd6ce 100644
--- a/bfd/libbfd.c
+++ b/bfd/libbfd.c
@@ -186,9 +186,9 @@ bfd_realloc (ptr, size)
}
if (ptr == NULL)
- ret = malloc ((size_t) size);
+ ret = (PTR) malloc ((size_t) size);
else
- ret = realloc (ptr, (size_t) size);
+ ret = (PTR) realloc (ptr, (size_t) size);
if (ret == NULL && (size_t) size != 0)
bfd_set_error (bfd_error_no_memory);
@@ -562,7 +562,7 @@ bfd_bwrite (ptr, size, abfd)
newsize = (bim->size + 127) & ~(bfd_size_type) 127;
if (newsize > oldsize)
{
- bim->buffer = bfd_realloc (bim->buffer, newsize);
+ bim->buffer = (bfd_byte *) bfd_realloc (bim->buffer, newsize);
if (bim->buffer == 0)
{
bim->size = 0;
@@ -608,7 +608,7 @@ bfd_write_bigendian_4byte_int (abfd, i)
{
bfd_byte buffer[4];
bfd_putb32 ((bfd_vma) i, buffer);
- return bfd_bwrite ((PTR) buffer, (bfd_size_type) 4, abfd) == 4;
+ return (boolean) (bfd_bwrite ((PTR) buffer, (bfd_size_type) 4, abfd) == 4);
}
bfd_vma
@@ -706,7 +706,7 @@ bfd_seek (abfd, position, direction)
newsize = (bim->size + 127) & ~(bfd_size_type) 127;
if (newsize > oldsize)
{
- bim->buffer = bfd_realloc (bim->buffer, newsize);
+ bim->buffer = (bfd_byte *) bfd_realloc (bim->buffer, newsize);
if (bim->buffer == 0)
{
bim->size = 0;
@@ -1414,7 +1414,7 @@ bfd_generic_is_local_label_name (abfd, name)
{
char locals_prefix = (bfd_get_symbol_leading_char (abfd) == '_') ? 'L' : '.';
- return (name[0] == locals_prefix);
+ return (boolean) (name[0] == locals_prefix);
}
/* Can be used from / for bfd_merge_private_bfd_data to check that
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 96e55d7c547..6d40e91cbaf 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -572,6 +572,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. */
@@ -1005,6 +1008,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",
diff --git a/bfd/libcoff.h b/bfd/libcoff.h
index 88b09098296..ea9c5700b1f 100644
--- a/bfd/libcoff.h
+++ b/bfd/libcoff.h
@@ -784,7 +784,7 @@ typedef struct
struct coff_link_hash_entry *, struct internal_syment *,
bfd_vma *));
- boolean (*_bfd_coff_adjust_symndx)\
+ boolean (*_bfd_coff_adjust_symndx)
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
struct internal_reloc *, boolean *));
diff --git a/bfd/linker.c b/bfd/linker.c
index 242f8bd7625..a5ded1f5883 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -449,7 +449,8 @@ _bfd_link_hash_newfunc (entry, table, string)
subclass. */
if (entry == NULL)
{
- entry = bfd_hash_allocate (table, sizeof (struct bfd_link_hash_entry));
+ entry = (struct bfd_hash_entry *)
+ bfd_hash_allocate (table, sizeof (struct bfd_link_hash_entry));
if (entry == NULL)
return entry;
}
@@ -645,8 +646,8 @@ _bfd_generic_link_hash_newfunc (entry, table, string)
subclass. */
if (entry == NULL)
{
- entry = bfd_hash_allocate (table,
- sizeof (struct generic_link_hash_entry));
+ entry = (struct bfd_hash_entry *)
+ bfd_hash_allocate (table, sizeof (struct generic_link_hash_entry));
if (entry == NULL)
return entry;
}
@@ -1305,6 +1306,7 @@ generic_link_add_symbol_list (abfd, info, symbol_count, symbols, collect)
const char *name;
const char *string;
struct generic_link_hash_entry *h;
+ struct bfd_link_hash_entry *bh;
name = bfd_asymbol_name (p);
if (((p->flags & BSF_INDIRECT) != 0
@@ -1326,12 +1328,12 @@ generic_link_add_symbol_list (abfd, info, symbol_count, symbols, collect)
else
string = NULL;
- h = NULL;
+ bh = NULL;
if (! (_bfd_generic_link_add_one_symbol
(info, abfd, name, p->flags, bfd_get_section (p),
- p->value, string, false, collect,
- (struct bfd_link_hash_entry **) &h)))
+ 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
anything with it, then we want to just pass the symbol
@@ -2018,7 +2020,7 @@ _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 = true;
+ p->u.indirect.section->linker_mark = (unsigned int) true;
/* Build the output symbol table. */
for (sub = info->input_bfds; sub != (bfd *) NULL; sub = sub->link_next)
diff --git a/bfd/mach-o-target.c b/bfd/mach-o-target.c
new file mode 100644
index 00000000000..b271bfc87fe
--- /dev/null
+++ b/bfd/mach-o-target.c
@@ -0,0 +1,117 @@
+/* Mach-O support for BFD.
+ Copyright 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef TARGET_NAME
+#error TARGET_NAME must be defined
+#endif /* TARGET_NAME */
+
+#ifndef TARGET_STRING
+#error TARGET_STRING must be defined
+#endif /* TARGET_STRING */
+
+#ifndef TARGET_BIG_ENDIAN
+#error TARGET_BIG_ENDIAN must be defined
+#endif /* TARGET_BIG_ENDIAN */
+
+#ifndef TARGET_ARCHIVE
+#error TARGET_ARCHIVE must be defined
+#endif /* TARGET_ARCHIVE */
+
+#if ((TARGET_ARCHIVE) && (! TARGET_BIG_ENDIAN))
+#error Mach-O fat files must always be big-endian.
+#endif /* ((TARGET_ARCHIVE) && (! TARGET_BIG_ENDIAN)) */
+
+const bfd_target TARGET_NAME =
+{
+ TARGET_STRING, /* Name. */
+ bfd_target_mach_o_flavour,
+#if TARGET_BIG_ENDIAN
+ BFD_ENDIAN_BIG, /* Target byte order. */
+ BFD_ENDIAN_BIG, /* Target headers byte order. */
+#else
+ BFD_ENDIAN_LITTLE, /* Target byte order. */
+ BFD_ENDIAN_LITTLE, /* Target headers byte order. */
+#endif
+ (HAS_RELOC | EXEC_P | /* Object flags. */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
+ (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
+ | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
+ '_', /* symbol_leading_char. */
+ ' ', /* ar_pad_char. */
+ 16, /* ar_max_namelen. */
+
+#if TARGET_BIG_ENDIAN
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Hdrs. */
+#else
+ 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 */
+#endif /* TARGET_BIG_ENDIAN */
+
+ { /* bfd_check_format. */
+#if TARGET_ARCHIVE
+ _bfd_dummy_target,
+ _bfd_dummy_target,
+ bfd_mach_o_archive_p,
+ _bfd_dummy_target,
+#else
+ _bfd_dummy_target,
+ bfd_mach_o_object_p,
+ _bfd_dummy_target,
+ bfd_mach_o_core_p
+#endif
+ },
+ { /* bfd_set_format. */
+ bfd_false,
+ bfd_mach_o_mkobject,
+ bfd_false,
+ bfd_mach_o_mkobject,
+ },
+ { /* bfd_write_contents. */
+ bfd_false,
+ bfd_mach_o_write_contents,
+ bfd_false,
+ bfd_mach_o_write_contents,
+ },
+
+ BFD_JUMP_TABLE_GENERIC (bfd_mach_o),
+ BFD_JUMP_TABLE_COPY (bfd_mach_o),
+ BFD_JUMP_TABLE_CORE (bfd_mach_o),
+ BFD_JUMP_TABLE_ARCHIVE (bfd_mach_o),
+ BFD_JUMP_TABLE_SYMBOLS (bfd_mach_o),
+ BFD_JUMP_TABLE_RELOCS (bfd_mach_o),
+ BFD_JUMP_TABLE_WRITE (bfd_mach_o),
+ BFD_JUMP_TABLE_LINK (bfd_mach_o),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ NULL,
+
+ NULL
+};
+
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
new file mode 100644
index 00000000000..1daaf985ff7
--- /dev/null
+++ b/bfd/mach-o.c
@@ -0,0 +1,2194 @@
+/* Mach-O support for BFD.
+ Copyright 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "mach-o.h"
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "libiberty.h"
+#include <ctype.h>
+
+#ifndef BFD_IO_FUNCS
+#define BFD_IO_FUNCS 0
+#endif
+
+#define bfd_mach_o_mkarchive _bfd_noarchive_mkarchive
+#define bfd_mach_o_read_ar_hdr _bfd_noarchive_read_ar_hdr
+#define bfd_mach_o_slurp_armap _bfd_noarchive_slurp_armap
+#define bfd_mach_o_slurp_extended_name_table _bfd_noarchive_slurp_extended_name_table
+#define bfd_mach_o_construct_extended_name_table _bfd_noarchive_construct_extended_name_table
+#define bfd_mach_o_truncate_arname _bfd_noarchive_truncate_arname
+#define bfd_mach_o_write_armap _bfd_noarchive_write_armap
+#define bfd_mach_o_get_elt_at_index _bfd_noarchive_get_elt_at_index
+#define bfd_mach_o_generic_stat_arch_elt _bfd_noarchive_generic_stat_arch_elt
+#define bfd_mach_o_update_armap_timestamp _bfd_noarchive_update_armap_timestamp
+#define bfd_mach_o_close_and_cleanup _bfd_generic_close_and_cleanup
+#define bfd_mach_o_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define bfd_mach_o_new_section_hook _bfd_generic_new_section_hook
+#define bfd_mach_o_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define bfd_mach_o_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
+#define bfd_mach_o_get_lineno _bfd_nosymbols_get_lineno
+#define bfd_mach_o_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define bfd_mach_o_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define bfd_mach_o_read_minisymbols _bfd_generic_read_minisymbols
+#define bfd_mach_o_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define bfd_mach_o_get_reloc_upper_bound _bfd_norelocs_get_reloc_upper_bound
+#define bfd_mach_o_canonicalize_reloc _bfd_norelocs_canonicalize_reloc
+#define bfd_mach_o_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
+#define bfd_mach_o_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
+#define bfd_mach_o_bfd_relax_section bfd_generic_relax_section
+#define bfd_mach_o_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define bfd_mach_o_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
+#define bfd_mach_o_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define bfd_mach_o_bfd_link_just_syms _bfd_generic_link_just_syms
+#define bfd_mach_o_bfd_final_link _bfd_generic_final_link
+#define bfd_mach_o_bfd_link_split_section _bfd_generic_link_split_section
+#define bfd_mach_o_set_arch_mach bfd_default_set_arch_mach
+#define bfd_mach_o_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
+#define bfd_mach_o_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
+#define bfd_mach_o_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
+#define bfd_mach_o_get_section_contents _bfd_generic_get_section_contents
+#define bfd_mach_o_set_section_contents _bfd_generic_set_section_contents
+#define bfd_mach_o_bfd_gc_sections bfd_generic_gc_sections
+#define bfd_mach_o_bfd_merge_sections bfd_generic_merge_sections
+#define bfd_mach_o_bfd_discard_group bfd_generic_discard_group
+
+static boolean bfd_mach_o_bfd_copy_private_symbol_data PARAMS ((bfd *, asymbol *, bfd *, asymbol *));
+static boolean bfd_mach_o_bfd_copy_private_section_data PARAMS ((bfd *, asection *, bfd *, asection *));
+static boolean bfd_mach_o_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *));
+static long bfd_mach_o_count_symbols PARAMS ((bfd *));
+static long bfd_mach_o_get_symtab_upper_bound PARAMS ((bfd *));
+static long bfd_mach_o_get_symtab PARAMS ((bfd *, asymbol **));
+static void bfd_mach_o_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
+static void bfd_mach_o_print_symbol PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
+static void bfd_mach_o_convert_architecture PARAMS ((bfd_mach_o_cpu_type, bfd_mach_o_cpu_subtype, enum bfd_architecture *, unsigned long *));
+static boolean bfd_mach_o_write_contents PARAMS ((bfd *));
+static int bfd_mach_o_sizeof_headers PARAMS ((bfd *, boolean));
+static asymbol * bfd_mach_o_make_empty_symbol PARAMS ((bfd *));
+static int bfd_mach_o_write_header PARAMS ((bfd *, bfd_mach_o_header *));
+static int bfd_mach_o_read_header PARAMS ((bfd *, bfd_mach_o_header *));
+static asection * bfd_mach_o_make_bfd_section PARAMS ((bfd *, bfd_mach_o_section *));
+static int bfd_mach_o_scan_read_section PARAMS ((bfd *, bfd_mach_o_section *, bfd_vma));
+static int bfd_mach_o_scan_write_section PARAMS ((bfd *, bfd_mach_o_section *, bfd_vma));
+static int bfd_mach_o_scan_write_symtab_symbols PARAMS ((bfd *, bfd_mach_o_load_command *));
+static int bfd_mach_o_scan_write_thread PARAMS ((bfd *, bfd_mach_o_load_command *));
+static int bfd_mach_o_scan_read_dylinker PARAMS ((bfd *, bfd_mach_o_load_command *));
+static int bfd_mach_o_scan_read_dylib PARAMS ((bfd *, bfd_mach_o_load_command *));
+static int bfd_mach_o_scan_read_prebound_dylib PARAMS ((bfd *, bfd_mach_o_load_command *));
+static int bfd_mach_o_scan_read_thread PARAMS ((bfd *, bfd_mach_o_load_command *));
+static int bfd_mach_o_scan_write_symtab PARAMS ((bfd *, bfd_mach_o_load_command *));
+static int bfd_mach_o_scan_read_dysymtab PARAMS ((bfd *, bfd_mach_o_load_command *));
+static int bfd_mach_o_scan_read_symtab PARAMS ((bfd *, bfd_mach_o_load_command *));
+static int bfd_mach_o_scan_read_segment PARAMS ((bfd *, bfd_mach_o_load_command *));
+static int bfd_mach_o_scan_write_segment PARAMS ((bfd *, bfd_mach_o_load_command *));
+static int bfd_mach_o_scan_read_command PARAMS ((bfd *, bfd_mach_o_load_command *));
+static void bfd_mach_o_flatten_sections PARAMS ((bfd *));
+static const char * bfd_mach_o_i386_flavour_string PARAMS ((unsigned int));
+static const char * bfd_mach_o_ppc_flavour_string PARAMS ((unsigned int));
+
+/* The flags field of a section structure is separated into two parts a section
+ type and section attributes. The section types are mutually exclusive (it
+ can only have one type) but the section attributes are not (it may have more
+ than one attribute). */
+
+#define SECTION_TYPE 0x000000ff /* 256 section types. */
+#define SECTION_ATTRIBUTES 0xffffff00 /* 24 section attributes. */
+
+/* Constants for the section attributes part of the flags field of a section
+ structure. */
+
+#define SECTION_ATTRIBUTES_USR 0xff000000 /* User-settable attributes. */
+#define S_ATTR_PURE_INSTRUCTIONS 0x80000000 /* Section contains only true machine instructions. */
+#define SECTION_ATTRIBUTES_SYS 0x00ffff00 /* System setable attributes. */
+#define S_ATTR_SOME_INSTRUCTIONS 0x00000400 /* Section contains some machine instructions. */
+#define S_ATTR_EXT_RELOC 0x00000200 /* Section has external relocation entries. */
+#define S_ATTR_LOC_RELOC 0x00000100 /* Section has local relocation entries. */
+
+#define N_STAB 0xe0
+#define N_TYPE 0x1e
+#define N_EXT 0x01
+#define N_UNDF 0x0
+#define N_ABS 0x2
+#define N_SECT 0xe
+#define N_INDR 0xa
+
+boolean
+bfd_mach_o_valid (abfd)
+ bfd *abfd;
+{
+ if (abfd == NULL || abfd->xvec == NULL)
+ return 0;
+
+ if (! ((abfd->xvec == &mach_o_be_vec)
+ || (abfd->xvec == &mach_o_le_vec)
+ || (abfd->xvec == &mach_o_fat_vec)))
+ return 0;
+
+ if (abfd->tdata.mach_o_data == NULL)
+ return 0;
+ return 1;
+}
+
+/* Copy any private info we understand from the input symbol
+ to the output symbol. */
+
+static boolean
+bfd_mach_o_bfd_copy_private_symbol_data (ibfd, isymbol, obfd, osymbol)
+ bfd *ibfd ATTRIBUTE_UNUSED;
+ asymbol *isymbol ATTRIBUTE_UNUSED;
+ bfd *obfd ATTRIBUTE_UNUSED;
+ asymbol *osymbol ATTRIBUTE_UNUSED;
+{
+ return true;
+}
+
+/* Copy any private info we understand from the input section
+ to the output section. */
+
+static boolean
+bfd_mach_o_bfd_copy_private_section_data (ibfd, isection, obfd, osection)
+ bfd *ibfd ATTRIBUTE_UNUSED;
+ asection *isection ATTRIBUTE_UNUSED;
+ bfd *obfd ATTRIBUTE_UNUSED;
+ asection *osection ATTRIBUTE_UNUSED;
+{
+ return true;
+}
+
+/* Copy any private info we understand from the input bfd
+ to the output bfd. */
+
+static boolean
+bfd_mach_o_bfd_copy_private_bfd_data (ibfd, obfd)
+ bfd *ibfd;
+ bfd *obfd;
+{
+ BFD_ASSERT (bfd_mach_o_valid (ibfd));
+ BFD_ASSERT (bfd_mach_o_valid (obfd));
+
+ obfd->tdata.mach_o_data = ibfd->tdata.mach_o_data;
+ obfd->tdata.mach_o_data->ibfd = ibfd;
+ return true;
+}
+
+static long
+bfd_mach_o_count_symbols (abfd)
+ bfd *abfd;
+{
+ bfd_mach_o_data_struct *mdata = NULL;
+ long nsyms = 0;
+ unsigned long i;
+
+ BFD_ASSERT (bfd_mach_o_valid (abfd));
+ mdata = abfd->tdata.mach_o_data;
+
+ for (i = 0; i < mdata->header.ncmds; i++)
+ if (mdata->commands[i].type == BFD_MACH_O_LC_SYMTAB)
+ {
+ bfd_mach_o_symtab_command *sym = &mdata->commands[i].command.symtab;
+ nsyms += sym->nsyms;
+ }
+
+ return nsyms;
+}
+
+static long
+bfd_mach_o_get_symtab_upper_bound (abfd)
+ bfd *abfd;
+{
+ long nsyms = bfd_mach_o_count_symbols (abfd);
+
+ if (nsyms < 0)
+ return nsyms;
+
+ return ((nsyms + 1) * sizeof (asymbol *));
+}
+
+static long
+bfd_mach_o_get_symtab (abfd, alocation)
+ bfd *abfd;
+ asymbol **alocation;
+{
+ bfd_mach_o_data_struct *mdata = abfd->tdata.mach_o_data;
+ long nsyms = bfd_mach_o_count_symbols (abfd);
+ asymbol **csym = alocation;
+ unsigned long i, j;
+
+ if (nsyms < 0)
+ return nsyms;
+
+ for (i = 0; i < mdata->header.ncmds; i++)
+ {
+ if (mdata->commands[i].type == BFD_MACH_O_LC_SYMTAB)
+ {
+ bfd_mach_o_symtab_command *sym = &mdata->commands[i].command.symtab;
+
+ if (bfd_mach_o_scan_read_symtab_symbols (abfd, &mdata->commands[i].command.symtab) != 0)
+ {
+ fprintf (stderr, "bfd_mach_o_get_symtab: unable to load symbols for section %lu\n", i);
+ return 0;
+ }
+
+ BFD_ASSERT (sym->symbols != NULL);
+
+ for (j = 0; j < sym->nsyms; j++)
+ {
+ BFD_ASSERT (csym < (alocation + nsyms));
+ *csym++ = &sym->symbols[j];
+ }
+ }
+ }
+
+ *csym++ = NULL;
+
+ return nsyms;
+}
+
+static void
+bfd_mach_o_get_symbol_info (abfd, symbol, ret)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asymbol *symbol;
+ symbol_info *ret;
+{
+ bfd_symbol_info (symbol, ret);
+}
+
+static void
+bfd_mach_o_print_symbol (abfd, afile, symbol, how)
+ bfd *abfd;
+ PTR afile;
+ asymbol *symbol;
+ bfd_print_symbol_type how;
+{
+ FILE *file = (FILE *) afile;
+
+ switch (how)
+ {
+ case bfd_print_symbol_name:
+ fprintf (file, "%s", symbol->name);
+ break;
+ default:
+ bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
+ fprintf (file, " %-5s %s", symbol->section->name, symbol->name);
+ }
+}
+
+static void
+bfd_mach_o_convert_architecture (mtype, msubtype, type, subtype)
+ bfd_mach_o_cpu_type mtype;
+ bfd_mach_o_cpu_subtype msubtype ATTRIBUTE_UNUSED;
+ enum bfd_architecture *type;
+ unsigned long *subtype;
+{
+ *subtype = bfd_arch_unknown;
+
+ switch (mtype)
+ {
+ case BFD_MACH_O_CPU_TYPE_VAX: *type = bfd_arch_vax; break;
+ case BFD_MACH_O_CPU_TYPE_MC680x0: *type = bfd_arch_m68k; break;
+ case BFD_MACH_O_CPU_TYPE_I386: *type = bfd_arch_i386; break;
+ case BFD_MACH_O_CPU_TYPE_MIPS: *type = bfd_arch_mips; break;
+ case BFD_MACH_O_CPU_TYPE_MC98000: *type = bfd_arch_m98k; break;
+ case BFD_MACH_O_CPU_TYPE_HPPA: *type = bfd_arch_hppa; break;
+ case BFD_MACH_O_CPU_TYPE_ARM: *type = bfd_arch_arm; break;
+ case BFD_MACH_O_CPU_TYPE_MC88000: *type = bfd_arch_m88k; break;
+ case BFD_MACH_O_CPU_TYPE_SPARC: *type = bfd_arch_sparc; break;
+ case BFD_MACH_O_CPU_TYPE_I860: *type = bfd_arch_i860; break;
+ case BFD_MACH_O_CPU_TYPE_ALPHA: *type = bfd_arch_alpha; break;
+ case BFD_MACH_O_CPU_TYPE_POWERPC: *type = bfd_arch_powerpc; break;
+ default: *type = bfd_arch_unknown; break;
+ }
+
+ switch (*type)
+ {
+ case bfd_arch_i386: *subtype = bfd_mach_i386_i386; break;
+ case bfd_arch_sparc: *subtype = bfd_mach_sparc; break;
+ default:
+ *subtype = bfd_arch_unknown;
+ }
+}
+
+static boolean
+bfd_mach_o_write_contents (abfd)
+ bfd *abfd;
+{
+ unsigned int i;
+ asection *s;
+
+ bfd_mach_o_data_struct *mdata = abfd->tdata.mach_o_data;
+
+ /* Write data sections first in case they overlap header data to be
+ written later. */
+
+ for (s = abfd->sections; s != (asection *) NULL; s = s->next)
+ ;
+
+#if 0
+ for (i = 0; i < mdata->header.ncmds; i++)
+ {
+ bfd_mach_o_load_command *cur = &mdata->commands[i];
+ if (cur->type != BFD_MACH_O_LC_SEGMENT)
+ break;
+
+ {
+ bfd_mach_o_segment_command *seg = &cur->command.segment;
+ char buf[1024];
+ bfd_vma nbytes = seg->filesize;
+ bfd_vma curoff = seg->fileoff;
+
+ while (nbytes > 0)
+ {
+ bfd_vma thisread = nbytes;
+
+ if (thisread > 1024)
+ thisread = 1024;
+
+ bfd_seek (abfd, curoff, SEEK_SET);
+ if (bfd_bread ((PTR) buf, thisread, abfd) != thisread)
+ return false;
+
+ bfd_seek (abfd, curoff, SEEK_SET);
+ if (bfd_bwrite ((PTR) buf, thisread, abfd) != thisread)
+ return false;
+
+ nbytes -= thisread;
+ curoff += thisread;
+ }
+ }
+ }
+#endif
+
+ /* Now write header information. */
+ if (bfd_mach_o_write_header (abfd, &mdata->header) != 0)
+ return false;
+
+ for (i = 0; i < mdata->header.ncmds; i++)
+ {
+ unsigned char buf[8];
+ bfd_mach_o_load_command *cur = &mdata->commands[i];
+ unsigned long typeflag;
+
+ typeflag = cur->type_required ? cur->type & BFD_MACH_O_LC_REQ_DYLD : cur->type;
+
+ bfd_h_put_32 (abfd, typeflag, buf);
+ bfd_h_put_32 (abfd, cur->len, buf + 4);
+
+ bfd_seek (abfd, cur->offset, SEEK_SET);
+ if (bfd_bwrite ((PTR) buf, 8, abfd) != 8)
+ return false;
+
+ switch (cur->type)
+ {
+ case BFD_MACH_O_LC_SEGMENT:
+ if (bfd_mach_o_scan_write_segment (abfd, cur) != 0)
+ return false;
+ break;
+ case BFD_MACH_O_LC_SYMTAB:
+ if (bfd_mach_o_scan_write_symtab (abfd, cur) != 0)
+ return false;
+ break;
+ case BFD_MACH_O_LC_SYMSEG:
+ break;
+ case BFD_MACH_O_LC_THREAD:
+ case BFD_MACH_O_LC_UNIXTHREAD:
+ if (bfd_mach_o_scan_write_thread (abfd, cur) != 0)
+ return false;
+ break;
+ case BFD_MACH_O_LC_LOADFVMLIB:
+ case BFD_MACH_O_LC_IDFVMLIB:
+ case BFD_MACH_O_LC_IDENT:
+ case BFD_MACH_O_LC_FVMFILE:
+ case BFD_MACH_O_LC_PREPAGE:
+ case BFD_MACH_O_LC_DYSYMTAB:
+ case BFD_MACH_O_LC_LOAD_DYLIB:
+ case BFD_MACH_O_LC_LOAD_WEAK_DYLIB:
+ case BFD_MACH_O_LC_ID_DYLIB:
+ case BFD_MACH_O_LC_LOAD_DYLINKER:
+ case BFD_MACH_O_LC_ID_DYLINKER:
+ case BFD_MACH_O_LC_PREBOUND_DYLIB:
+ case BFD_MACH_O_LC_ROUTINES:
+ case BFD_MACH_O_LC_SUB_FRAMEWORK:
+ break;
+ default:
+ fprintf (stderr,
+ "unable to write unknown load command 0x%lx\n",
+ (long) cur->type);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+static int
+bfd_mach_o_sizeof_headers (a, b)
+ bfd *a ATTRIBUTE_UNUSED;
+ boolean b ATTRIBUTE_UNUSED;
+{
+ return 0;
+}
+
+/* Make an empty symbol. This is required only because
+ bfd_make_section_anyway wants to create a symbol for the section. */
+
+static asymbol *
+bfd_mach_o_make_empty_symbol (abfd)
+ bfd *abfd;
+{
+ asymbol *new;
+
+ new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol));
+ if (new == NULL)
+ return new;
+ new->the_bfd = abfd;
+ return new;
+}
+
+static int
+bfd_mach_o_write_header (abfd, header)
+ bfd *abfd;
+ bfd_mach_o_header *header;
+{
+ unsigned char buf[28];
+
+ bfd_h_put_32 (abfd, header->magic, buf + 0);
+ bfd_h_put_32 (abfd, header->cputype, buf + 4);
+ bfd_h_put_32 (abfd, header->cpusubtype, buf + 8);
+ bfd_h_put_32 (abfd, header->filetype, buf + 12);
+ bfd_h_put_32 (abfd, header->ncmds, buf + 16);
+ bfd_h_put_32 (abfd, header->sizeofcmds, buf + 20);
+ bfd_h_put_32 (abfd, header->flags, buf + 24);
+
+ bfd_seek (abfd, 0, SEEK_SET);
+ if (bfd_bwrite ((PTR) buf, 28, abfd) != 28)
+ return -1;
+
+ return 0;
+}
+
+static int
+bfd_mach_o_read_header (abfd, header)
+ bfd *abfd;
+ bfd_mach_o_header *header;
+{
+ unsigned char buf[28];
+ bfd_vma (*get32) PARAMS ((const bfd_byte *)) = NULL;
+
+ bfd_seek (abfd, 0, SEEK_SET);
+
+ if (bfd_bread ((PTR) buf, 28, abfd) != 28)
+ return -1;
+
+ if (bfd_getb32 (buf) == 0xfeedface)
+ {
+ header->byteorder = BFD_ENDIAN_BIG;
+ header->magic = 0xfeedface;
+ get32 = bfd_getb32;
+ }
+ else if (bfd_getl32 (buf) == 0xfeedface)
+ {
+ header->byteorder = BFD_ENDIAN_LITTLE;
+ header->magic = 0xfeedface;
+ get32 = bfd_getl32;
+ }
+ else
+ {
+ header->byteorder = BFD_ENDIAN_UNKNOWN;
+ return -1;
+ }
+
+ header->cputype = (*get32) (buf + 4);
+ header->cpusubtype = (*get32) (buf + 8);
+ header->filetype = (*get32) (buf + 12);
+ header->ncmds = (*get32) (buf + 16);
+ header->sizeofcmds = (*get32) (buf + 20);
+ header->flags = (*get32) (buf + 24);
+
+ return 0;
+}
+
+static asection *
+bfd_mach_o_make_bfd_section (abfd, section)
+ bfd *abfd;
+ bfd_mach_o_section *section;
+{
+ asection *bfdsec;
+ char *sname;
+ const char *prefix = "LC_SEGMENT";
+ unsigned int snamelen;
+
+ snamelen = strlen (prefix) + 1
+ + strlen (section->segname) + 1
+ + strlen (section->sectname) + 1;
+
+ sname = (char *) bfd_alloc (abfd, snamelen);
+ if (sname == NULL)
+ return NULL;
+ sprintf (sname, "%s.%s.%s", prefix, section->segname, section->sectname);
+
+ bfdsec = bfd_make_section_anyway (abfd, sname);
+ if (bfdsec == NULL)
+ return NULL;
+
+ bfdsec->vma = section->addr;
+ bfdsec->lma = section->addr;
+ bfdsec->_raw_size = section->size;
+ bfdsec->filepos = section->offset;
+ bfdsec->alignment_power = section->align;
+
+ if (section->flags & BFD_MACH_O_S_ZEROFILL)
+ bfdsec->flags = SEC_ALLOC;
+ else
+ bfdsec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_CODE;
+
+ return bfdsec;
+}
+
+static int
+bfd_mach_o_scan_read_section (abfd, section, offset)
+ bfd *abfd;
+ bfd_mach_o_section *section;
+ bfd_vma offset;
+{
+ unsigned char buf[68];
+
+ bfd_seek (abfd, offset, SEEK_SET);
+ if (bfd_bread ((PTR) buf, 68, abfd) != 68)
+ return -1;
+
+ memcpy (section->sectname, buf, 16);
+ section->sectname[16] = '\0';
+ memcpy (section->segname, buf + 16, 16);
+ section->segname[16] = '\0';
+ section->addr = bfd_h_get_32 (abfd, buf + 32);
+ section->size = bfd_h_get_32 (abfd, buf + 36);
+ section->offset = bfd_h_get_32 (abfd, buf + 40);
+ section->align = bfd_h_get_32 (abfd, buf + 44);
+ section->reloff = bfd_h_get_32 (abfd, buf + 48);
+ section->nreloc = bfd_h_get_32 (abfd, buf + 52);
+ section->flags = bfd_h_get_32 (abfd, buf + 56);
+ section->reserved1 = bfd_h_get_32 (abfd, buf + 60);
+ section->reserved2 = bfd_h_get_32 (abfd, buf + 64);
+ section->bfdsection = bfd_mach_o_make_bfd_section (abfd, section);
+
+ if (section->bfdsection == NULL)
+ return -1;
+
+ return 0;
+}
+
+static int
+bfd_mach_o_scan_write_section (abfd, section, offset)
+ bfd *abfd;
+ bfd_mach_o_section *section;
+ bfd_vma offset;
+{
+ unsigned char buf[68];
+
+ memcpy (buf, section->sectname, 16);
+ memcpy (buf + 16, section->segname, 16);
+ bfd_h_put_32 (abfd, section->addr, buf + 32);
+ bfd_h_put_32 (abfd, section->size, buf + 36);
+ bfd_h_put_32 (abfd, section->offset, buf + 40);
+ bfd_h_put_32 (abfd, section->align, buf + 44);
+ bfd_h_put_32 (abfd, section->reloff, buf + 48);
+ bfd_h_put_32 (abfd, section->nreloc, buf + 52);
+ bfd_h_put_32 (abfd, section->flags, buf + 56);
+ /* bfd_h_put_32 (abfd, section->reserved1, buf + 60); */
+ /* bfd_h_put_32 (abfd, section->reserved2, buf + 64); */
+
+ bfd_seek (abfd, offset, SEEK_SET);
+ if (bfd_bwrite ((PTR) buf, 68, abfd) != 68)
+ return -1;
+
+ return 0;
+}
+
+static int
+bfd_mach_o_scan_write_symtab_symbols (abfd, command)
+ bfd *abfd;
+ bfd_mach_o_load_command *command;
+{
+ bfd_mach_o_symtab_command *sym = &command->command.symtab;
+ asymbol *s = NULL;
+ unsigned long i;
+
+ for (i = 0; i < sym->nsyms; i++)
+ {
+ unsigned char buf[12];
+ bfd_vma symoff = sym->symoff + (i * 12);
+ unsigned char ntype = 0;
+ unsigned char nsect = 0;
+ short ndesc = 0;
+
+ s = &sym->symbols[i];
+
+ /* Don't set this from the symbol information; use stored values. */
+#if 0
+ if (s->flags & BSF_GLOBAL)
+ ntype |= N_EXT;
+ if (s->flags & BSF_DEBUGGING)
+ ntype |= N_STAB;
+
+ if (s->section == bfd_und_section_ptr)
+ ntype |= N_UNDF;
+ else if (s->section == bfd_abs_section_ptr)
+ ntype |= N_ABS;
+ else
+ ntype |= N_SECT;
+#endif
+
+ /* Instead just set from the stored values. */
+ ntype = (s->udata.i >> 24) & 0xff;
+ nsect = (s->udata.i >> 16) & 0xff;
+ ndesc = s->udata.i & 0xffff;
+
+ bfd_h_put_32 (abfd, s->name - sym->strtab, buf);
+ bfd_h_put_8 (abfd, ntype, buf + 4);
+ bfd_h_put_8 (abfd, nsect, buf + 5);
+ bfd_h_put_16 (abfd, ndesc, buf + 6);
+ bfd_h_put_32 (abfd, s->section->vma + s->value, buf + 8);
+
+ bfd_seek (abfd, symoff, SEEK_SET);
+ if (bfd_bwrite ((PTR) buf, 12, abfd) != 12)
+ {
+ fprintf (stderr, "bfd_mach_o_scan_write_symtab_symbols: unable to write %d bytes at %lu\n",
+ 12, (unsigned long) symoff);
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+bfd_mach_o_scan_read_symtab_symbol (abfd, sym, s, i)
+ bfd *abfd;
+ bfd_mach_o_symtab_command *sym;
+ asymbol *s;
+ unsigned long i;
+{
+ bfd_mach_o_data_struct *mdata = abfd->tdata.mach_o_data;
+ bfd_vma symoff = sym->symoff + (i * 12);
+ unsigned char buf[12];
+ unsigned char type = -1;
+ unsigned char section = -1;
+ short desc = -1;
+ unsigned long value = -1;
+ unsigned long stroff = -1;
+ unsigned int symtype = -1;
+
+ BFD_ASSERT (sym->strtab != NULL);
+
+ bfd_seek (abfd, symoff, SEEK_SET);
+ if (bfd_bread ((PTR) buf, 12, abfd) != 12)
+ {
+ fprintf (stderr, "bfd_mach_o_scan_read_symtab_symbol: unable to read %d bytes at %lu\n",
+ 12, (unsigned long) symoff);
+ return -1;
+ }
+
+ stroff = bfd_h_get_32 (abfd, buf);
+ type = bfd_h_get_8 (abfd, buf + 4);
+ symtype = (type & 0x0e);
+ section = bfd_h_get_8 (abfd, buf + 5) - 1;
+ desc = bfd_h_get_16 (abfd, buf + 6);
+ value = bfd_h_get_32 (abfd, buf + 8);
+
+ if (stroff >= sym->strsize)
+ {
+ fprintf (stderr, "bfd_mach_o_scan_read_symtab_symbol: symbol name out of range (%lu >= %lu)\n",
+ (unsigned long) stroff, (unsigned long) sym->strsize);
+ return -1;
+ }
+
+ s->the_bfd = abfd;
+ s->name = sym->strtab + stroff;
+ s->value = value;
+ s->udata.i = (type << 24) | (section << 16) | desc;
+ s->flags = 0x0;
+
+ if (type & BFD_MACH_O_N_STAB)
+ {
+ s->flags |= BSF_DEBUGGING;
+ s->section = bfd_und_section_ptr;
+ }
+ else
+ {
+ if (type & BFD_MACH_O_N_PEXT)
+ {
+ type &= ~BFD_MACH_O_N_PEXT;
+ s->flags |= BSF_GLOBAL;
+ }
+
+ if (type & BFD_MACH_O_N_EXT)
+ {
+ type &= ~BFD_MACH_O_N_EXT;
+ s->flags |= BSF_GLOBAL;
+ }
+
+ switch (symtype)
+ {
+ case BFD_MACH_O_N_UNDF:
+ s->section = bfd_und_section_ptr;
+ break;
+ case BFD_MACH_O_N_PBUD:
+ s->section = bfd_und_section_ptr;
+ break;
+ case BFD_MACH_O_N_ABS:
+ s->section = bfd_abs_section_ptr;
+ break;
+ case BFD_MACH_O_N_SECT:
+ if ((section > 0) && (section <= mdata->nsects))
+ {
+ s->section = mdata->sections[section - 1]->bfdsection;
+ s->value = s->value - mdata->sections[section - 1]->addr;
+ }
+ else
+ {
+ /* Mach-O uses 0 to mean "no section"; not an error. */
+ if (section != 0)
+ {
+ fprintf (stderr, "bfd_mach_o_scan_read_symtab_symbol: "
+ "symbol \"%s\" specified invalid section %d (max %lu): setting to undefined\n",
+ s->name, section, mdata->nsects);
+ }
+ s->section = bfd_und_section_ptr;
+ }
+ break;
+ case BFD_MACH_O_N_INDR:
+ fprintf (stderr, "bfd_mach_o_scan_read_symtab_symbol: "
+ "symbol \"%s\" is unsupported 'indirect' reference: setting to undefined\n",
+ s->name);
+ s->section = bfd_und_section_ptr;
+ break;
+ default:
+ fprintf (stderr, "bfd_mach_o_scan_read_symtab_symbol: "
+ "symbol \"%s\" specified invalid type field 0x%x: setting to undefined\n",
+ s->name, symtype);
+ s->section = bfd_und_section_ptr;
+ break;
+ }
+ }
+
+ return 0;
+}
+
+int
+bfd_mach_o_scan_read_symtab_strtab (abfd, sym)
+ bfd *abfd;
+ bfd_mach_o_symtab_command *sym;
+{
+ BFD_ASSERT (sym->strtab == NULL);
+
+ if (abfd->flags & BFD_IN_MEMORY)
+ {
+ struct bfd_in_memory *b;
+
+ b = (struct bfd_in_memory *) abfd->iostream;
+
+ if ((sym->stroff + sym->strsize) > b->size)
+ {
+ bfd_set_error (bfd_error_file_truncated);
+ return -1;
+ }
+ sym->strtab = b->buffer + sym->stroff;
+ return 0;
+ }
+
+ sym->strtab = bfd_alloc (abfd, sym->strsize);
+ if (sym->strtab == NULL)
+ return -1;
+
+ bfd_seek (abfd, sym->stroff, SEEK_SET);
+ if (bfd_bread ((PTR) sym->strtab, sym->strsize, abfd) != sym->strsize)
+ {
+ fprintf (stderr, "bfd_mach_o_scan_read_symtab_strtab: unable to read %lu bytes at %lu\n",
+ sym->strsize, sym->stroff);
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+bfd_mach_o_scan_read_symtab_symbols (abfd, sym)
+ bfd *abfd;
+ bfd_mach_o_symtab_command *sym;
+{
+ unsigned long i;
+ int ret;
+
+ BFD_ASSERT (sym->symbols == NULL);
+ sym->symbols = bfd_alloc (abfd, sym->nsyms * sizeof (asymbol));
+
+ if (sym->symbols == NULL)
+ {
+ fprintf (stderr, "bfd_mach_o_scan_read_symtab_symbols: unable to allocate memory for symbols\n");
+ return -1;
+ }
+
+ ret = bfd_mach_o_scan_read_symtab_strtab (abfd, sym);
+ if (ret != 0)
+ return ret;
+
+ for (i = 0; i < sym->nsyms; i++)
+ {
+ ret = bfd_mach_o_scan_read_symtab_symbol (abfd, sym, &sym->symbols[i], i);
+ if (ret != 0)
+ return ret;
+ }
+
+ return 0;
+}
+
+int
+bfd_mach_o_scan_read_dysymtab_symbol (abfd, dysym, sym, s, i)
+ bfd *abfd;
+ bfd_mach_o_dysymtab_command *dysym;
+ bfd_mach_o_symtab_command *sym;
+ asymbol *s;
+ unsigned long i;
+{
+ unsigned long isymoff = dysym->indirectsymoff + (i * 4);
+ unsigned long symindex;
+ unsigned char buf[4];
+
+ BFD_ASSERT (i < dysym->nindirectsyms);
+
+ bfd_seek (abfd, isymoff, SEEK_SET);
+ if (bfd_bread ((PTR) buf, 4, abfd) != 4)
+ {
+ fprintf (stderr, "bfd_mach_o_scan_read_dysymtab_symbol: unable to read %lu bytes at %lu\n",
+ (unsigned long) 4, isymoff);
+ return -1;
+ }
+ symindex = bfd_h_get_32 (abfd, buf);
+
+ return bfd_mach_o_scan_read_symtab_symbol (abfd, sym, s, symindex);
+}
+
+static const char *
+bfd_mach_o_i386_flavour_string (flavour)
+ unsigned int flavour;
+{
+ switch ((int) flavour)
+ {
+ case BFD_MACH_O_i386_NEW_THREAD_STATE: return "i386_NEW_THREAD_STATE";
+ case BFD_MACH_O_i386_FLOAT_STATE: return "i386_FLOAT_STATE";
+ case BFD_MACH_O_i386_ISA_PORT_MAP_STATE: return "i386_ISA_PORT_MAP_STATE";
+ case BFD_MACH_O_i386_V86_ASSIST_STATE: return "i386_V86_ASSIST_STATE";
+ case BFD_MACH_O_i386_REGS_SEGS_STATE: return "i386_REGS_SEGS_STATE";
+ case BFD_MACH_O_i386_THREAD_SYSCALL_STATE: return "i386_THREAD_SYSCALL_STATE";
+ case BFD_MACH_O_i386_THREAD_STATE_NONE: return "i386_THREAD_STATE_NONE";
+ case BFD_MACH_O_i386_SAVED_STATE: return "i386_SAVED_STATE";
+ case BFD_MACH_O_i386_THREAD_STATE: return "i386_THREAD_STATE";
+ case BFD_MACH_O_i386_THREAD_FPSTATE: return "i386_THREAD_FPSTATE";
+ case BFD_MACH_O_i386_THREAD_EXCEPTSTATE: return "i386_THREAD_EXCEPTSTATE";
+ case BFD_MACH_O_i386_THREAD_CTHREADSTATE: return "i386_THREAD_CTHREADSTATE";
+ default: return "UNKNOWN";
+ }
+}
+
+static const char *
+bfd_mach_o_ppc_flavour_string (flavour)
+ unsigned int flavour;
+{
+ switch ((int) flavour)
+ {
+ case BFD_MACH_O_PPC_THREAD_STATE: return "PPC_THREAD_STATE";
+ case BFD_MACH_O_PPC_FLOAT_STATE: return "PPC_FLOAT_STATE";
+ case BFD_MACH_O_PPC_EXCEPTION_STATE: return "PPC_EXCEPTION_STATE";
+ case BFD_MACH_O_PPC_VECTOR_STATE: return "PPC_VECTOR_STATE";
+ default: return "UNKNOWN";
+ }
+}
+
+static int
+bfd_mach_o_scan_write_thread (abfd, command)
+ bfd *abfd;
+ bfd_mach_o_load_command *command;
+{
+ bfd_mach_o_thread_command *cmd = &command->command.thread;
+ unsigned int i;
+ unsigned char buf[8];
+ bfd_vma offset;
+ unsigned int nflavours;
+
+ BFD_ASSERT ((command->type == BFD_MACH_O_LC_THREAD)
+ || (command->type == BFD_MACH_O_LC_UNIXTHREAD));
+
+ offset = 8;
+ nflavours = 0;
+ for (i = 0; i < cmd->nflavours; i++)
+ {
+ BFD_ASSERT ((cmd->flavours[i].size % 4) == 0);
+ BFD_ASSERT (cmd->flavours[i].offset == (command->offset + offset + 8));
+
+ bfd_h_put_32 (abfd, cmd->flavours[i].flavour, buf);
+ bfd_h_put_32 (abfd, (cmd->flavours[i].size / 4), buf + 4);
+
+ bfd_seek (abfd, command->offset + offset, SEEK_SET);
+ if (bfd_bwrite ((PTR) buf, 8, abfd) != 8)
+ return -1;
+
+ offset += cmd->flavours[i].size + 8;
+ }
+
+ return 0;
+}
+
+static int
+bfd_mach_o_scan_read_dylinker (abfd, command)
+ bfd *abfd;
+ bfd_mach_o_load_command *command;
+{
+ bfd_mach_o_dylinker_command *cmd = &command->command.dylinker;
+ unsigned char buf[4];
+ unsigned int nameoff;
+ asection *bfdsec;
+ char *sname;
+ const char *prefix;
+
+ BFD_ASSERT ((command->type == BFD_MACH_O_LC_ID_DYLINKER)
+ || (command->type == BFD_MACH_O_LC_LOAD_DYLINKER));
+
+ bfd_seek (abfd, command->offset + 8, SEEK_SET);
+ if (bfd_bread ((PTR) buf, 4, abfd) != 4)
+ return -1;
+
+ nameoff = bfd_h_get_32 (abfd, buf + 0);
+
+ cmd->name_offset = command->offset + nameoff;
+ cmd->name_len = command->len - nameoff;
+
+ if (command->type == BFD_MACH_O_LC_LOAD_DYLINKER)
+ prefix = "LC_LOAD_DYLINKER";
+ else if (command->type == BFD_MACH_O_LC_ID_DYLINKER)
+ prefix = "LC_ID_DYLINKER";
+ else
+ abort ();
+
+ sname = (char *) bfd_alloc (abfd, strlen (prefix) + 1);
+ if (sname == NULL)
+ return -1;
+ strcpy (sname, prefix);
+
+ bfdsec = bfd_make_section_anyway (abfd, sname);
+ if (bfdsec == NULL)
+ return -1;
+
+ bfdsec->vma = 0;
+ bfdsec->lma = 0;
+ bfdsec->_raw_size = command->len - 8;
+ bfdsec->filepos = command->offset + 8;
+ bfdsec->alignment_power = 0;
+ bfdsec->flags = SEC_HAS_CONTENTS;
+
+ cmd->section = bfdsec;
+
+ return 0;
+}
+
+static int
+bfd_mach_o_scan_read_dylib (abfd, command)
+ bfd *abfd;
+ bfd_mach_o_load_command *command;
+{
+ bfd_mach_o_dylib_command *cmd = &command->command.dylib;
+ unsigned char buf[16];
+ unsigned int nameoff;
+ asection *bfdsec;
+ char *sname;
+ const char *prefix;
+
+ BFD_ASSERT ((command->type == BFD_MACH_O_LC_ID_DYLIB)
+ || (command->type == BFD_MACH_O_LC_LOAD_DYLIB)
+ || (command->type == BFD_MACH_O_LC_LOAD_WEAK_DYLIB));
+
+ bfd_seek (abfd, command->offset + 8, SEEK_SET);
+ if (bfd_bread ((PTR) buf, 16, abfd) != 16)
+ return -1;
+
+ nameoff = bfd_h_get_32 (abfd, buf + 0);
+ cmd->timestamp = bfd_h_get_32 (abfd, buf + 4);
+ cmd->current_version = bfd_h_get_32 (abfd, buf + 8);
+ cmd->compatibility_version = bfd_h_get_32 (abfd, buf + 12);
+
+ cmd->name_offset = command->offset + nameoff;
+ cmd->name_len = command->len - nameoff;
+
+ if (command->type == BFD_MACH_O_LC_LOAD_DYLIB)
+ prefix = "LC_LOAD_DYLIB";
+ else if (command->type == BFD_MACH_O_LC_LOAD_WEAK_DYLIB)
+ prefix = "LC_LOAD_WEAK_DYLIB";
+ else if (command->type == BFD_MACH_O_LC_ID_DYLIB)
+ prefix = "LC_ID_DYLIB";
+ else
+ abort ();
+
+ sname = (char *) bfd_alloc (abfd, strlen (prefix) + 1);
+ if (sname == NULL)
+ return -1;
+ strcpy (sname, prefix);
+
+ bfdsec = bfd_make_section_anyway (abfd, sname);
+ if (bfdsec == NULL)
+ return -1;
+
+ bfdsec->vma = 0;
+ bfdsec->lma = 0;
+ bfdsec->_raw_size = command->len - 8;
+ bfdsec->filepos = command->offset + 8;
+ bfdsec->alignment_power = 0;
+ bfdsec->flags = SEC_HAS_CONTENTS;
+
+ cmd->section = bfdsec;
+
+ return 0;
+}
+
+static int
+bfd_mach_o_scan_read_prebound_dylib (abfd, command)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd_mach_o_load_command *command ATTRIBUTE_UNUSED;
+{
+ /* bfd_mach_o_prebound_dylib_command *cmd = &command->command.prebound_dylib; */
+
+ BFD_ASSERT (command->type == BFD_MACH_O_LC_PREBOUND_DYLIB);
+ return 0;
+}
+
+static int
+bfd_mach_o_scan_read_thread (abfd, command)
+ bfd *abfd;
+ bfd_mach_o_load_command *command;
+{
+ bfd_mach_o_data_struct *mdata = NULL;
+ bfd_mach_o_thread_command *cmd = &command->command.thread;
+ unsigned char buf[8];
+ bfd_vma offset;
+ unsigned int nflavours;
+ unsigned int i;
+
+ BFD_ASSERT ((command->type == BFD_MACH_O_LC_THREAD)
+ || (command->type == BFD_MACH_O_LC_UNIXTHREAD));
+
+ BFD_ASSERT (bfd_mach_o_valid (abfd));
+ mdata = abfd->tdata.mach_o_data;
+
+ offset = 8;
+ nflavours = 0;
+ while (offset != command->len)
+ {
+ if (offset >= command->len)
+ return -1;
+
+ bfd_seek (abfd, command->offset + offset, SEEK_SET);
+
+ if (bfd_bread ((PTR) buf, 8, abfd) != 8)
+ return -1;
+
+ offset += 8 + bfd_h_get_32 (abfd, buf + 4) * 4;
+ nflavours++;
+ }
+
+ cmd->flavours =
+ ((bfd_mach_o_thread_flavour *)
+ bfd_alloc (abfd, nflavours * sizeof (bfd_mach_o_thread_flavour)));
+ if (cmd->flavours == NULL)
+ return -1;
+ cmd->nflavours = nflavours;
+
+ offset = 8;
+ nflavours = 0;
+ while (offset != command->len)
+ {
+ if (offset >= command->len)
+ return -1;
+
+ if (nflavours >= cmd->nflavours)
+ return -1;
+
+ bfd_seek (abfd, command->offset + offset, SEEK_SET);
+
+ if (bfd_bread ((PTR) buf, 8, abfd) != 8)
+ return -1;
+
+ cmd->flavours[nflavours].flavour = bfd_h_get_32 (abfd, buf);
+ cmd->flavours[nflavours].offset = command->offset + offset + 8;
+ cmd->flavours[nflavours].size = bfd_h_get_32 (abfd, buf + 4) * 4;
+ offset += cmd->flavours[nflavours].size + 8;
+ nflavours++;
+ }
+
+ for (i = 0; i < nflavours; i++)
+ {
+ asection *bfdsec;
+ unsigned int snamelen;
+ char *sname;
+ const char *flavourstr;
+ const char *prefix = "LC_THREAD";
+ unsigned int j = 0;
+
+ switch (mdata->header.cputype)
+ {
+ case BFD_MACH_O_CPU_TYPE_POWERPC:
+ flavourstr = bfd_mach_o_ppc_flavour_string (cmd->flavours[i].flavour);
+ break;
+ case BFD_MACH_O_CPU_TYPE_I386:
+ flavourstr = bfd_mach_o_i386_flavour_string (cmd->flavours[i].flavour);
+ break;
+ default:
+ flavourstr = "UNKNOWN_ARCHITECTURE";
+ break;
+ }
+
+ snamelen = strlen (prefix) + 1 + 20 + 1 + strlen (flavourstr) + 1;
+ sname = (char *) bfd_alloc (abfd, snamelen);
+ if (sname == NULL)
+ return -1;
+
+ for (;;)
+ {
+ sprintf (sname, "%s.%s.%u", prefix, flavourstr, j);
+ if (bfd_get_section_by_name (abfd, sname) == NULL)
+ break;
+ j++;
+ }
+
+ bfdsec = bfd_make_section (abfd, sname);
+
+ bfdsec->vma = 0;
+ bfdsec->lma = 0;
+ bfdsec->_raw_size = cmd->flavours[i].size;
+ bfdsec->filepos = cmd->flavours[i].offset;
+ bfdsec->alignment_power = 0x0;
+ bfdsec->flags = SEC_HAS_CONTENTS;
+
+ cmd->section = bfdsec;
+ }
+
+ return 0;
+}
+
+static int
+bfd_mach_o_scan_write_symtab (abfd, command)
+ bfd *abfd;
+ bfd_mach_o_load_command *command;
+{
+ bfd_mach_o_symtab_command *seg = &command->command.symtab;
+ unsigned char buf[16];
+
+ BFD_ASSERT (command->type == BFD_MACH_O_LC_SYMTAB);
+
+ bfd_h_put_32 (abfd, seg->symoff, buf);
+ bfd_h_put_32 (abfd, seg->nsyms, buf + 4);
+ bfd_h_put_32 (abfd, seg->stroff, buf + 8);
+ bfd_h_put_32 (abfd, seg->strsize, buf + 12);
+
+ bfd_seek (abfd, command->offset + 8, SEEK_SET);
+ if (bfd_bwrite ((PTR) buf, 16, abfd) != 16)
+ return -1;
+
+ if (bfd_mach_o_scan_write_symtab_symbols (abfd, command) != 0)
+ return -1;
+
+ return 0;
+}
+
+static int
+bfd_mach_o_scan_read_dysymtab (abfd, command)
+ bfd *abfd;
+ bfd_mach_o_load_command *command;
+{
+ bfd_mach_o_dysymtab_command *seg = &command->command.dysymtab;
+ unsigned char buf[72];
+
+ BFD_ASSERT (command->type == BFD_MACH_O_LC_DYSYMTAB);
+
+ bfd_seek (abfd, command->offset + 8, SEEK_SET);
+ if (bfd_bread ((PTR) buf, 72, abfd) != 72)
+ return -1;
+
+ seg->ilocalsym = bfd_h_get_32 (abfd, buf + 0);
+ seg->nlocalsym = bfd_h_get_32 (abfd, buf + 4);
+ seg->iextdefsym = bfd_h_get_32 (abfd, buf + 8);
+ seg->nextdefsym = bfd_h_get_32 (abfd, buf + 12);
+ seg->iundefsym = bfd_h_get_32 (abfd, buf + 16);
+ seg->nundefsym = bfd_h_get_32 (abfd, buf + 20);
+ seg->tocoff = bfd_h_get_32 (abfd, buf + 24);
+ seg->ntoc = bfd_h_get_32 (abfd, buf + 28);
+ seg->modtaboff = bfd_h_get_32 (abfd, buf + 32);
+ seg->nmodtab = bfd_h_get_32 (abfd, buf + 36);
+ seg->extrefsymoff = bfd_h_get_32 (abfd, buf + 40);
+ seg->nextrefsyms = bfd_h_get_32 (abfd, buf + 44);
+ seg->indirectsymoff = bfd_h_get_32 (abfd, buf + 48);
+ seg->nindirectsyms = bfd_h_get_32 (abfd, buf + 52);
+ seg->extreloff = bfd_h_get_32 (abfd, buf + 56);
+ seg->nextrel = bfd_h_get_32 (abfd, buf + 60);
+ seg->locreloff = bfd_h_get_32 (abfd, buf + 64);
+ seg->nlocrel = bfd_h_get_32 (abfd, buf + 68);
+
+ return 0;
+}
+
+static int
+bfd_mach_o_scan_read_symtab (abfd, command)
+ bfd *abfd;
+ bfd_mach_o_load_command *command;
+{
+ bfd_mach_o_symtab_command *seg = &command->command.symtab;
+ unsigned char buf[16];
+ asection *bfdsec;
+ char *sname;
+ const char *prefix = "LC_SYMTAB.stabs";
+
+ BFD_ASSERT (command->type == BFD_MACH_O_LC_SYMTAB);
+
+ bfd_seek (abfd, command->offset + 8, SEEK_SET);
+ if (bfd_bread ((PTR) buf, 16, abfd) != 16)
+ return -1;
+
+ seg->symoff = bfd_h_get_32 (abfd, buf);
+ seg->nsyms = bfd_h_get_32 (abfd, buf + 4);
+ seg->stroff = bfd_h_get_32 (abfd, buf + 8);
+ seg->strsize = bfd_h_get_32 (abfd, buf + 12);
+ seg->symbols = NULL;
+ seg->strtab = NULL;
+
+ sname = (char *) bfd_alloc (abfd, strlen (prefix) + 1);
+ if (sname == NULL)
+ return -1;
+ strcpy (sname, prefix);
+
+ bfdsec = bfd_make_section_anyway (abfd, sname);
+ if (bfdsec == NULL)
+ return -1;
+
+ bfdsec->vma = 0;
+ bfdsec->lma = 0;
+ bfdsec->_raw_size = seg->nsyms * 12;
+ bfdsec->filepos = seg->symoff;
+ bfdsec->alignment_power = 0;
+ bfdsec->flags = SEC_HAS_CONTENTS;
+
+ seg->stabs_segment = bfdsec;
+
+ prefix = "LC_SYMTAB.stabstr";
+ sname = (char *) bfd_alloc (abfd, strlen (prefix) + 1);
+ if (sname == NULL)
+ return -1;
+ strcpy (sname, prefix);
+
+ bfdsec = bfd_make_section_anyway (abfd, sname);
+ if (bfdsec == NULL)
+ return -1;
+
+ bfdsec->vma = 0;
+ bfdsec->lma = 0;
+ bfdsec->_raw_size = seg->strsize;
+ bfdsec->filepos = seg->stroff;
+ bfdsec->alignment_power = 0;
+ bfdsec->flags = SEC_HAS_CONTENTS;
+
+ seg->stabstr_segment = bfdsec;
+
+ return 0;
+}
+
+static int
+bfd_mach_o_scan_read_segment (abfd, command)
+ bfd *abfd;
+ bfd_mach_o_load_command *command;
+{
+ unsigned char buf[48];
+ bfd_mach_o_segment_command *seg = &command->command.segment;
+ unsigned long i;
+ asection *bfdsec;
+ char *sname;
+ const char *prefix = "LC_SEGMENT";
+ unsigned int snamelen;
+
+ BFD_ASSERT (command->type == BFD_MACH_O_LC_SEGMENT);
+
+ bfd_seek (abfd, command->offset + 8, SEEK_SET);
+ if (bfd_bread ((PTR) buf, 48, abfd) != 48)
+ return -1;
+
+ memcpy (seg->segname, buf, 16);
+ seg->vmaddr = bfd_h_get_32 (abfd, buf + 16);
+ seg->vmsize = bfd_h_get_32 (abfd, buf + 20);
+ seg->fileoff = bfd_h_get_32 (abfd, buf + 24);
+ seg->filesize = bfd_h_get_32 (abfd, buf + 28);
+ /* seg->maxprot = bfd_h_get_32 (abfd, buf + 32); */
+ /* seg->initprot = bfd_h_get_32 (abfd, buf + 36); */
+ seg->nsects = bfd_h_get_32 (abfd, buf + 40);
+ seg->flags = bfd_h_get_32 (abfd, buf + 44);
+
+ snamelen = strlen (prefix) + 1 + strlen (seg->segname) + 1;
+ sname = (char *) bfd_alloc (abfd, snamelen);
+ if (sname == NULL)
+ return -1;
+ sprintf (sname, "%s.%s", prefix, seg->segname);
+
+ bfdsec = bfd_make_section_anyway (abfd, sname);
+ if (bfdsec == NULL)
+ return -1;
+
+ bfdsec->vma = seg->vmaddr;
+ bfdsec->lma = seg->vmaddr;
+ bfdsec->_raw_size = seg->filesize;
+ bfdsec->filepos = seg->fileoff;
+ bfdsec->alignment_power = 0x0;
+ bfdsec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_CODE;
+
+ seg->segment = bfdsec;
+
+ if (seg->nsects != 0)
+ {
+ seg->sections =
+ ((bfd_mach_o_section *)
+ bfd_alloc (abfd, seg->nsects * sizeof (bfd_mach_o_section)));
+ if (seg->sections == NULL)
+ return -1;
+
+ for (i = 0; i < seg->nsects; i++)
+ {
+ bfd_vma segoff = command->offset + 48 + 8 + (i * 68);
+
+ if (bfd_mach_o_scan_read_section (abfd, &seg->sections[i],
+ segoff) != 0)
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static int
+bfd_mach_o_scan_write_segment (abfd, command)
+ bfd *abfd;
+ bfd_mach_o_load_command *command;
+{
+ unsigned char buf[48];
+ bfd_mach_o_segment_command *seg = &command->command.segment;
+ unsigned long i;
+
+ BFD_ASSERT (command->type == BFD_MACH_O_LC_SEGMENT);
+
+ memcpy (buf, seg->segname, 16);
+ bfd_h_put_32 (abfd, seg->vmaddr, buf + 16);
+ bfd_h_put_32 (abfd, seg->vmsize, buf + 20);
+ bfd_h_put_32 (abfd, seg->fileoff, buf + 24);
+ bfd_h_put_32 (abfd, seg->filesize, buf + 28);
+ bfd_h_put_32 (abfd, 0 /* seg->maxprot */, buf + 32);
+ bfd_h_put_32 (abfd, 0 /* seg->initprot */, buf + 36);
+ bfd_h_put_32 (abfd, seg->nsects, buf + 40);
+ bfd_h_put_32 (abfd, seg->flags, buf + 44);
+
+ bfd_seek (abfd, command->offset + 8, SEEK_SET);
+ if (bfd_bwrite ((PTR) buf, 48, abfd) != 48)
+ return -1;
+
+ {
+ char buf[1024];
+ bfd_vma nbytes = seg->filesize;
+ bfd_vma curoff = seg->fileoff;
+
+ while (nbytes > 0)
+ {
+ bfd_vma thisread = nbytes;
+
+ if (thisread > 1024)
+ thisread = 1024;
+
+ bfd_seek (abfd, curoff, SEEK_SET);
+ if (bfd_bread ((PTR) buf, thisread, abfd) != thisread)
+ return -1;
+
+ bfd_seek (abfd, curoff, SEEK_SET);
+ if (bfd_bwrite ((PTR) buf, thisread, abfd) != thisread)
+ return -1;
+
+ nbytes -= thisread;
+ curoff += thisread;
+ }
+ }
+
+ for (i = 0; i < seg->nsects; i++)
+ {
+ bfd_vma segoff = command->offset + 48 + 8 + (i * 68);
+
+ if (bfd_mach_o_scan_write_section (abfd, &seg->sections[i], segoff) != 0)
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+bfd_mach_o_scan_read_command (abfd, command)
+ bfd *abfd;
+ bfd_mach_o_load_command *command;
+{
+ unsigned char buf[8];
+
+ bfd_seek (abfd, command->offset, SEEK_SET);
+ if (bfd_bread ((PTR) buf, 8, abfd) != 8)
+ return -1;
+
+ command->type = (bfd_h_get_32 (abfd, buf) & ~BFD_MACH_O_LC_REQ_DYLD);
+ command->type_required = (bfd_h_get_32 (abfd, buf) & BFD_MACH_O_LC_REQ_DYLD
+ ? 1 : 0);
+ command->len = bfd_h_get_32 (abfd, buf + 4);
+
+ switch (command->type)
+ {
+ case BFD_MACH_O_LC_SEGMENT:
+ if (bfd_mach_o_scan_read_segment (abfd, command) != 0)
+ return -1;
+ break;
+ case BFD_MACH_O_LC_SYMTAB:
+ if (bfd_mach_o_scan_read_symtab (abfd, command) != 0)
+ return -1;
+ break;
+ case BFD_MACH_O_LC_SYMSEG:
+ break;
+ case BFD_MACH_O_LC_THREAD:
+ case BFD_MACH_O_LC_UNIXTHREAD:
+ if (bfd_mach_o_scan_read_thread (abfd, command) != 0)
+ return -1;
+ break;
+ case BFD_MACH_O_LC_LOAD_DYLINKER:
+ case BFD_MACH_O_LC_ID_DYLINKER:
+ if (bfd_mach_o_scan_read_dylinker (abfd, command) != 0)
+ return -1;
+ break;
+ case BFD_MACH_O_LC_LOAD_DYLIB:
+ case BFD_MACH_O_LC_ID_DYLIB:
+ case BFD_MACH_O_LC_LOAD_WEAK_DYLIB:
+ if (bfd_mach_o_scan_read_dylib (abfd, command) != 0)
+ return -1;
+ break;
+ case BFD_MACH_O_LC_PREBOUND_DYLIB:
+ if (bfd_mach_o_scan_read_prebound_dylib (abfd, command) != 0)
+ return -1;
+ break;
+ case BFD_MACH_O_LC_LOADFVMLIB:
+ case BFD_MACH_O_LC_IDFVMLIB:
+ case BFD_MACH_O_LC_IDENT:
+ case BFD_MACH_O_LC_FVMFILE:
+ case BFD_MACH_O_LC_PREPAGE:
+ case BFD_MACH_O_LC_ROUTINES:
+ case BFD_MACH_O_LC_SUB_FRAMEWORK:
+ break;
+ case BFD_MACH_O_LC_DYSYMTAB:
+ if (bfd_mach_o_scan_read_dysymtab (abfd, command) != 0)
+ return -1;
+ break;
+ case BFD_MACH_O_LC_SUB_UMBRELLA:
+ case BFD_MACH_O_LC_SUB_CLIENT:
+ case BFD_MACH_O_LC_SUB_LIBRARY:
+ case BFD_MACH_O_LC_TWOLEVEL_HINTS:
+ case BFD_MACH_O_LC_PREBIND_CKSUM:
+ break;
+ default:
+ fprintf (stderr, "unable to read unknown load command 0x%lx\n",
+ (unsigned long) command->type);
+ break;
+ }
+
+ return 0;
+}
+
+static void
+bfd_mach_o_flatten_sections (abfd)
+ bfd *abfd;
+{
+ bfd_mach_o_data_struct *mdata = abfd->tdata.mach_o_data;
+ long csect = 0;
+ unsigned long i, j;
+
+ mdata->nsects = 0;
+
+ for (i = 0; i < mdata->header.ncmds; i++)
+ {
+ if (mdata->commands[i].type == BFD_MACH_O_LC_SEGMENT)
+ {
+ bfd_mach_o_segment_command *seg;
+
+ seg = &mdata->commands[i].command.segment;
+ mdata->nsects += seg->nsects;
+ }
+ }
+
+ mdata->sections = bfd_alloc (abfd,
+ mdata->nsects * sizeof (bfd_mach_o_section *));
+ csect = 0;
+
+ for (i = 0; i < mdata->header.ncmds; i++)
+ {
+ if (mdata->commands[i].type == BFD_MACH_O_LC_SEGMENT)
+ {
+ bfd_mach_o_segment_command *seg;
+
+ seg = &mdata->commands[i].command.segment;
+ BFD_ASSERT (csect + seg->nsects <= mdata->nsects);
+
+ for (j = 0; j < seg->nsects; j++)
+ mdata->sections[csect++] = &seg->sections[j];
+ }
+ }
+}
+
+int
+bfd_mach_o_scan_start_address (abfd)
+ bfd *abfd;
+{
+ bfd_mach_o_data_struct *mdata = abfd->tdata.mach_o_data;
+ bfd_mach_o_thread_command *cmd = NULL;
+ unsigned long i;
+
+ for (i = 0; i < mdata->header.ncmds; i++)
+ {
+ if ((mdata->commands[i].type == BFD_MACH_O_LC_THREAD) ||
+ (mdata->commands[i].type == BFD_MACH_O_LC_UNIXTHREAD))
+ {
+ if (cmd == NULL)
+ cmd = &mdata->commands[i].command.thread;
+ else
+ return 0;
+ }
+ }
+
+ if (cmd == NULL)
+ return 0;
+
+ for (i = 0; i < cmd->nflavours; i++)
+ {
+ if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_I386)
+ && (cmd->flavours[i].flavour
+ == (unsigned long) BFD_MACH_O_i386_THREAD_STATE))
+ {
+ unsigned char buf[4];
+
+ bfd_seek (abfd, cmd->flavours[i].offset + 40, SEEK_SET);
+
+ if (bfd_bread (buf, 4, abfd) != 4)
+ return -1;
+
+ abfd->start_address = bfd_h_get_32 (abfd, buf);
+ }
+ else if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_POWERPC)
+ && (cmd->flavours[i].flavour == BFD_MACH_O_PPC_THREAD_STATE))
+ {
+ unsigned char buf[4];
+
+ bfd_seek (abfd, cmd->flavours[i].offset + 0, SEEK_SET);
+
+ if (bfd_bread (buf, 4, abfd) != 4)
+ return -1;
+
+ abfd->start_address = bfd_h_get_32 (abfd, buf);
+ }
+ }
+
+ return 0;
+}
+
+int
+bfd_mach_o_scan (abfd, header, mdata)
+ bfd *abfd;
+ bfd_mach_o_header *header;
+ bfd_mach_o_data_struct *mdata;
+{
+ unsigned int i;
+ enum bfd_architecture cputype;
+ unsigned long cpusubtype;
+
+ mdata->header = *header;
+ mdata->symbols = NULL;
+
+ abfd->flags = (abfd->xvec->object_flags
+ | (abfd->flags & (BFD_IN_MEMORY | BFD_IO_FUNCS)));
+ abfd->tdata.mach_o_data = mdata;
+
+ bfd_mach_o_convert_architecture (header->cputype, header->cpusubtype,
+ &cputype, &cpusubtype);
+ if (cputype == bfd_arch_unknown)
+ {
+ fprintf (stderr, "bfd_mach_o_scan: unknown architecture 0x%lx/0x%lx\n",
+ header->cputype, header->cpusubtype);
+ return -1;
+ }
+
+ bfd_set_arch_mach (abfd, cputype, cpusubtype);
+
+ if (header->ncmds != 0)
+ {
+ mdata->commands =
+ ((bfd_mach_o_load_command *)
+ bfd_alloc (abfd, header->ncmds * sizeof (bfd_mach_o_load_command)));
+ if (mdata->commands == NULL)
+ return -1;
+
+ for (i = 0; i < header->ncmds; i++)
+ {
+ bfd_mach_o_load_command *cur = &mdata->commands[i];
+
+ if (i == 0)
+ cur->offset = 28;
+ else
+ {
+ bfd_mach_o_load_command *prev = &mdata->commands[i - 1];
+ cur->offset = prev->offset + prev->len;
+ }
+
+ if (bfd_mach_o_scan_read_command (abfd, cur) < 0)
+ return -1;
+ }
+ }
+
+ if (bfd_mach_o_scan_start_address (abfd) < 0)
+ {
+#if 0
+ fprintf (stderr, "bfd_mach_o_scan: unable to scan start address: %s\n",
+ bfd_errmsg (bfd_get_error ()));
+ abfd->tdata.mach_o_data = NULL;
+ return -1;
+#endif
+ }
+
+ bfd_mach_o_flatten_sections (abfd);
+
+ return 0;
+}
+
+boolean
+bfd_mach_o_mkobject (abfd)
+ bfd *abfd;
+{
+ bfd_mach_o_data_struct *mdata = NULL;
+
+ mdata = ((bfd_mach_o_data_struct *)
+ bfd_alloc (abfd, sizeof (bfd_mach_o_data_struct)));
+ if (mdata == NULL)
+ return false;
+ abfd->tdata.mach_o_data = mdata;
+
+ mdata->header.magic = 0;
+ mdata->header.cputype = 0;
+ mdata->header.cpusubtype = 0;
+ mdata->header.filetype = 0;
+ mdata->header.ncmds = 0;
+ mdata->header.sizeofcmds = 0;
+ mdata->header.flags = 0;
+ mdata->header.byteorder = BFD_ENDIAN_UNKNOWN;
+ mdata->commands = NULL;
+ mdata->nsymbols = 0;
+ mdata->symbols = NULL;
+ mdata->nsects = 0;
+ mdata->sections = NULL;
+ mdata->ibfd = NULL;
+
+ return true;
+}
+
+const bfd_target *
+bfd_mach_o_object_p (abfd)
+ bfd *abfd;
+{
+ struct bfd_preserve preserve;
+ bfd_mach_o_header header;
+
+ preserve.marker = NULL;
+ if (bfd_mach_o_read_header (abfd, &header) != 0)
+ goto wrong;
+
+ if (! (header.byteorder == BFD_ENDIAN_BIG
+ || header.byteorder == BFD_ENDIAN_LITTLE))
+ {
+ fprintf (stderr, "unknown header byte-order value 0x%lx\n",
+ (long) header.byteorder);
+ goto wrong;
+ }
+
+ if (! ((header.byteorder == BFD_ENDIAN_BIG
+ && abfd->xvec->byteorder == BFD_ENDIAN_BIG
+ && abfd->xvec->header_byteorder == BFD_ENDIAN_BIG)
+ || (header.byteorder == BFD_ENDIAN_LITTLE
+ && abfd->xvec->byteorder == BFD_ENDIAN_LITTLE
+ && abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE)))
+ goto wrong;
+
+ preserve.marker = bfd_zalloc (abfd, sizeof (bfd_mach_o_data_struct));
+ if (preserve.marker == NULL
+ || !bfd_preserve_save (abfd, &preserve))
+ goto fail;
+
+ if (bfd_mach_o_scan (abfd, &header,
+ (bfd_mach_o_data_struct *) preserve.marker) != 0)
+ goto wrong;
+
+ bfd_preserve_finish (abfd, &preserve);
+ return abfd->xvec;
+
+ wrong:
+ bfd_set_error (bfd_error_wrong_format);
+
+ fail:
+ if (preserve.marker != NULL)
+ bfd_preserve_restore (abfd, &preserve);
+ return NULL;
+}
+
+const bfd_target *
+bfd_mach_o_core_p (abfd)
+ bfd *abfd;
+{
+ struct bfd_preserve preserve;
+ bfd_mach_o_header header;
+
+ preserve.marker = NULL;
+ if (bfd_mach_o_read_header (abfd, &header) != 0)
+ goto wrong;
+
+ if (! (header.byteorder == BFD_ENDIAN_BIG
+ || header.byteorder == BFD_ENDIAN_LITTLE))
+ {
+ fprintf (stderr, "unknown header byte-order value 0x%lx\n",
+ (long) header.byteorder);
+ abort ();
+ }
+
+ if (! ((header.byteorder == BFD_ENDIAN_BIG
+ && abfd->xvec->byteorder == BFD_ENDIAN_BIG
+ && abfd->xvec->header_byteorder == BFD_ENDIAN_BIG)
+ || (header.byteorder == BFD_ENDIAN_LITTLE
+ && abfd->xvec->byteorder == BFD_ENDIAN_LITTLE
+ && abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE)))
+ goto wrong;
+
+ if (header.filetype != BFD_MACH_O_MH_CORE)
+ goto wrong;
+
+ preserve.marker = bfd_zalloc (abfd, sizeof (bfd_mach_o_data_struct));
+ if (preserve.marker == NULL
+ || !bfd_preserve_save (abfd, &preserve))
+ goto fail;
+
+ if (bfd_mach_o_scan (abfd, &header,
+ (bfd_mach_o_data_struct *) preserve.marker) != 0)
+ goto wrong;
+
+ bfd_preserve_finish (abfd, &preserve);
+ return abfd->xvec;
+
+ wrong:
+ bfd_set_error (bfd_error_wrong_format);
+
+ fail:
+ if (preserve.marker != NULL)
+ bfd_preserve_restore (abfd, &preserve);
+ return NULL;
+}
+
+typedef struct mach_o_fat_archentry
+{
+ unsigned long cputype;
+ unsigned long cpusubtype;
+ unsigned long offset;
+ unsigned long size;
+ unsigned long align;
+ bfd *abfd;
+} mach_o_fat_archentry;
+
+typedef struct mach_o_fat_data_struct
+{
+ unsigned long magic;
+ unsigned long nfat_arch;
+ mach_o_fat_archentry *archentries;
+} mach_o_fat_data_struct;
+
+const bfd_target *
+bfd_mach_o_archive_p (abfd)
+ bfd *abfd;
+{
+ mach_o_fat_data_struct *adata = NULL;
+ unsigned char buf[20];
+ unsigned long i;
+
+ bfd_seek (abfd, 0, SEEK_SET);
+ if (bfd_bread ((PTR) buf, 8, abfd) != 8)
+ goto error;
+
+ adata = (mach_o_fat_data_struct *)
+ bfd_alloc (abfd, sizeof (mach_o_fat_data_struct));
+ if (adata == NULL)
+ goto error;
+
+ adata->magic = bfd_getb32 (buf);
+ adata->nfat_arch = bfd_getb32 (buf + 4);
+ if (adata->magic != 0xcafebabe)
+ goto error;
+
+ adata->archentries = (mach_o_fat_archentry *)
+ bfd_alloc (abfd, adata->nfat_arch * sizeof (mach_o_fat_archentry));
+ if (adata->archentries == NULL)
+ goto error;
+
+ for (i = 0; i < adata->nfat_arch; i++)
+ {
+ bfd_seek (abfd, 8 + 20 * i, SEEK_SET);
+
+ if (bfd_bread ((PTR) buf, 20, abfd) != 20)
+ goto error;
+ adata->archentries[i].cputype = bfd_getb32 (buf);
+ adata->archentries[i].cpusubtype = bfd_getb32 (buf + 4);
+ adata->archentries[i].offset = bfd_getb32 (buf + 8);
+ adata->archentries[i].size = bfd_getb32 (buf + 12);
+ adata->archentries[i].align = bfd_getb32 (buf + 16);
+ adata->archentries[i].abfd = NULL;
+ }
+
+ abfd->tdata.mach_o_fat_data = adata;
+ return abfd->xvec;
+
+ error:
+ if (adata != NULL)
+ bfd_release (abfd, adata);
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+}
+
+bfd *
+bfd_mach_o_openr_next_archived_file (archive, prev)
+ bfd *archive;
+ bfd *prev;
+{
+ mach_o_fat_data_struct *adata;
+ mach_o_fat_archentry *entry = NULL;
+ unsigned long i;
+
+ adata = (mach_o_fat_data_struct *) archive->tdata.mach_o_fat_data;
+ BFD_ASSERT (adata != NULL);
+
+ /* Find index of previous entry. */
+ if (prev == NULL)
+ i = 0; /* Start at first one. */
+ else
+ {
+ for (i = 0; i < adata->nfat_arch; i++)
+ {
+ if (adata->archentries[i].abfd == prev)
+ break;
+ }
+
+ if (i == adata->nfat_arch)
+ {
+ /* Not found. */
+ bfd_set_error (bfd_error_bad_value);
+ return NULL;
+ }
+ i++; /* Get next entry. */
+ }
+
+ if (i >= adata->nfat_arch)
+ {
+ bfd_set_error (bfd_error_no_more_archived_files);
+ return NULL;
+ }
+
+ entry = &adata->archentries[i];
+ if (entry->abfd == NULL)
+ {
+ bfd *nbfd = _bfd_new_bfd_contained_in (archive);
+ char *s = NULL;
+
+ if (nbfd == NULL)
+ return NULL;
+
+ nbfd->origin = entry->offset;
+ s = bfd_malloc (strlen (archive->filename) + 1);
+ if (s == NULL)
+ return NULL;
+ strcpy (s, archive->filename);
+ nbfd->filename = s;
+ nbfd->iostream = NULL;
+ entry->abfd = nbfd;
+ }
+
+ return entry->abfd;
+}
+
+int
+bfd_mach_o_lookup_section (abfd, section, mcommand, msection)
+ bfd *abfd;
+ asection *section;
+ bfd_mach_o_load_command **mcommand;
+ bfd_mach_o_section **msection;
+{
+ struct mach_o_data_struct *md = abfd->tdata.mach_o_data;
+ unsigned int i, j, num;
+
+ bfd_mach_o_load_command *ncmd = NULL;
+ bfd_mach_o_section *nsect = NULL;
+
+ BFD_ASSERT (mcommand != NULL);
+ BFD_ASSERT (msection != NULL);
+
+ num = 0;
+ for (i = 0; i < md->header.ncmds; i++)
+ {
+ struct bfd_mach_o_load_command *cmd = &md->commands[i];
+ struct bfd_mach_o_segment_command *seg = NULL;
+
+ if (cmd->type != BFD_MACH_O_LC_SEGMENT)
+ continue;
+ seg = &cmd->command.segment;
+
+ if (seg->segment == section)
+ {
+ if (num == 0)
+ ncmd = cmd;
+ num++;
+ }
+
+ for (j = 0; j < seg->nsects; j++)
+ {
+ struct bfd_mach_o_section *sect = &seg->sections[j];
+
+ if (sect->bfdsection == section)
+ {
+ if (num == 0)
+ nsect = sect;
+ num++;
+ }
+ }
+ }
+
+ *mcommand = ncmd;
+ *msection = nsect;
+ return num;
+}
+
+int
+bfd_mach_o_lookup_command (abfd, type, mcommand)
+ bfd *abfd;
+ bfd_mach_o_load_command_type type;
+ bfd_mach_o_load_command **mcommand;
+{
+ struct mach_o_data_struct *md = NULL;
+ bfd_mach_o_load_command *ncmd = NULL;
+ unsigned int i, num;
+
+ md = abfd->tdata.mach_o_data;
+
+ BFD_ASSERT (md != NULL);
+ BFD_ASSERT (mcommand != NULL);
+
+ num = 0;
+ for (i = 0; i < md->header.ncmds; i++)
+ {
+ struct bfd_mach_o_load_command *cmd = &md->commands[i];
+
+ if (cmd->type != type)
+ continue;
+
+ if (num == 0)
+ ncmd = cmd;
+ num++;
+ }
+
+ *mcommand = ncmd;
+ return num;
+}
+
+unsigned long
+bfd_mach_o_stack_addr (type)
+ enum bfd_mach_o_cpu_type type;
+{
+ switch (type)
+ {
+ case BFD_MACH_O_CPU_TYPE_MC680x0:
+ return 0x04000000;
+ case BFD_MACH_O_CPU_TYPE_MC88000:
+ return 0xffffe000;
+ case BFD_MACH_O_CPU_TYPE_POWERPC:
+ return 0xc0000000;
+ case BFD_MACH_O_CPU_TYPE_I386:
+ return 0xc0000000;
+ case BFD_MACH_O_CPU_TYPE_SPARC:
+ return 0xf0000000;
+ case BFD_MACH_O_CPU_TYPE_I860:
+ return 0;
+ case BFD_MACH_O_CPU_TYPE_HPPA:
+ return 0xc0000000 - 0x04000000;
+ default:
+ return 0;
+ }
+}
+
+int
+bfd_mach_o_core_fetch_environment (abfd, rbuf, rlen)
+ bfd *abfd;
+ unsigned char **rbuf;
+ unsigned int *rlen;
+{
+ bfd_mach_o_data_struct *mdata = abfd->tdata.mach_o_data;
+ unsigned long stackaddr = bfd_mach_o_stack_addr (mdata->header.cputype);
+ unsigned int i = 0;
+
+ for (i = 0; i < mdata->header.ncmds; i++)
+ {
+ bfd_mach_o_load_command *cur = &mdata->commands[i];
+ bfd_mach_o_segment_command *seg = NULL;
+
+ if (cur->type != BFD_MACH_O_LC_SEGMENT)
+ continue;
+
+ seg = &cur->command.segment;
+
+ if ((seg->vmaddr + seg->vmsize) == stackaddr)
+ {
+ unsigned long start = seg->fileoff;
+ unsigned long end = seg->fileoff + seg->filesize;
+ unsigned char *buf = bfd_malloc (1024);
+ unsigned long size = 1024;
+
+ for (;;)
+ {
+ bfd_size_type nread = 0;
+ unsigned long offset;
+ int found_nonnull = 0;
+
+ if (size > (end - start))
+ size = (end - start);
+
+ buf = bfd_realloc (buf, size);
+
+ bfd_seek (abfd, end - size, SEEK_SET);
+ nread = bfd_bread (buf, size, abfd);
+
+ if (nread != size)
+ return -1;
+
+ for (offset = 4; offset <= size; offset += 4)
+ {
+ unsigned long val;
+
+ val = *((unsigned long *) (buf + size - offset));
+ if (! found_nonnull)
+ {
+ if (val != 0)
+ found_nonnull = 1;
+ }
+ else if (val == 0x0)
+ {
+ unsigned long bottom;
+ unsigned long top;
+
+ bottom = seg->fileoff + seg->filesize - offset;
+ top = seg->fileoff + seg->filesize - 4;
+ *rbuf = bfd_malloc (top - bottom);
+ *rlen = top - bottom;
+
+ memcpy (*rbuf, buf + size - *rlen, *rlen);
+ return 0;
+ }
+ }
+
+ if (size == (end - start))
+ break;
+
+ size *= 2;
+ }
+ }
+ }
+
+ return -1;
+}
+
+char *
+bfd_mach_o_core_file_failing_command (abfd)
+ bfd *abfd;
+{
+ unsigned char *buf = NULL;
+ unsigned int len = 0;
+ int ret = -1;
+
+ ret = bfd_mach_o_core_fetch_environment (abfd, &buf, &len);
+ if (ret < 0)
+ return NULL;
+
+ return buf;
+}
+
+int
+bfd_mach_o_core_file_failing_signal (abfd)
+ bfd *abfd ATTRIBUTE_UNUSED;
+{
+ return 0;
+}
+
+boolean
+bfd_mach_o_core_file_matches_executable_p (core_bfd, exec_bfd)
+ bfd *core_bfd ATTRIBUTE_UNUSED;
+ bfd *exec_bfd ATTRIBUTE_UNUSED;
+{
+ return true;
+}
+
+#define TARGET_NAME mach_o_be_vec
+#define TARGET_STRING "mach-o-be"
+#define TARGET_BIG_ENDIAN 1
+#define TARGET_ARCHIVE 0
+
+#include "mach-o-target.c"
+
+#undef TARGET_NAME
+#undef TARGET_STRING
+#undef TARGET_BIG_ENDIAN
+#undef TARGET_ARCHIVE
+
+#define TARGET_NAME mach_o_le_vec
+#define TARGET_STRING "mach-o-le"
+#define TARGET_BIG_ENDIAN 0
+#define TARGET_ARCHIVE 0
+
+#include "mach-o-target.c"
+
+#undef TARGET_NAME
+#undef TARGET_STRING
+#undef TARGET_BIG_ENDIAN
+#undef TARGET_ARCHIVE
+
+#define TARGET_NAME mach_o_fat_vec
+#define TARGET_STRING "mach-o-fat"
+#define TARGET_BIG_ENDIAN 1
+#define TARGET_ARCHIVE 1
+
+#include "mach-o-target.c"
+
+#undef TARGET_NAME
+#undef TARGET_STRING
+#undef TARGET_BIG_ENDIAN
+#undef TARGET_ARCHIVE
diff --git a/bfd/mach-o.h b/bfd/mach-o.h
new file mode 100644
index 00000000000..f78027321de
--- /dev/null
+++ b/bfd/mach-o.h
@@ -0,0 +1,490 @@
+/* Mach-O support for BFD.
+ Copyright 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _BFD_MACH_O_H_
+#define _BFD_MACH_O_H_
+
+#include "bfd.h"
+
+#define BFD_MACH_O_N_STAB 0xe0 /* If any of these bits set, a symbolic debugging entry. */
+#define BFD_MACH_O_N_PEXT 0x10 /* Private external symbol bit. */
+#define BFD_MACH_O_N_TYPE 0x0e /* Mask for the type bits. */
+#define BFD_MACH_O_N_EXT 0x01 /* External symbol bit, set for external symbols. */
+#define BFD_MACH_O_N_UNDF 0x00 /* Undefined, n_sect == NO_SECT. */
+#define BFD_MACH_O_N_ABS 0x02 /* Absolute, n_sect == NO_SECT. */
+#define BFD_MACH_O_N_SECT 0x0e /* Defined in section number n_sect. */
+#define BFD_MACH_O_N_PBUD 0x0c /* Prebound undefined (defined in a dylib). */
+#define BFD_MACH_O_N_INDR 0x0a /* Indirect. */
+
+typedef enum bfd_mach_o_ppc_thread_flavour
+ {
+ BFD_MACH_O_PPC_THREAD_STATE = 1,
+ BFD_MACH_O_PPC_FLOAT_STATE = 2,
+ BFD_MACH_O_PPC_EXCEPTION_STATE = 3,
+ BFD_MACH_O_PPC_VECTOR_STATE = 4
+ }
+bfd_mach_o_ppc_thread_flavour;
+
+typedef enum bfd_mach_o_i386_thread_flavour
+ {
+ BFD_MACH_O_i386_NEW_THREAD_STATE = 1,
+ BFD_MACH_O_i386_FLOAT_STATE = 2,
+ BFD_MACH_O_i386_ISA_PORT_MAP_STATE = 3,
+ BFD_MACH_O_i386_V86_ASSIST_STATE = 4,
+ BFD_MACH_O_i386_REGS_SEGS_STATE = 5,
+ BFD_MACH_O_i386_THREAD_SYSCALL_STATE = 6,
+ BFD_MACH_O_i386_THREAD_STATE_NONE = 7,
+ BFD_MACH_O_i386_SAVED_STATE = 8,
+ BFD_MACH_O_i386_THREAD_STATE = -1,
+ BFD_MACH_O_i386_THREAD_FPSTATE = -2,
+ BFD_MACH_O_i386_THREAD_EXCEPTSTATE = -3,
+ BFD_MACH_O_i386_THREAD_CTHREADSTATE = -4,
+ }
+bfd_mach_o_i386_thread_flavour;
+
+#define BFD_MACH_O_LC_REQ_DYLD 0x80000000
+
+typedef enum bfd_mach_o_load_command_type
+ {
+ BFD_MACH_O_LC_SEGMENT = 0x1, /* File segment to be mapped. */
+ BFD_MACH_O_LC_SYMTAB = 0x2, /* Link-edit stab symbol table info (obsolete). */
+ BFD_MACH_O_LC_SYMSEG = 0x3, /* Link-edit gdb symbol table info. */
+ BFD_MACH_O_LC_THREAD = 0x4, /* Thread. */
+ BFD_MACH_O_LC_UNIXTHREAD = 0x5, /* UNIX thread (includes a stack). */
+ BFD_MACH_O_LC_LOADFVMLIB = 0x6, /* Load a fixed VM shared library. */
+ BFD_MACH_O_LC_IDFVMLIB = 0x7, /* Fixed VM shared library id. */
+ BFD_MACH_O_LC_IDENT = 0x8, /* Object identification information (obsolete). */
+ BFD_MACH_O_LC_FVMFILE = 0x9, /* Fixed VM file inclusion. */
+ BFD_MACH_O_LC_PREPAGE = 0xa, /* Prepage command (internal use). */
+ BFD_MACH_O_LC_DYSYMTAB = 0xb, /* Dynamic link-edit symbol table info. */
+ BFD_MACH_O_LC_LOAD_DYLIB = 0xc, /* Load a dynamicly linked shared library. */
+ BFD_MACH_O_LC_ID_DYLIB = 0xd, /* Dynamicly linked shared lib identification. */
+ BFD_MACH_O_LC_LOAD_DYLINKER = 0xe, /* Load a dynamic linker. */
+ BFD_MACH_O_LC_ID_DYLINKER = 0xf, /* Dynamic linker identification. */
+ BFD_MACH_O_LC_PREBOUND_DYLIB = 0x10,/* Modules prebound for a dynamicly. */
+ BFD_MACH_O_LC_ROUTINES = 0x11, /* Image routines. */
+ BFD_MACH_O_LC_SUB_FRAMEWORK = 0x12, /* Sub framework. */
+ BFD_MACH_O_LC_SUB_UMBRELLA = 0x13, /* Sub umbrella. */
+ BFD_MACH_O_LC_SUB_CLIENT = 0x14, /* Sub client. */
+ BFD_MACH_O_LC_SUB_LIBRARY = 0x15, /* Sub library. */
+ BFD_MACH_O_LC_TWOLEVEL_HINTS = 0x16,/* Two-level namespace lookup hints. */
+ BFD_MACH_O_LC_PREBIND_CKSUM = 0x17, /* Prebind checksum. */
+ /* Load a dynamicly linked shared library that is allowed to be
+ missing (weak). */
+ BFD_MACH_O_LC_LOAD_WEAK_DYLIB = 0x18
+ }
+bfd_mach_o_load_command_type;
+
+typedef enum bfd_mach_o_cpu_type
+ {
+ BFD_MACH_O_CPU_TYPE_VAX = 1,
+ BFD_MACH_O_CPU_TYPE_MC680x0 = 6,
+ BFD_MACH_O_CPU_TYPE_I386 = 7,
+ BFD_MACH_O_CPU_TYPE_MIPS = 8,
+ BFD_MACH_O_CPU_TYPE_MC98000 = 10,
+ BFD_MACH_O_CPU_TYPE_HPPA = 11,
+ BFD_MACH_O_CPU_TYPE_ARM = 12,
+ BFD_MACH_O_CPU_TYPE_MC88000 = 13,
+ BFD_MACH_O_CPU_TYPE_SPARC = 14,
+ BFD_MACH_O_CPU_TYPE_I860 = 15,
+ BFD_MACH_O_CPU_TYPE_ALPHA = 16,
+ BFD_MACH_O_CPU_TYPE_POWERPC = 18
+ }
+bfd_mach_o_cpu_type;
+
+typedef enum bfd_mach_o_filetype
+ {
+ BFD_MACH_O_MH_OBJECT = 1,
+ BFD_MACH_O_MH_EXECUTE = 2,
+ BFD_MACH_O_MH_FVMLIB = 3,
+ BFD_MACH_O_MH_CORE = 4,
+ BFD_MACH_O_MH_PRELOAD = 5,
+ BFD_MACH_O_MH_DYLIB = 6,
+ BFD_MACH_O_MH_DYLINKER = 7,
+ BFD_MACH_O_MH_BUNDLE = 8
+ }
+bfd_mach_o_filetype;
+
+/* Constants for the type of a section. */
+
+typedef enum bfd_mach_o_section_type
+ {
+ /* Regular section. */
+ BFD_MACH_O_S_REGULAR = 0x0,
+
+ /* Zero fill on demand section. */
+ BFD_MACH_O_S_ZEROFILL = 0x1,
+
+ /* Section with only literal C strings. */
+ BFD_MACH_O_S_CSTRING_LITERALS = 0x2,
+
+ /* Section with only 4 byte literals. */
+ BFD_MACH_O_S_4BYTE_LITERALS = 0x3,
+
+ /* Section with only 8 byte literals. */
+ BFD_MACH_O_S_8BYTE_LITERALS = 0x4,
+
+ /* Section with only pointers to literals. */
+ BFD_MACH_O_S_LITERAL_POINTERS = 0x5,
+
+ /* For the two types of symbol pointers sections and the symbol stubs
+ section they have indirect symbol table entries. For each of the
+ entries in the section the indirect symbol table entries, in
+ corresponding order in the indirect symbol table, start at the index
+ stored in the reserved1 field of the section structure. Since the
+ indirect symbol table entries correspond to the entries in the
+ section the number of indirect symbol table entries is inferred from
+ the size of the section divided by the size of the entries in the
+ section. For symbol pointers sections the size of the entries in
+ the section is 4 bytes and for symbol stubs sections the byte size
+ of the stubs is stored in the reserved2 field of the section
+ structure. */
+
+ /* Section with only non-lazy symbol pointers. */
+ BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS = 0x6,
+
+ /* Section with only lazy symbol pointers. */
+ BFD_MACH_O_S_LAZY_SYMBOL_POINTERS = 0x7,
+
+ /* Section with only symbol stubs, byte size of stub in the reserved2 field. */
+ BFD_MACH_O_S_SYMBOL_STUBS = 0x8,
+
+ /* Section with only function pointers for initialization. */
+ BFD_MACH_O_S_MOD_INIT_FUNC_POINTERS = 0x9
+ }
+bfd_mach_o_section_type;
+
+typedef unsigned long bfd_mach_o_cpu_subtype;
+
+typedef struct bfd_mach_o_header
+{
+ unsigned long magic;
+ unsigned long cputype;
+ unsigned long cpusubtype;
+ unsigned long filetype;
+ unsigned long ncmds;
+ unsigned long sizeofcmds;
+ unsigned long flags;
+ enum bfd_endian byteorder;
+}
+bfd_mach_o_header;
+
+typedef struct bfd_mach_o_section
+{
+ asection *bfdsection;
+ char sectname[16 + 1];
+ char segname[16 + 1];
+ bfd_vma addr;
+ bfd_vma size;
+ bfd_vma offset;
+ unsigned long align;
+ bfd_vma reloff;
+ unsigned long nreloc;
+ unsigned long flags;
+ unsigned long reserved1;
+ unsigned long reserved2;
+}
+bfd_mach_o_section;
+
+typedef struct bfd_mach_o_segment_command
+{
+ char segname[16];
+ bfd_vma vmaddr;
+ bfd_vma vmsize;
+ bfd_vma fileoff;
+ unsigned long filesize;
+ unsigned long nsects;
+ unsigned long flags;
+ bfd_mach_o_section *sections;
+ asection *segment;
+}
+bfd_mach_o_segment_command;
+
+typedef struct bfd_mach_o_symtab_command
+{
+ unsigned long symoff;
+ unsigned long nsyms;
+ unsigned long stroff;
+ unsigned long strsize;
+ asymbol *symbols;
+ char *strtab;
+ asection *stabs_segment;
+ asection *stabstr_segment;
+}
+bfd_mach_o_symtab_command;
+
+/* This is the second set of the symbolic information which is used to support
+ the data structures for the dynamicly link editor.
+
+ The original set of symbolic information in the symtab_command which contains
+ the symbol and string tables must also be present when this load command is
+ present. When this load command is present the symbol table is organized
+ into three groups of symbols:
+ local symbols (static and debugging symbols) - grouped by module
+ defined external symbols - grouped by module (sorted by name if not lib)
+ undefined external symbols (sorted by name)
+ In this load command there are offsets and counts to each of the three groups
+ of symbols.
+
+ This load command contains a the offsets and sizes of the following new
+ symbolic information tables:
+ table of contents
+ module table
+ reference symbol table
+ indirect symbol table
+ The first three tables above (the table of contents, module table and
+ reference symbol table) are only present if the file is a dynamicly linked
+ shared library. For executable and object modules, which are files
+ containing only one module, the information that would be in these three
+ tables is determined as follows:
+ table of contents - the defined external symbols are sorted by name
+ module table - the file contains only one module so everything in the
+ file is part of the module.
+ reference symbol table - is the defined and undefined external symbols
+
+ For dynamicly linked shared library files this load command also contains
+ offsets and sizes to the pool of relocation entries for all sections
+ separated into two groups:
+ external relocation entries
+ local relocation entries
+ For executable and object modules the relocation entries continue to hang
+ off the section structures. */
+
+typedef struct bfd_mach_o_dysymtab_command
+{
+ /* The symbols indicated by symoff and nsyms of the LC_SYMTAB load command
+ are grouped into the following three groups:
+ local symbols (further grouped by the module they are from)
+ defined external symbols (further grouped by the module they are from)
+ undefined symbols
+
+ The local symbols are used only for debugging. The dynamic binding
+ process may have to use them to indicate to the debugger the local
+ symbols for a module that is being bound.
+
+ The last two groups are used by the dynamic binding process to do the
+ binding (indirectly through the module table and the reference symbol
+ table when this is a dynamicly linked shared library file). */
+
+ unsigned long ilocalsym; /* Index to local symbols. */
+ unsigned long nlocalsym; /* Number of local symbols. */
+ unsigned long iextdefsym; /* Index to externally defined symbols. */
+ unsigned long nextdefsym; /* Number of externally defined symbols. */
+ unsigned long iundefsym; /* Index to undefined symbols. */
+ unsigned long nundefsym; /* Number of undefined symbols. */
+
+ /* For the for the dynamic binding process to find which module a symbol
+ is defined in the table of contents is used (analogous to the ranlib
+ structure in an archive) which maps defined external symbols to modules
+ they are defined in. This exists only in a dynamicly linked shared
+ library file. For executable and object modules the defined external
+ symbols are sorted by name and is use as the table of contents. */
+
+ unsigned long tocoff; /* File offset to table of contents. */
+ unsigned long ntoc; /* Number of entries in table of contents. */
+
+ /* To support dynamic binding of "modules" (whole object files) the symbol
+ table must reflect the modules that the file was created from. This is
+ done by having a module table that has indexes and counts into the merged
+ tables for each module. The module structure that these two entries
+ refer to is described below. This exists only in a dynamicly linked
+ shared library file. For executable and object modules the file only
+ contains one module so everything in the file belongs to the module. */
+
+ unsigned long modtaboff; /* File offset to module table. */
+ unsigned long nmodtab; /* Number of module table entries. */
+
+ /* To support dynamic module binding the module structure for each module
+ indicates the external references (defined and undefined) each module
+ makes. For each module there is an offset and a count into the
+ reference symbol table for the symbols that the module references.
+ This exists only in a dynamicly linked shared library file. For
+ executable and object modules the defined external symbols and the
+ undefined external symbols indicates the external references. */
+
+ unsigned long extrefsymoff; /* Offset to referenced symbol table. */
+ unsigned long nextrefsyms; /* Number of referenced symbol table entries. */
+
+ /* The sections that contain "symbol pointers" and "routine stubs" have
+ indexes and (implied counts based on the size of the section and fixed
+ size of the entry) into the "indirect symbol" table for each pointer
+ and stub. For every section of these two types the index into the
+ indirect symbol table is stored in the section header in the field
+ reserved1. An indirect symbol table entry is simply a 32bit index into
+ the symbol table to the symbol that the pointer or stub is referring to.
+ The indirect symbol table is ordered to match the entries in the section. */
+
+ unsigned long indirectsymoff; /* File offset to the indirect symbol table. */
+ unsigned long nindirectsyms; /* Number of indirect symbol table entries. */
+
+ /* To support relocating an individual module in a library file quickly the
+ external relocation entries for each module in the library need to be
+ accessed efficiently. Since the relocation entries can't be accessed
+ through the section headers for a library file they are separated into
+ groups of local and external entries further grouped by module. In this
+ case the presents of this load command who's extreloff, nextrel,
+ locreloff and nlocrel fields are non-zero indicates that the relocation
+ entries of non-merged sections are not referenced through the section
+ structures (and the reloff and nreloc fields in the section headers are
+ set to zero).
+
+ Since the relocation entries are not accessed through the section headers
+ this requires the r_address field to be something other than a section
+ offset to identify the item to be relocated. In this case r_address is
+ set to the offset from the vmaddr of the first LC_SEGMENT command.
+
+ The relocation entries are grouped by module and the module table
+ entries have indexes and counts into them for the group of external
+ relocation entries for that the module.
+
+ For sections that are merged across modules there must not be any
+ remaining external relocation entries for them (for merged sections
+ remaining relocation entries must be local). */
+
+ unsigned long extreloff; /* Offset to external relocation entries. */
+ unsigned long nextrel; /* Number of external relocation entries. */
+
+ /* All the local relocation entries are grouped together (they are not
+ grouped by their module since they are only used if the object is moved
+ from it staticly link edited address). */
+
+ unsigned long locreloff; /* Offset to local relocation entries. */
+ unsigned long nlocrel; /* Number of local relocation entries. */
+}
+bfd_mach_o_dysymtab_command;
+
+/* An indirect symbol table entry is simply a 32bit index into the symbol table
+ to the symbol that the pointer or stub is refering to. Unless it is for a
+ non-lazy symbol pointer section for a defined symbol which strip(1) as
+ removed. In which case it has the value INDIRECT_SYMBOL_LOCAL. If the
+ symbol was also absolute INDIRECT_SYMBOL_ABS is or'ed with that. */
+
+#define INDIRECT_SYMBOL_LOCAL 0x80000000
+#define INDIRECT_SYMBOL_ABS 0x40000000
+
+typedef struct bfd_mach_o_thread_flavour
+{
+ unsigned long flavour;
+ bfd_vma offset;
+ unsigned long size;
+}
+bfd_mach_o_thread_flavour;
+
+typedef struct bfd_mach_o_thread_command
+{
+ unsigned long nflavours;
+ bfd_mach_o_thread_flavour *flavours;
+ asection *section;
+}
+bfd_mach_o_thread_command;
+
+typedef struct bfd_mach_o_dylinker_command
+{
+ unsigned long cmd; /* LC_ID_DYLIB or LC_LOAD_DYLIB. */
+ unsigned long cmdsize; /* Includes pathname string. */
+ unsigned long name_offset; /* Offset to library's path name. */
+ unsigned long name_len; /* Offset to library's path name. */
+ asection *section;
+}
+bfd_mach_o_dylinker_command;
+
+typedef struct bfd_mach_o_dylib_command
+{
+ unsigned long cmd; /* LC_ID_DYLIB or LC_LOAD_DYLIB. */
+ unsigned long cmdsize; /* Includes pathname string. */
+ unsigned long name_offset; /* Offset to library's path name. */
+ unsigned long name_len; /* Offset to library's path name. */
+ unsigned long timestamp; /* Library's build time stamp. */
+ unsigned long current_version; /* Library's current version number. */
+ unsigned long compatibility_version; /* Library's compatibility vers number. */
+ asection *section;
+}
+bfd_mach_o_dylib_command;
+
+typedef struct bfd_mach_o_prebound_dylib_command
+{
+ unsigned long cmd; /* LC_PREBOUND_DYLIB. */
+ unsigned long cmdsize; /* Includes strings. */
+ unsigned long name; /* Library's path name. */
+ unsigned long nmodules; /* Number of modules in library. */
+ unsigned long linked_modules; /* Bit vector of linked modules. */
+ asection *section;
+}
+bfd_mach_o_prebound_dylib_command;
+
+typedef struct bfd_mach_o_load_command
+{
+ bfd_mach_o_load_command_type type;
+ unsigned int type_required;
+ bfd_vma offset;
+ bfd_vma len;
+ union
+ {
+ bfd_mach_o_segment_command segment;
+ bfd_mach_o_symtab_command symtab;
+ bfd_mach_o_dysymtab_command dysymtab;
+ bfd_mach_o_thread_command thread;
+ bfd_mach_o_dylib_command dylib;
+ bfd_mach_o_dylinker_command dylinker;
+ bfd_mach_o_prebound_dylib_command prebound_dylib;
+ }
+ command;
+}
+bfd_mach_o_load_command;
+
+typedef struct mach_o_data_struct
+{
+ bfd_mach_o_header header;
+ bfd_mach_o_load_command *commands;
+ unsigned long nsymbols;
+ asymbol *symbols;
+ unsigned long nsects;
+ bfd_mach_o_section **sections;
+ bfd *ibfd;
+}
+mach_o_data_struct;
+
+typedef struct mach_o_data_struct bfd_mach_o_data_struct;
+
+boolean bfd_mach_o_valid PARAMS ((bfd *));
+int bfd_mach_o_scan_read_symtab_symbol PARAMS ((bfd *, bfd_mach_o_symtab_command *, asymbol *, unsigned long));
+int bfd_mach_o_scan_read_symtab_strtab PARAMS ((bfd *, bfd_mach_o_symtab_command *));
+int bfd_mach_o_scan_read_symtab_symbols PARAMS ((bfd *, bfd_mach_o_symtab_command *));
+int bfd_mach_o_scan_read_dysymtab_symbol PARAMS ((bfd *, bfd_mach_o_dysymtab_command *, bfd_mach_o_symtab_command *, asymbol *, unsigned long));
+int bfd_mach_o_scan_start_address PARAMS ((bfd *));
+int bfd_mach_o_scan PARAMS ((bfd *, bfd_mach_o_header *, bfd_mach_o_data_struct *));
+boolean bfd_mach_o_mkobject PARAMS ((bfd *));
+const bfd_target * bfd_mach_o_object_p PARAMS ((bfd *));
+const bfd_target * bfd_mach_o_core_p PARAMS ((bfd *));
+const bfd_target * bfd_mach_o_archive_p PARAMS ((bfd *));
+bfd * bfd_mach_o_openr_next_archived_file PARAMS ((bfd *, bfd *));
+int bfd_mach_o_lookup_section PARAMS ((bfd *, asection *, bfd_mach_o_load_command **, bfd_mach_o_section **));
+int bfd_mach_o_lookup_command PARAMS ((bfd *, bfd_mach_o_load_command_type, bfd_mach_o_load_command **));
+unsigned long bfd_mach_o_stack_addr PARAMS ((enum bfd_mach_o_cpu_type));
+int bfd_mach_o_core_fetch_environment PARAMS ((bfd *, unsigned char **, unsigned int *));
+char * bfd_mach_o_core_file_failing_command PARAMS ((bfd *));
+int bfd_mach_o_core_file_failing_signal PARAMS ((bfd *));
+boolean bfd_mach_o_core_file_matches_executable_p PARAMS ((bfd *, bfd *));
+
+extern const bfd_target mach_o_be_vec;
+extern const bfd_target mach_o_le_vec;
+extern const bfd_target mach_o_fat_vec;
+
+#endif /* _BFD_MACH_O_H_ */
diff --git a/bfd/merge.c b/bfd/merge.c
index ce61207251f..9dc2e708344 100644
--- a/bfd/merge.c
+++ b/bfd/merge.c
@@ -353,7 +353,7 @@ sec_merge_emit (abfd, entry)
if (alignment_power)
free (pad);
- return entry == NULL || entry->secinfo != secinfo;
+ return (boolean) (entry == NULL || entry->secinfo != secinfo);
}
/* This function is called for each input file from the add_symbols
@@ -667,7 +667,7 @@ merge_strings (sinfo)
break;
if (e->len > 4 * e->u.entsize)
{
- s = e->root.string + e->len - e->u.entsize;
+ s = (const unsigned char *) (e->root.string + e->len - e->u.entsize);
hash = 0;
for (i = 0; i < 4 * e->u.entsize; i++)
{
@@ -690,7 +690,7 @@ merge_strings (sinfo)
else
*p = (PTR) e;
}
- s = e->root.string + e->len - e->u.entsize;
+ s = (const unsigned char *) (e->root.string + e->len - e->u.entsize);
hash = 0;
for (i = 0; i < e->u.entsize; i++)
{
diff --git a/bfd/opncls.c b/bfd/opncls.c
index cdf08df05dd..af8ff7e4a63 100644
--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -63,7 +63,9 @@ _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;
@@ -124,7 +126,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 <<fopen>>) with the target
@@ -134,7 +136,8 @@ DESCRIPTION
that function.
If <<NULL>> is returned then an error has occured. Possible errors
- are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> or <<system_call>> error.
+ are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> or
+ <<system_call>> error.
*/
bfd *
@@ -179,28 +182,28 @@ 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
- <<bfd_fdopenr>> is to <<bfd_fopenr>> much like <<fdopen>> is to <<fopen>>.
- It opens a BFD on a file already described by the @var{fd}
- supplied.
-
- When the file is later <<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 cacheing; the file descriptor will remain open until
- <<bfd_close>>, and will not be affected by BFD operations on other
- files.
-
- Possible errors are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> and <<bfd_error_system_call>>.
+ <<bfd_fdopenr>> is to <<bfd_fopenr>> much like <<fdopen>> is to
+ <<fopen>>. It opens a BFD on a file already described by the
+ @var{fd} supplied.
+
+ When the file is later <<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 cacheing; the file descriptor will remain open
+ until <<bfd_close>>, and will not be affected by BFD operations
+ on other files.
+
+ Possible errors are <<bfd_error_no_memory>>,
+ <<bfd_error_invalid_target>> and <<bfd_error_system_call>>.
*/
bfd *
@@ -389,10 +392,10 @@ SYNOPSIS
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
- <<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 <<chmod>> is called
+ to mark it as such.
All memory attached to the BFD is released.
@@ -431,7 +434,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,
@@ -453,10 +456,10 @@ SYNOPSIS
boolean bfd_close_all_done(bfd *);
DESCRIPTION
- Close a BFD. Differs from <<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 <<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 <<chmod>> is called
to mark it as such.
@@ -507,10 +510,9 @@ SYNOPSIS
bfd *bfd_create(const char *filename, bfd *templ);
DESCRIPTION
- Create a new BFD in the manner of
- <<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 <<bfd_object>>.
+ Create a new BFD in the manner of <<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 <<bfd_object>>.
*/
bfd *
diff --git a/bfd/pef-traceback.h b/bfd/pef-traceback.h
new file mode 100644
index 00000000000..15f43b6e594
--- /dev/null
+++ b/bfd/pef-traceback.h
@@ -0,0 +1,215 @@
+/* PowerPC traceback table support for BFD.
+ Copyright 1993, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Originally written by Ira Ruben, 06/28/93 */
+
+/* This is a compiler independent representation of the AIX Version 3 traceback table (in
+ sys/debug.h), which occurs, usually, one per procedure (routine). The table is marked by
+ a multiple of 4 32-bit word of zeroes in the instruction space. The traceback table is
+ also referred to as "procedure-end table".
+
+ The AIX traceback table representation on which this header is based is defined as a
+ series of bit field struct specifications. Bit fields are compiler dependent! Thus,
+ the definitions presented here follow the original header and the existing documentation
+ (such as it is), but define the fields as BIT MASKS and other macros. The mask names,
+ however, where chosen as the original field names to give some compatibility with the
+ original header and to agree with the documentation. */
+
+#ifndef __TRACEBACK__
+#define __TRACEBACK__
+
+#define TB_C 0U /* C */
+#define TB_FORTRAN 1U /* FORTRAN */
+#define TB_PASCAL 2U /* Pascal */
+#define TB_ADA 3U /* ADA */
+#define TB_PL1 4U /* PL1 */
+#define TB_BASIC 5U /* Basic */
+#define TB_LISP 6U /* Lisp */
+#define TB_COBOL 7U /* eCobol */
+#define TB_MODULA2 8U /* Modula2 */
+#define TB_CPLUSPLUS 9U /* C++ */
+#define TB_RPG 10U /* RPG */
+#define TB_PL8 11U /* PL8 */
+#define TB_ASM 12U /* Asm */
+
+/* flags 1 */
+
+#define TB_GLOBALLINK 0x80U /* Routine is Global Linkage. */
+#define TB_is_eprol 0x40U /* Out-of-line prolog or epilog routine. */
+#define TB_HAS_TBOFF 0x20U /* tb_offset set (extension field). */
+#define TB_INT_PROC 0x10U /* Internal leaf routine. */
+#define TB_HAS_CTL 0x08U /* Has controlled automatic storage. */
+#define TB_TOCLESS 0X04U /* Routine has no TOC. */
+#define TB_FP_PRESENT 0x02U /* Routine has floating point ops. */
+#define TB_LOG_ABORT 0x01U /* fp_present && log/abort compiler opt. */
+
+/* flags 2 */
+
+#define TB_INT_HNDL 0x80U /* Routine is an interrupt handler. */
+#define TB_NAME_PRESENT 0x40U /* Name_len/name set (extension field). */
+#define TB_USES_ALLOCA 0x20U /* Uses alloca() to allocate storage. */
+#define TB_CL_DIS_inv 0x1CU /* On-condition directives (see below). */
+#define TB_SAVES_CR 0x02U /* Routine saves the CR. */
+#define TB_SAVES_LR 0x01U /* Routine saves the LR. */
+
+/* cl_dis_inv "on condition" settings: */
+
+#define TB_CL_DIS_INV(x) (((x) & cl_dis_inv) >> 2U)
+
+#define TB_WALK_ONCOND 0U /* Walk stack without restoring state. */
+#define TB_DISCARD_ONCOND 1U /* Walk stack and discard. */
+#define TB_INVOKE_ONCOND 2U /* Invoke a specific system routine. */
+
+/* flags 3 */
+
+#define TB_STORES_BC 0x80U /* Routine saves frame ptr of caller. */
+#define TB_SPARE2 0X40U /* Spare bit. */
+#define TB_FPR_SAVED 0x3fU /* Number of FPRs saved (max of 32). */
+ /* (Last reg saved is ALWAYS fpr31). */
+
+#define TB_NUM_FPR_SAVED(x) ((x) & fpr_saved)
+
+/* flags 4 */
+
+#define TB_HAS_VEC_INFO 0x80U /* Routine uses vectors. */
+#define TB_SPARE3 0X40U /* Spare bit. */
+#define TB_GPR_SAVED 0x3fU /* Number of GPRs saved (max of 32). */
+ /* (Last reg saved is ALWAYS gpr31). */
+
+#define TB_NUM_GPR_SAVED(x) ((x) & gpr_saved)
+
+/* flags 5 */
+
+#define TB_FLOATPARAMS 0xfeU /* Number of floating point parameters. */
+#define TB_PARAMSONSTK 0X01U /* All parameters are on the stack. */
+
+#define TB_NUM_FLOATPARAMS(X) (((x) & floatparams) >> 1U)
+
+/* traceback_table (fixed portion). */
+
+struct traceback_table
+{
+ /* Traceback table layout (fixed portion): */
+
+ unsigned char version; /* Traceback format version. */
+ unsigned char lang; /* Language indicators: */
+ unsigned char flags1; /* Flag bits #1: */
+ unsigned char flags2; /* Flag bits #2: */
+ unsigned char flags3; /* Flag bits #3: */
+ unsigned char flags4; /* Flag bits #4: */
+ unsigned char fixedparams; /* Number of fixed point parameters. */
+ unsigned char flags5; /* Flag bits #5: */
+};
+
+/* traceback_table (optional) extensions. */
+
+/* Optional portions exist independently in the order presented below,
+ not as a structure or a union. Whether or not portions exist is
+ determinable from bit-fields within the fixed portion above. */
+
+/* The following is present only if fixedparams or floatparams are non
+ zero and it immediately follows the fixed portion of the traceback
+ table... */
+
+/* Order and type encoding of parameters: */
+struct traceback_table_fixedparams
+{
+ unsigned long paraminfo;
+};
+
+/* Left-justified bit-encoding as follows: */
+#define FIXED_PARAM 0 /* '0' ==> fixed param (1 gpr or word). */
+#define SPFP_PARAM 2 /* '10' ==> single-precision float param. */
+#define DPFP_PARAM 3 /* '11' ==> double-precision float param. */
+
+#define PARAM_ENCODING(x, bit) /* Yields xxx_PARAM as a function of "bit". */ \
+ ((((x)&(1UL<<(31UL-(bit++))))==0UL) /* Values 0:31 (left-to-right). "bit" is */ \
+ ? FIXED_PARAM /* an L-value that's left incremented to */ \
+ : ((((x)&(1UL<<(31UL-(bit++))))==0)/* the next bit position for the next */ \
+ ? SPFP_PARAM /* parameter. This will be 1 or 2 bit */ \
+ : DPFP_PARAM)) /* positions later. */
+
+/* The following is present only if has_tboff (in flags1) in fixed part is present... */
+
+/* Offset from start of code to TracebackTbl. */
+struct traceback_table_tboff
+{
+ unsigned long tb_offset;
+};
+
+/* The following is present only if int_hndl (in flags2) in fixed part is present ... */
+
+/* What interrupts are handled by the routine. */
+struct traceback_table_interrupts
+{
+ long hand_mask;
+};
+
+/* The following are present only if has_ctl (in flags1) in fixed part is present... */
+
+/* Controlled automatic storage info: */
+struct traceback_table_anchors
+{
+ unsigned long ctl_info; /* Number of controlled automatic anchors. */
+ long ctl_info_disp[1]; /* Array of stack displacements where each. */
+}; /* Anchor is located (array STARTS here). */
+
+/* The following are present only if name_present (in flags2) in fixed
+ part is present... */
+
+/* Routine name: */
+struct traceback_table_routine
+{
+ unsigned short name_len; /* Length of name that follows. */
+ char name[1]; /* Name starts here (NOT null terminated). */
+};
+
+/* The following are present only if uses_alloca (in flags2) in fixed
+ part is present... */
+
+/* Register auto storage when alloca() is used. */
+struct traceback_table_alloca
+{
+ char alloca_reg;
+};
+
+/* The following are present only if has_vec_info (in flags4) in fixed
+ part is present... */
+
+/* Vector info: */
+struct traceback_table_vector
+{
+ unsigned char vec_flags1; /* Vec info bits #1: */
+
+#define TB_VR_SAVED 0xFCU /* Number of saved vector registers. */
+#define TB_SAVES_VRSAVE 0x02U /* Saves VRsave. */
+#define TB_HAS_VARARGS 0x01U /* Routine has a variable argument list. */
+
+#define TB_NUM_VR_SAVED(x) (((x) & TB_VR_SAVED) >> 2U)
+
+ unsigned char vec_flags2; /* Vec info bits #2: */
+
+#define TB_VECTORPARAMS 0xfeU /* Number of vector parameters. */
+#define TB_VEC_PRESENT 0x01U /* Routine uses at least one vec instr. */
+
+#define VECPARAMS(x) (((x) & TB_VECTORPARAMS) >> 1U)
+};
+
+#endif
diff --git a/bfd/pef.c b/bfd/pef.c
new file mode 100644
index 00000000000..2f120285ace
--- /dev/null
+++ b/bfd/pef.c
@@ -0,0 +1,1312 @@
+/* PEF support for BFD.
+ Copyright 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include <ctype.h>
+
+#include "pef.h"
+#include "pef-traceback.h"
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+#include "libiberty.h"
+
+#ifndef BFD_IO_FUNCS
+#define BFD_IO_FUNCS 0
+#endif
+
+#define bfd_pef_close_and_cleanup _bfd_generic_close_and_cleanup
+#define bfd_pef_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define bfd_pef_new_section_hook _bfd_generic_new_section_hook
+#define bfd_pef_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define bfd_pef_get_lineno _bfd_nosymbols_get_lineno
+#define bfd_pef_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define bfd_pef_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define bfd_pef_read_minisymbols _bfd_generic_read_minisymbols
+#define bfd_pef_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+
+#define bfd_pef_get_reloc_upper_bound _bfd_norelocs_get_reloc_upper_bound
+#define bfd_pef_canonicalize_reloc _bfd_norelocs_canonicalize_reloc
+#define bfd_pef_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
+
+#define bfd_pef_set_arch_mach _bfd_generic_set_arch_mach
+
+#define bfd_pef_get_section_contents _bfd_generic_get_section_contents
+#define bfd_pef_set_section_contents _bfd_generic_set_section_contents
+
+#define bfd_pef_bfd_get_relocated_section_contents \
+ bfd_generic_get_relocated_section_contents
+#define bfd_pef_bfd_relax_section bfd_generic_relax_section
+#define bfd_pef_bfd_gc_sections bfd_generic_gc_sections
+#define bfd_pef_bfd_merge_sections bfd_generic_merge_sections
+#define bfd_pef_bfd_discard_group bfd_generic_discard_group
+#define bfd_pef_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define bfd_pef_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
+#define bfd_pef_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define bfd_pef_bfd_link_just_syms _bfd_generic_link_just_syms
+#define bfd_pef_bfd_final_link _bfd_generic_final_link
+#define bfd_pef_bfd_link_split_section _bfd_generic_link_split_section
+#define bfd_pef_get_section_contents_in_window \
+ _bfd_generic_get_section_contents_in_window
+
+static void bfd_pef_print_symbol
+PARAMS ((bfd *abfd, PTR afile, asymbol *symbol, bfd_print_symbol_type how));
+static void bfd_pef_convert_architecture
+PARAMS ((unsigned long architecture,
+ enum bfd_architecture *type, unsigned long *subtype));
+static boolean bfd_pef_mkobject PARAMS ((bfd *abfd));
+static int bfd_pef_parse_traceback_table
+PARAMS ((bfd *abfd, asection *section, unsigned char *buf,
+ size_t len, size_t pos, asymbol *sym, FILE *file));
+static const char *bfd_pef_section_name PARAMS ((bfd_pef_section *section));
+static unsigned long bfd_pef_section_flags PARAMS ((bfd_pef_section *section));
+static asection *bfd_pef_make_bfd_section
+PARAMS ((bfd *abfd, bfd_pef_section *section));
+static int bfd_pef_read_header PARAMS ((bfd *abfd, bfd_pef_header *header));
+static const bfd_target *bfd_pef_object_p PARAMS ((bfd *));
+static int bfd_pef_parse_traceback_tables
+PARAMS ((bfd *abfd, asection *sec, unsigned char *buf,
+ size_t len, long *nsym, asymbol **csym));
+static int bfd_pef_parse_function_stub
+PARAMS ((bfd *abfd, unsigned char *buf, size_t len, unsigned long *offset));
+static int bfd_pef_parse_function_stubs
+PARAMS ((bfd *abfd, asection *codesec, unsigned char *codebuf, size_t codelen,
+ unsigned char *loaderbuf, size_t loaderlen, unsigned long *nsym,
+ asymbol **csym));
+static long bfd_pef_parse_symbols PARAMS ((bfd *abfd, asymbol **csym));
+static long bfd_pef_count_symbols PARAMS ((bfd *abfd));
+static long bfd_pef_get_symtab_upper_bound PARAMS ((bfd *));
+static long bfd_pef_get_symtab PARAMS ((bfd *, asymbol **));
+static asymbol *bfd_pef_make_empty_symbol PARAMS ((bfd *));
+static void bfd_pef_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
+static int bfd_pef_sizeof_headers PARAMS ((bfd *, boolean));
+
+static int bfd_pef_xlib_read_header
+PARAMS ((bfd *abfd, bfd_pef_xlib_header *header));
+static int bfd_pef_xlib_scan PARAMS ((bfd *abfd, bfd_pef_xlib_header *header));
+static const bfd_target *bfd_pef_xlib_object_p PARAMS ((bfd *abfd));
+
+static void
+bfd_pef_print_symbol (abfd, afile, symbol, how)
+ bfd *abfd;
+ PTR afile;
+ asymbol *symbol;
+ bfd_print_symbol_type how;
+{
+ FILE *file = (FILE *) afile;
+ switch (how)
+ {
+ case bfd_print_symbol_name:
+ fprintf (file, "%s", symbol->name);
+ break;
+ default:
+ bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
+ fprintf (file, " %-5s %s", symbol->section->name, symbol->name);
+ if (strncmp (symbol->name, "__traceback_", strlen ("__traceback_")) == 0)
+ {
+ char *buf = alloca (symbol->udata.i);
+ size_t offset = symbol->value + 4;
+ size_t len = symbol->udata.i;
+ int ret;
+
+ bfd_get_section_contents (abfd, symbol->section, buf, offset, len);
+ ret = bfd_pef_parse_traceback_table (abfd, symbol->section, buf,
+ len, 0, NULL, file);
+ if (ret < 0)
+ fprintf (file, " [ERROR]");
+ }
+ }
+}
+
+static void
+bfd_pef_convert_architecture (architecture, type, subtype)
+ unsigned long architecture;
+ enum bfd_architecture *type;
+ unsigned long *subtype;
+{
+ const unsigned long ARCH_POWERPC = 0x70777063; /* 'pwpc' */
+ const unsigned long ARCH_M68K = 0x6d36386b; /* 'm68k' */
+
+ *subtype = bfd_arch_unknown;
+ *type = bfd_arch_unknown;
+
+ if (architecture == ARCH_POWERPC)
+ *type = bfd_arch_powerpc;
+ else if (architecture == ARCH_M68K)
+ *type = bfd_arch_m68k;
+}
+
+static boolean
+bfd_pef_mkobject (abfd)
+ bfd *abfd ATTRIBUTE_UNUSED;
+{
+ return true;
+}
+
+static int
+bfd_pef_parse_traceback_table (abfd, section, buf, len, pos, sym, file)
+ bfd *abfd;
+ asection *section;
+ unsigned char *buf;
+ size_t len;
+ size_t pos;
+ asymbol *sym;
+ FILE *file;
+{
+ struct traceback_table table;
+ size_t offset;
+ const char *s;
+ asymbol tmpsymbol;
+
+ if (sym == NULL)
+ sym = &tmpsymbol;
+
+ sym->name = NULL;
+ sym->value = 0;
+ sym->the_bfd = abfd;
+ sym->section = section;
+ sym->flags = 0;
+ sym->udata.i = 0;
+
+ /* memcpy is fine since all fields are unsigned char */
+
+ if ((pos + 8) > len)
+ return -1;
+ memcpy (&table, buf + pos, 8);
+
+ /* calling code relies on returned symbols having a name and
+ correct offset */
+
+ if ((table.lang != TB_C) && (table.lang != TB_CPLUSPLUS))
+ return -1;
+
+ if (! (table.flags2 & TB_NAME_PRESENT))
+ return -1;
+
+ if (! table.flags1 & TB_HAS_TBOFF)
+ return -1;
+
+ offset = 8;
+
+ if ((table.flags5 & TB_FLOATPARAMS) || (table.fixedparams))
+ offset += 4;
+
+ if (table.flags1 & TB_HAS_TBOFF)
+ {
+ struct traceback_table_tboff off;
+
+ if ((pos + offset + 4) > len)
+ return -1;
+ off.tb_offset = bfd_getb32 (buf + pos + offset);
+ offset += 4;
+
+ /* need to subtract 4 because the offset includes the 0x0L
+ preceding the table */
+
+ if (file != NULL)
+ fprintf (file, " [offset = 0x%lx]", off.tb_offset);
+
+ if ((file == NULL) && ((off.tb_offset + 4) > (pos + offset)))
+ return -1;
+
+ sym->value = pos - off.tb_offset - 4;
+ }
+
+ if (table.flags2 & TB_INT_HNDL)
+ offset += 4;
+
+ if (table.flags1 & TB_HAS_CTL)
+ {
+ struct traceback_table_anchors anchors;
+
+ if ((pos + offset + 4) > len)
+ return -1;
+ anchors.ctl_info = bfd_getb32 (buf + pos + offset);
+ offset += 4;
+
+ if (anchors.ctl_info > 1024)
+ return -1;
+
+ offset += anchors.ctl_info * 4;
+ }
+
+ if (table.flags2 & TB_NAME_PRESENT)
+ {
+ struct traceback_table_routine name;
+ char *namebuf;
+
+ if ((pos + offset + 2) > len)
+ return -1;
+ name.name_len = bfd_getb16 (buf + pos + offset);
+ offset += 2;
+
+ if (name.name_len > 4096)
+ return -1;
+
+ if ((pos + offset + name.name_len) > len)
+ return -1;
+
+ namebuf = (char *) bfd_alloc (abfd, name.name_len + 1);
+ if (namebuf == NULL)
+ return -1;
+
+ memcpy (namebuf, buf + pos + offset, name.name_len);
+ namebuf[name.name_len] = '\0';
+
+ /* strip leading period inserted by compiler */
+ if (namebuf[0] == '.')
+ memmove (namebuf, namebuf + 1, name.name_len + 1);
+
+ sym->name = namebuf;
+
+ for (s = sym->name; (*s != '\0'); s++)
+ if (! isprint (*s))
+ return -1;
+
+ offset += name.name_len;
+ }
+
+ if (table.flags2 & TB_USES_ALLOCA)
+ offset += 4;
+
+ if (table.flags4 & TB_HAS_VEC_INFO)
+ offset += 4;
+
+ if (file != NULL)
+ fprintf (file, " [length = 0x%lx]", (long) offset);
+
+ return offset;
+}
+
+static const char *bfd_pef_section_name (section)
+ bfd_pef_section *section;
+{
+ switch (section->section_kind)
+ {
+ case BFD_PEF_SECTION_CODE: return "code";
+ case BFD_PEF_SECTION_UNPACKED_DATA: return "unpacked-data";
+ case BFD_PEF_SECTION_PACKED_DATA: return "packed-data";
+ case BFD_PEF_SECTION_CONSTANT: return "constant";
+ case BFD_PEF_SECTION_LOADER: return "loader";
+ case BFD_PEF_SECTION_DEBUG: return "debug";
+ case BFD_PEF_SECTION_EXEC_DATA: return "exec-data";
+ case BFD_PEF_SECTION_EXCEPTION: return "exception";
+ case BFD_PEF_SECTION_TRACEBACK: return "traceback";
+ default: return "unknown";
+ }
+}
+
+static unsigned long bfd_pef_section_flags (section)
+ bfd_pef_section *section;
+{
+ switch (section->section_kind)
+ {
+ case BFD_PEF_SECTION_CODE:
+ return SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_CODE;
+ case BFD_PEF_SECTION_UNPACKED_DATA:
+ case BFD_PEF_SECTION_PACKED_DATA:
+ case BFD_PEF_SECTION_CONSTANT:
+ case BFD_PEF_SECTION_LOADER:
+ case BFD_PEF_SECTION_DEBUG:
+ case BFD_PEF_SECTION_EXEC_DATA:
+ case BFD_PEF_SECTION_EXCEPTION:
+ case BFD_PEF_SECTION_TRACEBACK:
+ default:
+ return SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
+ }
+}
+
+static asection *
+bfd_pef_make_bfd_section (abfd, section)
+ bfd *abfd;
+ bfd_pef_section *section;
+{
+ asection *bfdsec;
+ const char *name = bfd_pef_section_name (section);
+
+ bfdsec = bfd_make_section_anyway (abfd, name);
+ if (bfdsec == NULL)
+ return NULL;
+
+ bfdsec->vma = section->default_address + section->container_offset;
+ bfdsec->lma = section->default_address + section->container_offset;
+ bfdsec->_raw_size = section->container_length;
+ bfdsec->filepos = section->container_offset;
+ bfdsec->alignment_power = section->alignment;
+
+ bfdsec->flags = bfd_pef_section_flags (section);
+
+ return bfdsec;
+}
+
+int bfd_pef_parse_loader_header (abfd, buf, len, header)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ unsigned char *buf;
+ size_t len;
+ bfd_pef_loader_header *header;
+{
+ BFD_ASSERT (len == 56);
+
+ header->main_section = bfd_getb32 (buf);
+ header->main_offset = bfd_getb32 (buf + 4);
+ header->init_section = bfd_getb32 (buf + 8);
+ header->init_offset = bfd_getb32 (buf + 12);
+ header->term_section = bfd_getb32 (buf + 16);
+ header->term_offset = bfd_getb32 (buf + 20);
+ header->imported_library_count = bfd_getb32 (buf + 24);
+ header->total_imported_symbol_count = bfd_getb32 (buf + 28);
+ header->reloc_section_count = bfd_getb32 (buf + 32);
+ header->reloc_instr_offset = bfd_getb32 (buf + 36);
+ header->loader_strings_offset = bfd_getb32 (buf + 40);
+ header->export_hash_offset = bfd_getb32 (buf + 44);
+ header->export_hash_table_power = bfd_getb32 (buf + 48);
+ header->exported_symbol_count = bfd_getb32 (buf + 52);
+
+ return 0;
+}
+
+int bfd_pef_parse_imported_library (abfd, buf, len, header)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ unsigned char *buf;
+ size_t len;
+ bfd_pef_imported_library *header;
+{
+ BFD_ASSERT (len == 24);
+
+ header->name_offset = bfd_getb32 (buf);
+ header->old_implementation_version = bfd_getb32 (buf + 4);
+ header->current_version = bfd_getb32 (buf + 8);
+ header->imported_symbol_count = bfd_getb32 (buf + 12);
+ header->first_imported_symbol = bfd_getb32 (buf + 16);
+ header->options = buf[20];
+ header->reserved_a = buf[21];
+ header->reserved_b = bfd_getb16 (buf + 22);
+
+ return 0;
+}
+
+int bfd_pef_parse_imported_symbol (abfd, buf, len, symbol)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ unsigned char *buf;
+ size_t len;
+ bfd_pef_imported_symbol *symbol;
+{
+ unsigned long value;
+
+ BFD_ASSERT (len == 4);
+
+ value = bfd_getb32 (buf);
+ symbol->class = value >> 24;
+ symbol->name = value & 0x00ffffff;
+
+ return 0;
+}
+
+int bfd_pef_scan_section (abfd, section)
+ bfd *abfd;
+ bfd_pef_section *section;
+{
+ unsigned char buf[28];
+
+ bfd_seek (abfd, section->header_offset, SEEK_SET);
+ if (bfd_bread ((PTR) buf, 28, abfd) != 28)
+ return -1;
+
+ section->name_offset = bfd_h_get_32 (abfd, buf);
+ section->default_address = bfd_h_get_32 (abfd, buf + 4);
+ section->total_length = bfd_h_get_32 (abfd, buf + 8);
+ section->unpacked_length = bfd_h_get_32 (abfd, buf + 12);
+ section->container_length = bfd_h_get_32 (abfd, buf + 16);
+ section->container_offset = bfd_h_get_32 (abfd, buf + 20);
+ section->section_kind = buf[24];
+ section->share_kind = buf[25];
+ section->alignment = buf[26];
+ section->reserved = buf[27];
+
+ section->bfd_section = bfd_pef_make_bfd_section (abfd, section);
+ if (section->bfd_section == NULL)
+ return -1;
+
+ return 0;
+}
+
+void
+bfd_pef_print_loader_header (abfd, header, file)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd_pef_loader_header *header;
+ FILE *file;
+{
+ fprintf (file, "main_section: %ld\n", header->main_section);
+ fprintf (file, "main_offset: %lu\n", header->main_offset);
+ fprintf (file, "init_section: %ld\n", header->init_section);
+ fprintf (file, "init_offset: %lu\n", header->init_offset);
+ fprintf (file, "term_section: %ld\n", header->term_section);
+ fprintf (file, "term_offset: %lu\n", header->term_offset);
+ fprintf (file, "imported_library_count: %lu\n",
+ header->imported_library_count);
+ fprintf (file, "total_imported_symbol_count: %lu\n",
+ header->total_imported_symbol_count);
+ fprintf (file, "reloc_section_count: %lu\n", header->reloc_section_count);
+ fprintf (file, "reloc_instr_offset: %lu\n", header->reloc_instr_offset);
+ fprintf (file, "loader_strings_offset: %lu\n",
+ header->loader_strings_offset);
+ fprintf (file, "export_hash_offset: %lu\n", header->export_hash_offset);
+ fprintf (file, "export_hash_table_power: %lu\n",
+ header->export_hash_table_power);
+ fprintf (file, "exported_symbol_count: %lu\n",
+ header->exported_symbol_count);
+}
+
+int
+bfd_pef_print_loader_section (abfd, file)
+ bfd *abfd;
+ FILE *file;
+{
+ bfd_pef_loader_header header;
+ asection *loadersec = NULL;
+ unsigned char *loaderbuf = NULL;
+ size_t loaderlen = 0;
+ int ret;
+
+ loadersec = bfd_get_section_by_name (abfd, "loader");
+ if (loadersec == NULL)
+ return -1;
+
+ loaderlen = bfd_section_size (abfd, loadersec);
+ loaderbuf = (unsigned char *) bfd_malloc (loaderlen);
+ if (bfd_seek (abfd, loadersec->filepos, SEEK_SET) < 0)
+ {
+ free (loaderbuf);
+ return -1;
+ }
+ if (bfd_bread ((PTR) loaderbuf, loaderlen, abfd) != loaderlen)
+ {
+ free (loaderbuf);
+ return -1;
+ }
+
+ if (loaderlen < 56)
+ {
+ free (loaderbuf);
+ return -1;
+ }
+ ret = bfd_pef_parse_loader_header (abfd, loaderbuf, 56, &header);
+ if (ret < 0)
+ {
+ free (loaderbuf);
+ return -1;
+ }
+
+ bfd_pef_print_loader_header (abfd, &header, file);
+ return 0;
+}
+
+int
+bfd_pef_scan_start_address (abfd)
+ bfd *abfd;
+{
+ bfd_pef_loader_header header;
+ asection *section;
+
+ asection *loadersec = NULL;
+ unsigned char *loaderbuf = NULL;
+ size_t loaderlen = 0;
+ int ret;
+
+ loadersec = bfd_get_section_by_name (abfd, "loader");
+ if (loadersec == NULL)
+ goto end;
+
+ loaderlen = bfd_section_size (abfd, loadersec);
+ loaderbuf = (unsigned char *) bfd_malloc (loaderlen);
+ if (bfd_seek (abfd, loadersec->filepos, SEEK_SET) < 0)
+ goto error;
+ if (bfd_bread ((PTR) loaderbuf, loaderlen, abfd) != loaderlen)
+ goto error;
+
+ if (loaderlen < 56)
+ goto error;
+ ret = bfd_pef_parse_loader_header (abfd, loaderbuf, 56, &header);
+ if (ret < 0)
+ goto error;
+
+ if (header.main_section < 0)
+ goto end;
+
+ for (section = abfd->sections; section != NULL; section = section->next)
+ if ((section->index + 1) == header.main_section)
+ break;
+
+ if (section == NULL)
+ goto error;
+
+ abfd->start_address = section->vma + header.main_offset;
+
+ end:
+ if (loaderbuf != NULL)
+ free (loaderbuf);
+ return 0;
+
+ error:
+ if (loaderbuf != NULL)
+ free (loaderbuf);
+ return -1;
+}
+
+int
+bfd_pef_scan (abfd, header, mdata)
+ bfd *abfd;
+ bfd_pef_header *header;
+ bfd_pef_data_struct *mdata;
+{
+ unsigned int i;
+ enum bfd_architecture cputype;
+ unsigned long cpusubtype;
+
+ mdata->header = *header;
+
+ bfd_pef_convert_architecture (header->architecture, &cputype, &cpusubtype);
+ if (cputype == bfd_arch_unknown)
+ {
+ fprintf (stderr, "bfd_pef_scan: unknown architecture 0x%lx\n",
+ header->architecture);
+ return -1;
+ }
+ bfd_set_arch_mach (abfd, cputype, cpusubtype);
+
+ mdata->header = *header;
+
+ abfd->flags = (abfd->xvec->object_flags
+ | (abfd->flags & (BFD_IN_MEMORY | BFD_IO_FUNCS)));
+
+ if (header->section_count != 0)
+ {
+ mdata->sections =
+ ((bfd_pef_section *)
+ bfd_alloc (abfd, header->section_count * sizeof (bfd_pef_section)));
+
+ if (mdata->sections == NULL)
+ return -1;
+
+ for (i = 0; i < header->section_count; i++)
+ {
+ bfd_pef_section *cur = &mdata->sections[i];
+ cur->header_offset = 40 + (i * 28);
+ if (bfd_pef_scan_section (abfd, cur) < 0)
+ return -1;
+ }
+ }
+
+ if (bfd_pef_scan_start_address (abfd) < 0)
+ {
+#if 0
+ fprintf (stderr, "bfd_pef_scan: unable to scan start address: %s\n",
+ bfd_errmsg (bfd_get_error ()));
+ return -1;
+#endif
+ }
+
+ abfd->tdata.pef_data = mdata;
+
+ return 0;
+}
+
+static int
+bfd_pef_read_header (abfd, header)
+ bfd *abfd;
+ bfd_pef_header *header;
+{
+ unsigned char buf[40];
+
+ bfd_seek (abfd, 0, SEEK_SET);
+
+ if (bfd_bread ((PTR) buf, 40, abfd) != 40)
+ return -1;
+
+ header->tag1 = bfd_getb32 (buf);
+ header->tag2 = bfd_getb32 (buf + 4);
+ header->architecture = bfd_getb32 (buf + 8);
+ header->format_version = bfd_getb32 (buf + 12);
+ header->timestamp = bfd_getb32 (buf + 16);
+ header->old_definition_version = bfd_getb32 (buf + 20);
+ header->old_implementation_version = bfd_getb32 (buf + 24);
+ header->current_version = bfd_getb32 (buf + 28);
+ header->section_count = bfd_getb32 (buf + 32) + 1;
+ header->instantiated_section_count = bfd_getb32 (buf + 34);
+ header->reserved = bfd_getb32 (buf + 36);
+
+ return 0;
+}
+
+static const bfd_target *
+bfd_pef_object_p (abfd)
+ bfd *abfd;
+{
+ struct bfd_preserve preserve;
+ bfd_pef_header header;
+
+ preserve.marker = NULL;
+ if (bfd_pef_read_header (abfd, &header) != 0)
+ goto wrong;
+
+ if (header.tag1 != BFD_PEF_TAG1 || header.tag2 != BFD_PEF_TAG2)
+ goto wrong;
+
+ preserve.marker = bfd_zalloc (abfd, sizeof (bfd_pef_data_struct));
+ if (preserve.marker == NULL
+ || !bfd_preserve_save (abfd, &preserve))
+ goto fail;
+
+ if (bfd_pef_scan (abfd, &header,
+ (bfd_pef_data_struct *) preserve.marker) != 0)
+ goto wrong;
+
+ bfd_preserve_finish (abfd, &preserve);
+ return abfd->xvec;
+
+ wrong:
+ bfd_set_error (bfd_error_wrong_format);
+
+ fail:
+ if (preserve.marker != NULL)
+ bfd_preserve_restore (abfd, &preserve);
+ return NULL;
+}
+
+static int bfd_pef_parse_traceback_tables (abfd, sec, buf, len, nsym, csym)
+ bfd *abfd;
+ asection *sec;
+ unsigned char *buf;
+ size_t len;
+ long *nsym;
+ asymbol **csym;
+{
+ char *name;
+
+ asymbol function;
+ asymbol traceback;
+
+ const char *const tbprefix = "__traceback_";
+ size_t tbnamelen;
+
+ size_t pos = 0;
+ unsigned long count = 0;
+ int ret;
+
+ for (;;)
+ {
+ /* we're reading symbols two at a time */
+
+ if (csym && ((csym[count] == NULL) || (csym[count + 1] == NULL)))
+ break;
+
+ pos += 3;
+ pos -= (pos % 4);
+
+ while ((pos + 4) <= len)
+ {
+ if (bfd_getb32 (buf + pos) == 0)
+ break;
+ pos += 4;
+ }
+
+ if ((pos + 4) > len)
+ break;
+
+ ret = bfd_pef_parse_traceback_table (abfd, sec, buf, len, pos + 4,
+ &function, 0);
+ if (ret < 0)
+ {
+ /* skip over 0x0L to advance to next possible traceback table */
+ pos += 4;
+ continue;
+ }
+
+ BFD_ASSERT (function.name != NULL);
+
+ /* Don't bother to compute the name if we are just
+ counting symbols */
+
+ if (csym)
+ {
+ tbnamelen = strlen (tbprefix) + strlen (function.name);
+ name = bfd_alloc (abfd, tbnamelen + 1);
+ if (name == NULL)
+ {
+ bfd_release (abfd, (PTR) function.name);
+ function.name = NULL;
+ break;
+ }
+ snprintf (name, tbnamelen + 1, "%s%s", tbprefix, function.name);
+ traceback.name = name;
+ traceback.value = pos;
+ traceback.the_bfd = abfd;
+ traceback.section = sec;
+ traceback.flags = 0;
+ traceback.udata.i = ret;
+
+ *(csym[count]) = function;
+ *(csym[count + 1]) = traceback;
+ }
+
+ pos += ret;
+ count += 2;
+ }
+
+ *nsym = count;
+ return 0;
+}
+
+static int bfd_pef_parse_function_stub (abfd, buf, len, offset)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ unsigned char *buf;
+ size_t len;
+ unsigned long *offset;
+{
+ BFD_ASSERT (len == 24);
+
+ if ((bfd_getb32 (buf) & 0xffff0000) != 0x81820000)
+ return -1;
+ if (bfd_getb32 (buf + 4) != 0x90410014)
+ return -1;
+ if (bfd_getb32 (buf + 8) != 0x800c0000)
+ return -1;
+ if (bfd_getb32 (buf + 12) != 0x804c0004)
+ return -1;
+ if (bfd_getb32 (buf + 16) != 0x7c0903a6)
+ return -1;
+ if (bfd_getb32 (buf + 20) != 0x4e800420)
+ return -1;
+
+ if (offset != NULL)
+ *offset = (bfd_getb32 (buf) & 0x0000ffff) / 4;
+
+ return 0;
+}
+
+static int bfd_pef_parse_function_stubs (abfd, codesec, codebuf, codelen,
+ loaderbuf, loaderlen, nsym, csym)
+ bfd *abfd;
+ asection *codesec;
+ unsigned char *codebuf;
+ size_t codelen;
+ unsigned char *loaderbuf;
+ size_t loaderlen;
+ unsigned long *nsym;
+ asymbol **csym;
+{
+ const char *const sprefix = "__stub_";
+
+ size_t codepos = 0;
+ unsigned long count = 0;
+
+ bfd_pef_loader_header header;
+ bfd_pef_imported_library *libraries = NULL;
+ bfd_pef_imported_symbol *imports = NULL;
+
+ unsigned long i;
+ int ret;
+
+ if (loaderlen < 56)
+ goto error;
+
+ ret = bfd_pef_parse_loader_header (abfd, loaderbuf, 56, &header);
+ if (ret < 0)
+ goto error;
+
+ libraries = (bfd_pef_imported_library *) bfd_malloc
+ (header.imported_library_count * sizeof (bfd_pef_imported_library));
+ imports = (bfd_pef_imported_symbol *) bfd_malloc
+ (header.total_imported_symbol_count * sizeof (bfd_pef_imported_symbol));
+
+ if (loaderlen < (56 + (header.imported_library_count * 24)))
+ goto error;
+ for (i = 0; i < header.imported_library_count; i++)
+ {
+ ret = bfd_pef_parse_imported_library
+ (abfd, loaderbuf + 56 + (i * 24), 24, &libraries[i]);
+ if (ret < 0)
+ goto error;
+ }
+
+ if (loaderlen < (56 + (header.imported_library_count * 24)
+ + (header.total_imported_symbol_count * 4)))
+ goto error;
+ for (i = 0; i < header.total_imported_symbol_count; i++)
+ {
+ ret = (bfd_pef_parse_imported_symbol
+ (abfd,
+ loaderbuf + 56 + (header.imported_library_count * 24) + (i * 4),
+ 4, &imports[i]));
+ if (ret < 0)
+ goto error;
+ }
+
+ codepos = 0;
+
+ for (;;)
+ {
+ asymbol sym;
+ const char *symname;
+ char *name;
+ unsigned long index;
+ int ret;
+
+ if (csym && (csym[count] == NULL))
+ break;
+
+ codepos += 3;
+ codepos -= (codepos % 4);
+
+ while ((codepos + 4) <= codelen)
+ {
+ if ((bfd_getb32 (codebuf + codepos) & 0xffff0000) == 0x81820000)
+ break;
+ codepos += 4;
+ }
+
+ if ((codepos + 4) > codelen)
+ break;
+
+ ret = bfd_pef_parse_function_stub (abfd, codebuf + codepos, 24, &index);
+ if (ret < 0)
+ {
+ codepos += 24;
+ continue;
+ }
+
+ if (index >= header.total_imported_symbol_count)
+ {
+ codepos += 24;
+ continue;
+ }
+
+ {
+ size_t max, namelen;
+ const char *s;
+
+ if (loaderlen < (header.loader_strings_offset + imports[index].name))
+ goto error;
+
+ max = loaderlen - (header.loader_strings_offset + imports[index].name);
+ symname = loaderbuf + header.loader_strings_offset + imports[index].name;
+ namelen = 0;
+ for (s = symname; s < (symname + max); s++)
+ {
+ if (*s == '\0')
+ break;
+ if (! isprint (*s))
+ goto error;
+ namelen++;
+ }
+ if (*s != '\0')
+ goto error;
+
+ name = bfd_alloc (abfd, strlen (sprefix) + namelen + 1);
+ if (name == NULL)
+ break;
+
+ snprintf (name, strlen (sprefix) + namelen + 1, "%s%s",
+ sprefix, symname);
+ sym.name = name;
+ }
+
+ sym.value = codepos;
+ sym.the_bfd = abfd;
+ sym.section = codesec;
+ sym.flags = 0;
+ sym.udata.i = 0;
+
+ codepos += 24;
+
+ if (csym != NULL)
+ *(csym[count]) = sym;
+
+ count++;
+ }
+
+ goto end;
+
+ end:
+ if (libraries != NULL)
+ free (libraries);
+ if (imports != NULL)
+ free (imports);
+ *nsym = count;
+ return 0;
+
+ error:
+ if (libraries != NULL)
+ free (libraries);
+ if (imports != NULL)
+ free (imports);
+ *nsym = count;
+ return -1;
+}
+
+static long bfd_pef_parse_symbols (abfd, csym)
+ bfd *abfd;
+ asymbol **csym;
+{
+ unsigned long count = 0;
+
+ asection *codesec = NULL;
+ unsigned char *codebuf = NULL;
+ size_t codelen = 0;
+
+ asection *loadersec = NULL;
+ unsigned char *loaderbuf = NULL;
+ size_t loaderlen = 0;
+
+ codesec = bfd_get_section_by_name (abfd, "code");
+ if (codesec != NULL)
+ {
+ codelen = bfd_section_size (abfd, codesec);
+ codebuf = (unsigned char *) bfd_malloc (codelen);
+ if (bfd_seek (abfd, codesec->filepos, SEEK_SET) < 0)
+ goto end;
+ if (bfd_bread ((PTR) codebuf, codelen, abfd) != codelen)
+ goto end;
+ }
+
+ loadersec = bfd_get_section_by_name (abfd, "loader");
+ if (loadersec != NULL)
+ {
+ loaderlen = bfd_section_size (abfd, loadersec);
+ loaderbuf = (unsigned char *) bfd_malloc (loaderlen);
+ if (bfd_seek (abfd, loadersec->filepos, SEEK_SET) < 0)
+ goto end;
+ if (bfd_bread ((PTR) loaderbuf, loaderlen, abfd) != loaderlen)
+ goto end;
+ }
+
+ count = 0;
+ if (codesec != NULL)
+ {
+ unsigned long ncount = 0;
+ bfd_pef_parse_traceback_tables (abfd, codesec, codebuf, codelen,
+ &ncount, csym);
+ count += ncount;
+ }
+
+ if ((codesec != NULL) && (loadersec != NULL))
+ {
+ unsigned long ncount = 0;
+ bfd_pef_parse_function_stubs
+ (abfd, codesec, codebuf, codelen, loaderbuf, loaderlen, &ncount,
+ (csym != NULL) ? (csym + count) : NULL);
+ count += ncount;
+ }
+
+ if (csym != NULL)
+ csym[count] = NULL;
+
+ end:
+ if (codebuf != NULL)
+ free (codebuf);
+
+ if (loaderbuf != NULL)
+ free (loaderbuf);
+
+ return count;
+}
+
+static long
+bfd_pef_count_symbols (abfd)
+ bfd *abfd;
+{
+ return bfd_pef_parse_symbols (abfd, NULL);
+}
+
+static long
+bfd_pef_get_symtab_upper_bound (abfd)
+ bfd *abfd;
+{
+ long nsyms = bfd_pef_count_symbols (abfd);
+ if (nsyms < 0)
+ return nsyms;
+ return ((nsyms + 1) * sizeof (asymbol *));
+}
+
+static long
+bfd_pef_get_symtab (abfd, alocation)
+ bfd *abfd;
+ asymbol **alocation;
+{
+ long i;
+ asymbol *syms;
+ long ret;
+
+ long nsyms = bfd_pef_count_symbols (abfd);
+ if (nsyms < 0)
+ return nsyms;
+
+ syms = bfd_alloc (abfd, nsyms * sizeof (asymbol));
+ if (syms == NULL)
+ return -1;
+
+ for (i = 0; i < nsyms; i++)
+ alocation[i] = &syms[i];
+
+ alocation[nsyms] = NULL;
+
+ ret = bfd_pef_parse_symbols (abfd, alocation);
+ if (ret != nsyms)
+ return 0;
+
+ return ret;
+}
+
+static asymbol *
+bfd_pef_make_empty_symbol (abfd)
+ bfd *abfd;
+{
+ return (asymbol *) bfd_alloc (abfd, sizeof (asymbol));
+}
+
+static void
+bfd_pef_get_symbol_info (abfd, symbol, ret)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asymbol *symbol;
+ symbol_info *ret;
+{
+ bfd_symbol_info (symbol, ret);
+}
+
+static int
+bfd_pef_sizeof_headers (abfd, exec)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ boolean exec ATTRIBUTE_UNUSED;
+{
+ return 0;
+}
+
+const bfd_target pef_vec =
+{
+ "pef", /* name */
+ bfd_target_pef_flavour, /* flavour */
+ BFD_ENDIAN_BIG, /* byteorder */
+ BFD_ENDIAN_BIG, /* header_byteorder */
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
+ (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE | SEC_DATA
+ | SEC_ROM | SEC_HAS_CONTENTS), /* section_flags */
+ 0, /* symbol_leading_char */
+ ' ', /* ar_pad_char */
+ 16, /* ar_max_namelen */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+ { /* bfd_check_format */
+ _bfd_dummy_target,
+ bfd_pef_object_p, /* bfd_check_format */
+ _bfd_dummy_target,
+ _bfd_dummy_target,
+ },
+ { /* bfd_set_format */
+ bfd_false,
+ bfd_pef_mkobject,
+ bfd_false,
+ bfd_false,
+ },
+ { /* bfd_write_contents */
+ bfd_false,
+ bfd_true,
+ bfd_false,
+ bfd_false,
+ },
+
+ BFD_JUMP_TABLE_GENERIC (bfd_pef),
+ BFD_JUMP_TABLE_COPY (_bfd_generic),
+ BFD_JUMP_TABLE_CORE (_bfd_nocore),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
+ BFD_JUMP_TABLE_SYMBOLS (bfd_pef),
+ BFD_JUMP_TABLE_RELOCS (bfd_pef),
+ BFD_JUMP_TABLE_WRITE (bfd_pef),
+ BFD_JUMP_TABLE_LINK (bfd_pef),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ NULL,
+
+ NULL
+};
+
+#define bfd_pef_xlib_close_and_cleanup _bfd_generic_close_and_cleanup
+#define bfd_pef_xlib_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define bfd_pef_xlib_new_section_hook _bfd_generic_new_section_hook
+#define bfd_pef_xlib_get_section_contents _bfd_generic_get_section_contents
+#define bfd_pef_xlib_set_section_contents _bfd_generic_set_section_contents
+#define bfd_pef_xlib_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define bfd_pef_xlib_set_section_contents_in_window _bfd_generic_set_section_contents_in_window
+
+static int
+bfd_pef_xlib_read_header (abfd, header)
+ bfd *abfd;
+ bfd_pef_xlib_header *header;
+{
+ unsigned char buf[76];
+
+ bfd_seek (abfd, 0, SEEK_SET);
+
+ if (bfd_bread ((PTR) buf, 76, abfd) != 76)
+ return -1;
+
+ header->tag1 = bfd_getb32 (buf);
+ header->tag2 = bfd_getb32 (buf + 4);
+ header->current_format = bfd_getb32 (buf + 8);
+ header->container_strings_offset = bfd_getb32 (buf + 12);
+ header->export_hash_offset = bfd_getb32 (buf + 16);
+ header->export_key_offset = bfd_getb32 (buf + 20);
+ header->export_symbol_offset = bfd_getb32 (buf + 24);
+ header->export_names_offset = bfd_getb32 (buf + 28);
+ header->export_hash_table_power = bfd_getb32 (buf + 32);
+ header->exported_symbol_count = bfd_getb32 (buf + 36);
+ header->frag_name_offset = bfd_getb32 (buf + 40);
+ header->frag_name_length = bfd_getb32 (buf + 44);
+ header->dylib_path_offset = bfd_getb32 (buf + 48);
+ header->dylib_path_length = bfd_getb32 (buf + 52);
+ header->cpu_family = bfd_getb32 (buf + 56);
+ header->cpu_model = bfd_getb32 (buf + 60);
+ header->date_time_stamp = bfd_getb32 (buf + 64);
+ header->current_version = bfd_getb32 (buf + 68);
+ header->old_definition_version = bfd_getb32 (buf + 72);
+ header->old_implementation_version = bfd_getb32 (buf + 76);
+
+ return 0;
+}
+
+int
+bfd_pef_xlib_scan (abfd, header)
+ bfd *abfd;
+ bfd_pef_xlib_header *header;
+{
+ bfd_pef_xlib_data_struct *mdata = NULL;
+
+ mdata = ((bfd_pef_xlib_data_struct *)
+ bfd_alloc (abfd, sizeof (bfd_pef_xlib_data_struct)));
+ if (mdata == NULL)
+ return -1;
+
+ mdata->header = *header;
+
+ abfd->flags = (abfd->xvec->object_flags
+ | (abfd->flags & (BFD_IN_MEMORY | BFD_IO_FUNCS)));
+
+ abfd->tdata.pef_xlib_data = mdata;
+
+ return 0;
+}
+
+static const bfd_target *
+bfd_pef_xlib_object_p (abfd)
+ bfd *abfd;
+{
+ struct bfd_preserve preserve;
+ bfd_pef_xlib_header header;
+
+ if (bfd_pef_xlib_read_header (abfd, &header) != 0)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ if ((header.tag1 != BFD_PEF_XLIB_TAG1)
+ || ((header.tag2 != BFD_PEF_VLIB_TAG2)
+ && (header.tag2 != BFD_PEF_BLIB_TAG2)))
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ if (! bfd_preserve_save (abfd, &preserve))
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ if (bfd_pef_xlib_scan (abfd, &header) != 0)
+ {
+ bfd_preserve_restore (abfd, &preserve);
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ bfd_preserve_finish (abfd, &preserve);
+ return abfd->xvec;
+}
+
+const bfd_target pef_xlib_vec =
+{
+ "pef-xlib", /* name */
+ bfd_target_pef_xlib_flavour, /* flavour */
+ BFD_ENDIAN_BIG, /* byteorder */
+ BFD_ENDIAN_BIG, /* header_byteorder */
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
+ (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE | SEC_DATA
+ | SEC_ROM | SEC_HAS_CONTENTS), /* section_flags */
+ 0, /* symbol_leading_char */
+ ' ', /* ar_pad_char */
+ 16, /* ar_max_namelen */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+ { /* bfd_check_format */
+ _bfd_dummy_target,
+ bfd_pef_xlib_object_p, /* bfd_check_format */
+ _bfd_dummy_target,
+ _bfd_dummy_target,
+ },
+ { /* bfd_set_format */
+ bfd_false,
+ bfd_pef_mkobject,
+ bfd_false,
+ bfd_false,
+ },
+ { /* bfd_write_contents */
+ bfd_false,
+ bfd_true,
+ bfd_false,
+ bfd_false,
+ },
+
+ BFD_JUMP_TABLE_GENERIC (bfd_pef_xlib),
+ BFD_JUMP_TABLE_COPY (_bfd_generic),
+ BFD_JUMP_TABLE_CORE (_bfd_nocore),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
+ BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols),
+ BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
+ BFD_JUMP_TABLE_WRITE (_bfd_nowrite),
+ BFD_JUMP_TABLE_LINK (_bfd_nolink),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ NULL,
+
+ NULL
+};
diff --git a/bfd/pef.h b/bfd/pef.h
new file mode 100644
index 00000000000..caeb710e16e
--- /dev/null
+++ b/bfd/pef.h
@@ -0,0 +1,186 @@
+/* PEF support for BFD.
+ Copyright 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+
+#include <stdio.h>
+
+struct bfd_pef_header
+{
+ unsigned long tag1;
+ unsigned long tag2;
+ unsigned long architecture;
+ unsigned long format_version;
+ unsigned long timestamp;
+ unsigned long old_definition_version;
+ unsigned long old_implementation_version;
+ unsigned long current_version;
+ unsigned short section_count;
+ unsigned short instantiated_section_count;
+ unsigned long reserved;
+};
+typedef struct bfd_pef_header bfd_pef_header;
+
+struct bfd_pef_loader_header
+{
+ long main_section;
+ unsigned long main_offset;
+ long init_section;
+ unsigned long init_offset;
+ long term_section;
+ unsigned long term_offset;
+ unsigned long imported_library_count;
+ unsigned long total_imported_symbol_count;
+ unsigned long reloc_section_count;
+ unsigned long reloc_instr_offset;
+ unsigned long loader_strings_offset;
+ unsigned long export_hash_offset;
+ unsigned long export_hash_table_power;
+ unsigned long exported_symbol_count;
+};
+typedef struct bfd_pef_loader_header bfd_pef_loader_header;
+
+struct bfd_pef_imported_library
+{
+ unsigned long name_offset;
+ unsigned long old_implementation_version;
+ unsigned long current_version;
+ unsigned long imported_symbol_count;
+ unsigned long first_imported_symbol;
+ unsigned char options;
+ unsigned char reserved_a;
+ unsigned short reserved_b;
+};
+typedef struct bfd_pef_imported_library bfd_pef_imported_library;
+
+enum bfd_pef_imported_library_options
+ {
+ BFD_PEF_WEAK_IMPORT_LIB = 0x40,
+ BFD_PEF_INIT_LIB_BEFORE = 0x80
+ };
+
+struct bfd_pef_imported_symbol
+{
+ unsigned char class;
+ unsigned long name;
+};
+typedef struct bfd_pef_imported_symbol bfd_pef_imported_symbol;
+
+enum bfd_pef_imported_symbol_class
+ {
+ BFD_PEF_CODE_SYMBOL = 0x00,
+ BFD_PEF_DATA_SYMBOL = 0x01,
+ BFD_PEF_TVECTOR_SYMBOL = 0x02,
+ BFD_PEF_TOC_SYMBOL = 0x03,
+ BFD_PEF_GLUE_SYMBOL = 0x04,
+ BFD_PEF_UNDEFINED_SYMBOL = 0x0F,
+ BFD_PEF_WEAK_IMPORT_SYMBOL_MASK = 0x80
+ };
+
+#define BFD_PEF_TAG1 0x4A6F7921 /* 'Joy!' */
+#define BFD_PEF_TAG2 0x70656666 /* 'peff' */
+
+#define BFD_PEF_VERSION 0x00000001
+
+struct bfd_pef_section
+{
+ long name_offset;
+ unsigned long header_offset;
+ unsigned long default_address;
+ unsigned long total_length;
+ unsigned long unpacked_length;
+ unsigned long container_length;
+ unsigned long container_offset;
+ unsigned char section_kind;
+ unsigned char share_kind;
+ unsigned char alignment;
+ unsigned char reserved;
+ asection *bfd_section;
+};
+typedef struct bfd_pef_section bfd_pef_section;
+
+#define BFD_PEF_SECTION_CODE 0
+#define BFD_PEF_SECTION_UNPACKED_DATA 1
+#define BFD_PEF_SECTION_PACKED_DATA 2
+#define BFD_PEF_SECTION_CONSTANT 3
+#define BFD_PEF_SECTION_LOADER 4
+#define BFD_PEF_SECTION_DEBUG 5
+#define BFD_PEF_SECTION_EXEC_DATA 6
+#define BFD_PEF_SECTION_EXCEPTION 7
+#define BFD_PEF_SECTION_TRACEBACK 8
+
+#define BFD_PEF_SHARE_PROCESS 1
+#define BFD_PEF_SHARE_GLOBAL 4
+#define BFD_PEF_SHARE_PROTECTED 5
+
+struct bfd_pef_data_struct
+{
+ bfd_pef_header header;
+ bfd_pef_section *sections;
+ bfd *ibfd;
+};
+typedef struct bfd_pef_data_struct bfd_pef_data_struct;
+
+#define BFD_PEF_XLIB_TAG1 0xF04D6163 /* '?Mac' */
+#define BFD_PEF_VLIB_TAG2 0x564C6962 /* 'VLib' */
+#define BFD_PEF_BLIB_TAG2 0x424C6962 /* 'BLib' */
+
+#define BFD_PEF_XLIB_VERSION 0x00000001
+
+struct bfd_pef_xlib_header
+{
+ unsigned long tag1;
+ unsigned long tag2;
+ unsigned long current_format;
+ unsigned long container_strings_offset;
+ unsigned long export_hash_offset;
+ unsigned long export_key_offset;
+ unsigned long export_symbol_offset;
+ unsigned long export_names_offset;
+ unsigned long export_hash_table_power;
+ unsigned long exported_symbol_count;
+
+ unsigned long frag_name_offset;
+ unsigned long frag_name_length;
+ unsigned long dylib_path_offset;
+ unsigned long dylib_path_length;
+ unsigned long cpu_family;
+ unsigned long cpu_model;
+ unsigned long date_time_stamp;
+ unsigned long current_version;
+ unsigned long old_definition_version;
+ unsigned long old_implementation_version;
+};
+typedef struct bfd_pef_xlib_header bfd_pef_xlib_header;
+
+struct bfd_pef_xlib_data_struct
+{
+ bfd_pef_xlib_header header;
+};
+typedef struct bfd_pef_xlib_data_struct bfd_pef_xlib_data_struct;
+
+int bfd_pef_parse_loader_header PARAMS ((bfd *, unsigned char *, size_t, bfd_pef_loader_header *));
+int bfd_pef_print_loader_section PARAMS ((bfd *, FILE *));
+void bfd_pef_print_loader_header PARAMS ((bfd *, bfd_pef_loader_header *, FILE *));
+int bfd_pef_parse_imported_library PARAMS ((bfd *, unsigned char *, size_t, bfd_pef_imported_library *));
+int bfd_pef_parse_imported_symbol PARAMS ((bfd *, unsigned char *, size_t, bfd_pef_imported_symbol *));
+int bfd_pef_scan_section PARAMS ((bfd *, bfd_pef_section *));
+int bfd_pef_scan_start_address PARAMS ((bfd *));
+int bfd_pef_scan PARAMS ((bfd *, bfd_pef_header *, bfd_pef_data_struct *));
diff --git a/bfd/po/BLD-POTFILES.in b/bfd/po/BLD-POTFILES.in
index 28f599de3d6..2dbe723a50e 100644
--- a/bfd/po/BLD-POTFILES.in
+++ b/bfd/po/BLD-POTFILES.in
@@ -1,3 +1,4 @@
+bfdver.h
elf32-ia64.c
elf32-target.h
elf64-ia64.c
diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in
index 27ce9a93a67..e11e31434ec 100644
--- a/bfd/po/SRC-POTFILES.in
+++ b/bfd/po/SRC-POTFILES.in
@@ -137,9 +137,7 @@ 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
@@ -154,21 +152,15 @@ elf32-openrisc.c
elf32-or32.c
elf32-pj.c
elf32-ppc.c
-elf32-ppcqnx.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-shqnx.c
elf32-sparc.c
elf32-v850.c
elf32-vax.c
elf32-xstormy16.c
elf32.c
-elf64-alpha-fbsd.c
elf64-alpha.c
elf64-gen.c
elf64-hppa.c
@@ -177,14 +169,12 @@ 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
-elfarmqnx-nabi.c
elfcode.h
elfcore.h
elflink.c
@@ -233,6 +223,8 @@ m68klinux.c
m68klynx.c
m68knetbsd.c
m88kmach3.c
+mach-o.c
+mach-o.h
merge.c
mipsbsd.c
mmo.c
@@ -261,6 +253,9 @@ pe-mcore.c
pe-mips.c
pe-ppc.c
pe-sh.c
+pef-traceback.h
+pef.c
+pef.h
pei-arm.c
pei-i386.c
pei-mcore.c
@@ -274,6 +269,7 @@ reloc16.c
riscix.c
sco5-core.c
section.c
+simple.c
som.c
som.h
sparclinux.c
@@ -300,3 +296,5 @@ vms.c
vms.h
xcoff-target.h
xcofflink.c
+xsym.c
+xsym.h
diff --git a/bfd/po/da.po b/bfd/po/da.po
index 6f184849c06..89ed7d0ec4e 100644
--- a/bfd/po/da.po
+++ b/bfd/po/da.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: bfd 2.12.91\n"
"POT-Creation-Date: 2002-07-23 15:55-0400\n"
-"PO-Revision-Date: 2002-09-07 21:55+0200\n"
+"PO-Revision-Date: 2002-11-09 23:25+0100\n"
"Last-Translator: Keld Simonsen <keld@dkuug.dk>\n"
"Language-Team: Danish <dansk@klid.dk>\n"
"MIME-Version: 1.0\n"
@@ -21,27 +21,27 @@ msgstr "%s: Ukendt sektionstype i a.out.adobe-fil: %x\n"
#: aout-cris.c:208
#, c-format
msgid "%s: Invalid relocation type exported: %d"
-msgstr "%s: Ugyldig relokaliseringstype eksporteret: %d"
+msgstr "%s: Ugyldig relokeringstype eksporteret: %d"
#: aout-cris.c:252
#, c-format
msgid "%s: Invalid relocation type imported: %d"
-msgstr "%s: Ugyldig relokaliseringstype importeret: %d"
+msgstr "%s: Ugyldig relokeringstype importeret: %d"
#: aout-cris.c:263
#, c-format
msgid "%s: Bad relocation record imported: %d"
-msgstr "%s: Fejlagtig relokaliseringstype importeret: %d"
+msgstr "%s: Fejlagtig relokeringstype importeret: %d"
#: aoutx.h:1282 aoutx.h:1699
#, c-format
msgid "%s: can not represent section `%s' in a.out object file format"
-msgstr "%s: kan ikke representere sektionen \"%s\" i a.out-objektfilformat"
+msgstr "%s: kan ikke repræsentere sektionen \"%s\" i a.out-objektfilformat"
#: aoutx.h:1669
#, c-format
msgid "%s: can not represent section for symbol `%s' in a.out object file format"
-msgstr "%s: kan ikke representere sektion for symbolet \"%s\" i a.out-objektfilformat"
+msgstr "%s: kan ikke repræsentere sektion for symbolet \"%s\" i a.out-objektfilformat"
#: aoutx.h:1671
msgid "*unknown*"
@@ -50,7 +50,7 @@ msgstr "*ukendt*"
#: aoutx.h:3732
#, c-format
msgid "%s: relocateable link from %s to %s not supported"
-msgstr "%s: relokaliseringsbar lænke fra %s til %s understøttes inte"
+msgstr "%s: relokérbar lænke fra %s til %s understøttes ikke"
#: archive.c:1826
msgid "Warning: writing archive was slow: rewriting timestamp\n"
@@ -99,7 +99,7 @@ msgstr "Ingen symboler"
#: bfd.c:282
msgid "Archive has no index; run ranlib to add one"
-msgstr "Arkivet har intet index; kør ranlib for at tilføje ét"
+msgstr "Arkivet har intet indeks; kør ranlib til at tilføje ét"
#: bfd.c:283
msgid "No more archived files"
@@ -181,19 +181,19 @@ msgstr "IHIHALF mangler"
#: coff-a29k.c:212 coff-or32.c:229
msgid "Unrecognized reloc"
-msgstr "Ukendt relokalisering"
+msgstr "Ukendt relokering"
#: coff-a29k.c:408
msgid "missing IHCONST reloc"
-msgstr "IHCONST-relokalisering mangler"
+msgstr "IHCONST-relokering mangler"
#: coff-a29k.c:498
msgid "missing IHIHALF reloc"
-msgstr "IHIHALF-relokalisering mangler"
+msgstr "IHIHALF-relokering mangler"
#: coff-alpha.c:881 coff-alpha.c:918 coff-alpha.c:1989 coff-mips.c:1432
msgid "GP relative relocation used when GP not defined"
-msgstr "GP-relativ relokalisering bruges når GP ikke er defineret"
+msgstr "GP-relativ relokering bruges når GP ikke er defineret"
#: coff-alpha.c:1485
msgid "using multiple gp values"
@@ -231,22 +231,22 @@ msgstr " overvej omlænkning med --support-old-code aktiveret"
#: coff-arm.c:1785 coff-tic80.c:686 cofflink.c:3031
#, c-format
msgid "%s: bad reloc address 0x%lx in section `%s'"
-msgstr "%s: fejlagtig relokaliseringsadresse 0x%lx i sektionen \"%s\""
+msgstr "%s: fejlagtig relokeringsadresse 0x%lx i sektionen \"%s\""
#: coff-arm.c:2127
#, c-format
msgid "%s: illegal symbol index in reloc: %d"
-msgstr "%s: utilladt symbolindex i relokalisering: %d"
+msgstr "%s: ikke tilladt symbolindeks i relokering: %d"
#: coff-arm.c:2255
#, c-format
msgid "ERROR: %s is compiled for APCS-%d, whereas %s is compiled for APCS-%d"
-msgstr "FEJL: %s kompileret for APCS-%d, mens %s er kompileret for APCS-%d"
+msgstr "FEJL: %s oversat for APCS-%d, mens %s er oversat for APCS-%d"
#: coff-arm.c:2270 elf32-arm.h:2297
#, c-format
msgid "ERROR: %s passes floats in float registers, whereas %s passes them in integer registers"
-msgstr "FEJL: %s overfører flydende tal i flydende talsregister, mens %s overfører dem i heltalsregister"
+msgstr "FEJL: %s overfører flydende tal i flydendetalsregister, mens %s overfører dem i heltalsregister"
#: coff-arm.c:2273 elf32-arm.h:2302
#, c-format
@@ -256,12 +256,12 @@ msgstr "FEJL: %s overfører flydende tal i heltalsregister, mens %s overfører dem
#: coff-arm.c:2288
#, c-format
msgid "ERROR: %s is compiled as position independent code, whereas target %s is absolute position"
-msgstr "FEJL: %s er kompileret som positionsuafhængig kode, mens målet %s har absolut position"
+msgstr "FEJL: %s er oversat som positionsuafhængig kode, mens målet %s har absolut position"
#: coff-arm.c:2291
#, c-format
msgid "ERROR: %s is compiled as absolute position code, whereas target %s is position independent"
-msgstr "FEJL: %s er kompileret som kode med absolut position, mens målet %s er positionsuafhængigt"
+msgstr "FEJL: %s er oversat som kode med absolut position, mens målet %s er positionsuafhængigt"
#: coff-arm.c:2320 elf32-arm.h:2358
#, c-format
@@ -322,31 +322,31 @@ msgstr "usikker kaldskonvention for ikke-COFF-symbol"
#: coff-m68k.c:481 coff-mips.c:2429 elf32-m68k.c:2157 elf32-mips.c:1844
msgid "unsupported reloc type"
-msgstr "relokaliseringstypen understøttes ikke"
+msgstr "relokeringstypen understøttes ikke"
#: coff-mips.c:874 elf32-mips.c:1062 elf64-mips.c:1609
msgid "GP relative relocation when _gp not defined"
-msgstr "GP-relativ relokalisering når _gp ikke var defineret"
+msgstr "GP-relativ relokering når _gp ikke var defineret"
#. No other sections should appear in -membedded-pic
#. code.
#: coff-mips.c:2466
msgid "reloc against unsupported section"
-msgstr "relokalisering mod sektion som ikke understøttes"
+msgstr "relokering mod sektion som ikke understøttes"
#: coff-mips.c:2474
msgid "reloc not properly aligned"
-msgstr "relokalisering ikke på lige grænse"
+msgstr "relokering ikke på passende afrundet adresse"
#: coff-rs6000.c:2766
#, c-format
msgid "%s: unsupported relocation type 0x%02x"
-msgstr "%s: relokaliseringstypen 0x%02x understøttes ikke"
+msgstr "%s: relokeringstypen 0x%02x understøttes ikke"
#: coff-rs6000.c:2859
#, c-format
msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"
-msgstr "%s: TOC-relokalisering ved 0x%x til symbolet \"%s\" uden nogen TOC-post"
+msgstr "%s: TOC-relokering ved 0x%x til symbolet \"%s\" uden nogen TOC-post"
#: coff-rs6000.c:3590 coff64-rs6000.c:2091
#, c-format
@@ -356,17 +356,17 @@ msgstr "%s: symbolet \"%s\" har ukendt smclas %d"
#: coff-tic54x.c:279 coff-tic80.c:449
#, c-format
msgid "Unrecognized reloc type 0x%x"
-msgstr "Ukendt relokaliseringstype 0x%x"
+msgstr "Ukendt relokeringstype 0x%x"
#: coff-tic54x.c:390 coffcode.h:4974
#, c-format
msgid "%s: warning: illegal symbol index %ld in relocs"
-msgstr "%s: advarsel: utilladt symbolindex %ld i relokaliseringerne"
+msgstr "%s: advarsel: ikke tilladt symbolindeks %ld i relokeringerne"
#: coff-w65.c:363
#, c-format
msgid "ignoring reloc %s\n"
-msgstr "ignorerer relokalisering %s\n"
+msgstr "ignorerer relokering %s\n"
#: coffcode.h:1086
#, c-format
@@ -381,7 +381,7 @@ msgstr "Ukendt TI COFF-mål-id \"0x%x\""
#: coffcode.h:4365
#, c-format
msgid "%s: warning: illegal symbol index %ld in line numbers"
-msgstr "%s: advarsel: utilladt symbolindex %ld i linjenummer"
+msgstr "%s: advarsel: ikke tilladt symbolindeks %ld i linjenumre"
#: coffcode.h:4379
#, c-format
@@ -401,7 +401,7 @@ msgstr "advarsel: %s: lokalt symbol \"%s\" har ingen sektion"
#: coffcode.h:5012
#, c-format
msgid "%s: illegal relocation type %d at address 0x%lx"
-msgstr "%s: utilladt relokaliseringstype %d på adresse 0x%lx"
+msgstr "%s: ikke tilladt relokeringstype %d på adresse 0x%lx"
#: coffgen.c:1661
#, c-format
@@ -416,12 +416,12 @@ msgstr "Advarsel: typen på symbol \"%s\" ændredes fra %d til %d i %s"
#: cofflink.c:2321
#, c-format
msgid "%s: relocs in section `%s', but it has no contents"
-msgstr "%s: relokaliseringer i sektionen \"%s\", men den har intet indhold"
+msgstr "%s: relokeringer i sektionen \"%s\", men den har intet indhold"
#: cofflink.c:2664 coffswap.h:877
#, c-format
msgid "%s: %s: reloc overflow: 0x%lx > 0xffff"
-msgstr "%s: %s: relokalisering giver overløb: 0x%lx > 0xffff"
+msgstr "%s: %s: relokering giver overløb: 0x%lx > 0xffff"
#: cofflink.c:2673 coffswap.h:864
#, c-format
@@ -444,7 +444,7 @@ msgstr "Dwarf-fejl: Kan ikke finde sektionen .debug_abbrev."
#: dwarf2.c:560
#, c-format
msgid "Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size (%lu)."
-msgstr "Dwarf-fejl: Forkortningsafstanden (%lu) større end eller lig med størrelsen .debug_abbrev (%lu)."
+msgstr "Dwarf-fejl: Forkortelsesafstanden (%lu) større end eller lig med størrelsen .debug_abbrev (%lu)."
#: dwarf2.c:757
#, c-format
@@ -471,7 +471,7 @@ msgstr "Dwarf-fejl: vanskabt linjenummerssektion."
#: dwarf2.c:1355 dwarf2.c:1566
#, c-format
msgid "Dwarf Error: Could not find abbrev number %u."
-msgstr "Dwarf-fejl: Kunne ikke finde forkortningsnumret %u."
+msgstr "Dwarf-fejl: Kunne ikke finde forkortelsesnumret %u."
#: dwarf2.c:1527
#, c-format
@@ -486,7 +486,7 @@ msgstr "Dwarf-fejl: fandt adressestørrelsen \"%u\", denne læser kan ikke håndter
#: dwarf2.c:1557
#, c-format
msgid "Dwarf Error: Bad abbrev number: %u."
-msgstr "Dwarf-fejl: Fejlagtigt forkortningsnummer: %u."
+msgstr "Dwarf-fejl: Fejlagtigt forkortelsesnummer: %u."
#: ecoff.c:1318
#, c-format
@@ -518,7 +518,7 @@ msgid ""
" End+1 symbol: %-7ld Type: %s"
msgstr ""
"\n"
-" Symbol slut+1: %-7ld Typ: %s"
+" Symbol slut+1: %-7ld Type: %s"
#: ecoff.c:1607
#, c-format
@@ -569,21 +569,21 @@ msgstr ""
#: elf64-sh64.c:1659
#, c-format
msgid "%s: warning: unresolvable relocation against symbol `%s' from %s section"
-msgstr "%s: advarsel: uløselig relokalisering mod symbol \"%s\" fra sektionen %s"
+msgstr "%s: advarsel: uløselig relokering mod symbol \"%s\" fra sektionen %s"
#: elf-m10200.c:446 elf-m10300.c:656 elf32-arm.h:2084 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:1278 elf32-openrisc.c:439
#: elf32-v850.c:1691 elf32-xstormy16.c:933 elf64-mmix.c:1302
msgid "internal error: out of range error"
-msgstr "intern fejl: udenfor intervallet"
+msgstr "intern fejl: uden for intervallet"
#: elf-m10200.c:450 elf-m10300.c:660 elf32-arm.h:2088 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:1282 elf32-openrisc.c:443
#: elf32-v850.c:1695 elf32-xstormy16.c:937 elf64-mmix.c:1306 elfxx-mips.c:5264
msgid "internal error: unsupported relocation error"
-msgstr "intern fejl: relokaliseringen understøttes ikke"
+msgstr "intern fejl: relokeringen understøttes ikke"
#: elf-m10200.c:454 elf-m10300.c:664 elf32-arm.h:2092 elf32-d10v.c:489
#: elf32-h8300.c:556 elf32-m32r.c:1286
@@ -652,7 +652,7 @@ msgstr " kræves fra %s:\n"
#: elf.c:1902
#, c-format
msgid "%s: invalid link %lu for reloc section %s (index %u)"
-msgstr "%s: ugyldig lænke %lu for relokaliseringssektion %s (index %u)"
+msgstr "%s: ugyldig lænke %lu for relokeringssektion %s (indeks %u)"
#: elf.c:3603
#, c-format
@@ -677,7 +677,7 @@ msgstr "%s: advarsel: allokeret sektion \"%s\" ikke i segment"
#: elf.c:4472
#, c-format
msgid "%s: symbol `%s' required but not present"
-msgstr "%s: symbol \"%s\" kræves men er ikke tilstede"
+msgstr "%s: symbol \"%s\" kræves, men er ikke tilstede"
#: elf.c:4749
#, c-format
@@ -687,7 +687,7 @@ msgstr "%s: advarsel: Tomt indlæsningsbart segment opdaget, er dette meningen?\n
#: elf.c:6193
#, c-format
msgid "%s: unsupported relocation type %s"
-msgstr "%s: relokaliseringstypen %s understøttes ikke"
+msgstr "%s: relokeringstypen %s understøttes ikke"
#: elf32-arm.h:1221
#, c-format
@@ -702,12 +702,12 @@ msgstr "%s: Advarsel: Thumb BLX-instruktionen bruger thumb-funktionen \"%s\" som
#: elf32-arm.h:1914 elf32-sh.c:4125
#, c-format
msgid "%s(%s+0x%lx): %s relocation against SEC_MERGE section"
-msgstr "%s(%s+0x%lx): %s relokalisering mod SEC_MERGE-sektion"
+msgstr "%s(%s+0x%lx): %s relokering mod SEC_MERGE-sektion"
#: elf32-arm.h:2008
#, c-format
msgid "%s: warning: unresolvable relocation %d against symbol `%s' from %s section"
-msgstr "%s: advarsel: uløselig relokalisering %d mod symbol \"%s\" fra sektionen %s"
+msgstr "%s: advarsel: uløselig relokering %d mod symbol \"%s\" fra sektionen %s"
#: elf32-arm.h:2176
#, c-format
@@ -717,12 +717,12 @@ msgstr "Advarsel: Fjerner samvirkendeflaget i %s eftersom ikke-samvirkende kode
#: elf32-arm.h:2271
#, c-format
msgid "ERROR: %s is compiled for EABI version %d, whereas %s is compiled for version %d"
-msgstr "FEJL: %s er kompileret for EABI version %d, mens %s er kompileret for version %d"
+msgstr "FEJL: %s er oversat for EABI version %d, mens %s er oversat for version %d"
#: elf32-arm.h:2285
#, c-format
msgid "ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d"
-msgstr "FEJL: %s er kompileret for APCS-%d, mens målet %s bruger APCS-%d"
+msgstr "FEJL: %s er oversat for APCS-%d, mens målet %s bruger APCS-%d"
#: elf32-arm.h:2313
#, c-format
@@ -794,7 +794,7 @@ msgstr " [Version2 EABI]"
#: elf32-arm.h:2457
msgid " [dynamic symbols use segment index]"
-msgstr " [dynamiske symboler bruger segmentindex]"
+msgstr " [dynamiske symboler bruger segmentindeks]"
#: elf32-arm.h:2460
msgid " [mapping symbols precede others]"
@@ -806,7 +806,7 @@ msgstr " <EABI-version genkendes ikke>"
#: elf32-arm.h:2474
msgid " [relocatable executable]"
-msgstr " [relokaliseringsbar kørbar fil]"
+msgstr " [relokérbar kørbar fil]"
#: elf32-arm.h:2477
msgid " [has entry point]"
@@ -820,17 +820,17 @@ msgstr "<Ukendte flagbit er sat>"
#: elf32-i860.c:1039 elf32-openrisc.c:447 elf32-v850.c:1699
#: elf32-xstormy16.c:941 elf64-mmix.c:1310
msgid "internal error: dangerous relocation"
-msgstr "intern fejl: farlig relokalisering"
+msgstr "intern fejl: farlig relokering"
#: elf32-cris.c:949
#, c-format
msgid "%s: unresolvable relocation %s against symbol `%s' from %s section"
-msgstr "%s: uløselig relokalisering %s mod symbol \"%s\" fra sektionen %s"
+msgstr "%s: uløselig relokering %s mod symbol \"%s\" fra sektionen %s"
#: elf32-cris.c:1012
#, c-format
msgid "%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section"
-msgstr "%s: Hverken nogen PLT eller GOT for relokalisering %s mod symbol \"%s\" fra sektionen %s"
+msgstr "%s: Hverken nogen PLT eller GOT for relokering %s mod symbol \"%s\" fra sektionen %s"
#: elf32-cris.c:1015 elf32-cris.c:1141
msgid "[whose name is lost]"
@@ -839,27 +839,27 @@ msgstr "[hvis navn er tabt]"
#: elf32-cris.c:1130
#, c-format
msgid "%s: relocation %s with non-zero addend %d against local symbol from %s section"
-msgstr "%s: relokalisering %s med ikke-tomt addendum %d mod lokalt symbol fra sektionen %s"
+msgstr "%s: relokering %s med ikke-tomt addendum %d mod lokalt symbol fra sektionen %s"
#: elf32-cris.c:1137
#, c-format
msgid "%s: relocation %s with non-zero addend %d against symbol `%s' from %s section"
-msgstr "%s: relokalisering %s med ikke-tomt addendum %d mod symbol \"%s\" fra sektionen %s"
+msgstr "%s: relokering %s med ikke-tomt addendum %d mod symbol \"%s\" fra sektionen %s"
#: elf32-cris.c:1155
#, c-format
msgid "%s: relocation %s is not allowed for global symbol: `%s' from %s section"
-msgstr "%s: relokaliseringen %s er ikke tilladt for globalt symbol: \"%s\" fra sektionen %s"
+msgstr "%s: relokeringen %s er ikke tilladt for globalt symbol: \"%s\" fra sektionen %s"
#: elf32-cris.c:1170
#, c-format
msgid "%s: relocation %s in section %s with no GOT created"
-msgstr "%s: relokalisering %s i sektionen %s uden GOT oprettet"
+msgstr "%s: relokering %s i sektionen %s uden GOT oprettet"
#: elf32-cris.c:1288
#, c-format
msgid "%s: Internal inconsistency; no relocation section %s"
-msgstr "%s: Intern inkonsistens; ingen relokaliseringssektion %s"
+msgstr "%s: Intern inkonsistens; ingen relokeringssektion %s"
#: elf32-cris.c:2514
#, c-format
@@ -868,31 +868,31 @@ msgid ""
" relocation %s should not be used in a shared object; recompile with -fPIC"
msgstr ""
"%s, sektion %s:\n"
-" relokaliseringen %s bør ikke bruges i et delt objekt; genoversæt med -fPIC"
+" relokeringen %s bør ikke bruges i et delt objekt; genoversæt med -fPIC"
#: elf32-cris.c:2991
msgid " [symbols have a _ prefix]"
-msgstr " [symboler har et _-prefix]"
+msgstr " [symboler har et _-præfiks]"
#: elf32-cris.c:3030
#, c-format
msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols"
-msgstr "%s: bruger symboler med _-prefix, men skriver fil med symboler uden prefix"
+msgstr "%s: bruger symboler med _-præfiks, men skriver fil med symboler uden præfiks"
#: elf32-cris.c:3031
#, c-format
msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols"
-msgstr "%s: bruger symboler uden prefix, men skriver fil med symboler med _-prefix"
+msgstr "%s: bruger symboler uden præfiks, men skriver fil med symboler med _-præfiks"
#: elf32-frv.c:1217
#, c-format
msgid "%s: compiled with %s and linked with modules that use non-pic relocations"
-msgstr "%s: kompileret med %s og lænket med moduler som bruger ikke-pic-relokalisering"
+msgstr "%s: oversat med %s og lænket med moduler som bruger ikke-pic-relokering"
#: elf32-frv.c:1267
#, c-format
msgid "%s: compiled with %s and linked with modules compiled with %s"
-msgstr "%s: kompileret med %s og lænket med moduler som kompileredes med %s"
+msgstr "%s: oversat med %s og lænket med moduler som oversattes med %s"
#: elf32-frv.c:1279
#, c-format
@@ -907,7 +907,7 @@ msgstr "private flag = 0x%lx:"
#: elf32-gen.c:82 elf64-gen.c:82
#, c-format
msgid "%s: Relocations in generic ELF (EM: %d)"
-msgstr "%s: Relokalisering i generisk ELF (EM: %d)"
+msgstr "%s: Relokering i generisk ELF (EM: %d)"
#: elf32-hppa.c:671 elf64-ppc.c:2323
#, c-format
@@ -922,17 +922,17 @@ msgstr "%s(%s+0x%lx): kan ikke nå %s, genoversæt med -ffunction-sections"
#: elf32-hppa.c:1338 elf64-x86-64.c:673
#, c-format
msgid "%s: relocation %s can not be used when making a shared object; recompile with -fPIC"
-msgstr "%s: relokaliseringen %s kan ikke bruges når et delt objekt oprettes; genoversæt med -fPIC"
+msgstr "%s: relokeringen %s kan ikke bruges når et delt objekt oprettes; genoversæt med -fPIC"
#: elf32-hppa.c:1358
#, c-format
msgid "%s: relocation %s should not be used when making a shared object; recompile with -fPIC"
-msgstr "%s: relokaliseringen %s bør ikke bruges når et delt objekt oprettes; genoversæt med -fPIC"
+msgstr "%s: relokeringen %s bør ikke bruges når et delt objekt oprettes; genoversæt med -fPIC"
#: elf32-hppa.c:1551
#, c-format
msgid "Could not find relocation section for %s"
-msgstr "Kunne ikke finde relokaliseringssektion for %s"
+msgstr "Kunne ikke finde relokeringssektion for %s"
#: elf32-hppa.c:2855
#, c-format
@@ -956,12 +956,12 @@ msgstr ".got-sektionen følger ikke umiddelbart efter .plt-sektion"
#: elf32-i386.c:379
#, c-format
msgid "%s: invalid relocation type %d"
-msgstr "%s: ugyldig relokaliseringstype %d"
+msgstr "%s: ugyldig relokeringstype %d"
#: elf32-i386.c:876 elf32-s390.c:649 elf64-s390.c:595 elf64-x86-64.c:591
#, c-format
msgid "%s: bad symbol index: %d"
-msgstr "%s: fejlagtigt symbolindex: %d"
+msgstr "%s: fejlagtigt symbolindeks: %d"
#: elf32-i386.c:948
#, c-format
@@ -972,7 +972,7 @@ msgstr "%s: \"%s\" kaldt både som lokalt normalt symbol og lokalt trådsymbol"
#: elf64-x86-64.c:761
#, c-format
msgid "%s: bad relocation section name `%s'"
-msgstr "%s: fejlagtig relokaliseringssektionsnavn \"%s\""
+msgstr "%s: fejlagtig relokeringssektionsnavn \"%s\""
#: elf32-i386.c:1159 elf64-alpha.c:4768
#, c-format
@@ -983,28 +983,28 @@ msgstr "%s: lokal TLS-eksekveringskode kan ikke lænkes ind i delte objekter"
#: elf64-s390.c:1945 elf64-sparc.c:2578 elf64-x86-64.c:1948
#, c-format
msgid "%s(%s+0x%lx): unresolvable relocation against symbol `%s'"
-msgstr "%s(%s+0x%lx): uløselig relokalisering mod symbol \"%s\""
+msgstr "%s(%s+0x%lx): uløselig relokering mod symbol \"%s\""
#: elf32-i386.c:2784 elf32-s390.c:2019 elf64-ppc.c:5977 elf64-s390.c:1983
#: elf64-x86-64.c:1986
#, c-format
msgid "%s(%s+0x%lx): reloc against `%s': error %d"
-msgstr "%s(%s+0x%lx): relokalisering mod \"%s\": fejl %d"
+msgstr "%s(%s+0x%lx): relokering mod \"%s\": fejl %d"
#: elf32-m32r.c:924
msgid "SDA relocation when _SDA_BASE_ not defined"
-msgstr "SDA-relokalisering når _SDA_BASE_ ikke er defineret"
+msgstr "SDA-relokering når _SDA_BASE_ ikke er defineret"
#: elf32-ia64.c:3687 elf32-m32r.c:1013 elf32-ppc.c:2987 elf64-alpha.c:4185
#: elf64-alpha.c:4313 elf64-ia64.c:3687
#, c-format
msgid "%s: unknown relocation type %d"
-msgstr "%s: ukendt relokaliseringstype %d"
+msgstr "%s: ukendt relokeringstype %d"
#: elf32-m32r.c:1221
#, c-format
msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)"
-msgstr "%s: Målet (%s) for en %s-relokalisering er i forkert sektion (%s)"
+msgstr "%s: Målet (%s) for en %s-relokering er i forkert sektion (%s)"
#: elf32-m32r.c:1947
#, c-format
@@ -1035,16 +1035,16 @@ msgstr " [m68000]"
#: elf32-mcore.c:354 elf32-mcore.c:457
#, c-format
msgid "%s: Relocation %s (%d) is not currently supported.\n"
-msgstr "%s: Relokalisering %s (%d) understøttes ikke i øjeblikket.\n"
+msgstr "%s: Relokering %s (%d) understøttes ikke i øjeblikket.\n"
#: elf32-mcore.c:442
#, c-format
msgid "%s: Unknown relocation type %d\n"
-msgstr "%s: Ukendt relokaliseringstype %d\n"
+msgstr "%s: Ukendt relokeringstype %d\n"
#: elf32-mips.c:1152 elf64-mips.c:1783
msgid "32bits gp relative relocation occurs for an external symbol"
-msgstr "32-bit gp-relativ relokalisering forekom for et eksternt symbol"
+msgstr "32-bit gp-relativ relokering forekom for et eksternt symbol"
#: elf32-mips.c:1301
#, c-format
@@ -1054,12 +1054,12 @@ msgstr "Lænkning af mips16-objekter til %s-format understøttes ikke"
#: elf32-ppc.c:1460
#, c-format
msgid "%s: compiled with -mrelocatable and linked with modules compiled normally"
-msgstr "%s: kompileret med -mrelocatable og lænket med moduler som kompileredes normalt"
+msgstr "%s: oversat med -mrelocatable og lænket med moduler som oversattes normalt"
#: elf32-ppc.c:1468
#, c-format
msgid "%s: compiled normally and linked with modules compiled with -mrelocatable"
-msgstr "%s: kompileret normalt og lænket med moduler som kompileredes med -mrelocatable"
+msgstr "%s: oversat normalt og lænket med moduler som oversattes med -mrelocatable"
#: elf32-ppc.c:1494 elf64-sparc.c:2989 elfxx-mips.c:7713
#, c-format
@@ -1074,22 +1074,22 @@ msgstr "%s: Ukendt speciallænkertype %d"
#: elf32-ppc.c:2273 elf32-ppc.c:2307 elf32-ppc.c:2342
#, c-format
msgid "%s: relocation %s cannot be used when making a shared object"
-msgstr "%s: relokaliseringen %s kan ikke bruges når et delt objekt oprettes"
+msgstr "%s: relokeringen %s kan ikke bruges når et delt objekt oprettes"
#: elf32-ppc.c:3126 elf64-ppc.c:5473
#, c-format
msgid "%s: unknown relocation type %d for symbol %s"
-msgstr "%s: ukendt relokaliseringstype %d for symbol %s"
+msgstr "%s: ukendt relokeringstype %d for symbol %s"
#: elf32-ppc.c:3482 elf32-ppc.c:3503 elf32-ppc.c:3553
#, c-format
msgid "%s: The target (%s) of a %s relocation is in the wrong output section (%s)"
-msgstr "%s: Målet (%s) for en %s-relokalisering er i forkert uddatasektion (%s)"
+msgstr "%s: Målet (%s) for en %s-relokering er i forkert uddatasektion (%s)"
#: elf32-ppc.c:3619
#, c-format
msgid "%s: Relocation %s is not yet supported for symbol %s."
-msgstr "%s: Relokaliseringen %s understøttes ikke endnu for symbol %s."
+msgstr "%s: Relokeringen %s understøttes ikke endnu for symbol %s."
#: elf32-sh.c:1964
#, c-format
@@ -1109,7 +1109,7 @@ msgstr "%s: 0x%lx: advarsel: fejlagtig R_SH_USES-indlæsningsafstand"
#: elf32-sh.c:2008
#, c-format
msgid "%s: 0x%lx: warning: could not find expected reloc"
-msgstr "%s: 0x%lx: advarsel: kunne ikke finde forventet relokalisering"
+msgstr "%s: 0x%lx: advarsel: kunne ikke finde forventet relokering"
#: elf32-sh.c:2036
#, c-format
@@ -1119,7 +1119,7 @@ msgstr "%s: 0x%lx: advarsel: symbol i uventet sektion"
#: elf32-sh.c:2153
#, c-format
msgid "%s: 0x%lx: warning: could not find expected COUNT reloc"
-msgstr "%s: 0x%lx: advarsel: kunne ikke finde forventet COUNT-relokalisering"
+msgstr "%s: 0x%lx: advarsel: kunne ikke finde forventet COUNT-relokering"
#: elf32-sh.c:2162
#, c-format
@@ -1129,7 +1129,7 @@ msgstr "%s: 0x%lx: advarsel: fejlagtigt antal"
#: elf32-sh.c:2550 elf32-sh.c:2926
#, c-format
msgid "%s: 0x%lx: fatal: reloc overflow while relaxing"
-msgstr "%s: 0x%lx: fatalt: relokalisering giver overløb ved forenklingen"
+msgstr "%s: 0x%lx: fatalt: relokering giver overløb ved forenklingen"
#: elf32-sh.c:4073 elf64-sh64.c:1576
msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled"
@@ -1138,17 +1138,17 @@ msgstr "Uventet STO_SH5_ISA32 på lokalt symbol håndteres ikke"
#: elf32-sh.c:4284
#, c-format
msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation"
-msgstr "%s: 0x%lx: fatalt: ujusteret grenmål for relokalisering for forenklingsunderstøttelse"
+msgstr "%s: 0x%lx: fatalt: ujusteret grenmål for relokering for forenklingsunderstøttelse"
#: elf32-sh64.c:203 elf64-sh64.c:2364
#, c-format
msgid "%s: compiled as 32-bit object and %s is 64-bit"
-msgstr "%s: kompileret som 32-bitsobjekt og %s er 64-bit"
+msgstr "%s: oversat som 32-bitsobjekt og %s er 64-bit"
#: elf32-sh64.c:206 elf64-sh64.c:2367
#, c-format
msgid "%s: compiled as 64-bit object and %s is 32-bit"
-msgstr "%s: kompileret som 64-bitsobjekt og %s er 32-bit"
+msgstr "%s: oversat som 64-bitsobjekt og %s er 32-bit"
#: elf32-sh64.c:208 elf64-sh64.c:2369
#, c-format
@@ -1176,27 +1176,27 @@ msgstr "%s: GAS-fejl: uventet PTB-instruktion med R_SH_PT_16"
#: elf32-sh64.c:593 elf64-sh64.c:1703
#, c-format
msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n"
-msgstr "%s: fejl: ojusteret relokaliseringstype %d på %08x relokalisering %08x\n"
+msgstr "%s: fejl: ujusteret relokeringstype %d på %08x relokering %08x\n"
#: elf32-sh64.c:677
-#, c-format
+#, fuzzy, c-format
msgid "%s: could not write out added .cranges entries"
-msgstr "%s: kunne ikke udskrive tilføjede .cranges-poster"
+msgstr "%s: kunne ikke udskrive tilføjede .crangives-poster"
#: elf32-sh64.c:739
-#, c-format
+#, fuzzy, c-format
msgid "%s: could not write out sorted .cranges entries"
-msgstr "%s: kunne ikke udskrive sorterede cranges-poster"
+msgstr "%s: kunne ikke udskrive sorterede crangives-poster"
#: elf32-sparc.c:1535 elf64-sparc.c:2224
#, c-format
msgid "%s: probably compiled without -fPIC?"
-msgstr "%s: nok kompileret uden -fPIC?"
+msgstr "%s: nok oversat uden -fPIC?"
#: elf32-sparc.c:2002
#, c-format
msgid "%s: compiled for a 64 bit system and target is 32 bit"
-msgstr "%s: kompileret for et 64-bitssystem og målet er 32-bit"
+msgstr "%s: oversat for et 64-bitssystem og målet er 32-bit"
#: elf32-sparc.c:2016
#, c-format
@@ -1204,22 +1204,22 @@ msgid "%s: linking little endian files with big endian files"
msgstr "%s: lænker little endian-filer med big endian-filer"
#: elf32-v850.c:682
-#, c-format
+#, fuzzy, c-format
msgid "Variable `%s' cannot occupy in multiple small data regions"
msgstr "Variabel \"%s\" kan ikke befinde sig i flere små dataområder"
#: elf32-v850.c:685
-#, c-format
+#, fuzzy, c-format
msgid "Variable `%s' can only be in one of the small, zero, and tiny data regions"
msgstr "Variabel \"%s\" kan kun være i et af de små, tomme og bittesmå dataområder"
#: elf32-v850.c:688
-#, c-format
+#, fuzzy, c-format
msgid "Variable `%s' cannot be in both small and zero data regions simultaneously"
msgstr "Variabel \"%s\" kan ikke være i både små og tomme dataområder samtidigt"
#: elf32-v850.c:691
-#, c-format
+#, fuzzy, c-format
msgid "Variable `%s' cannot be in both small and tiny data regions simultaneously"
msgstr "Variabel \"%s\" kan ikke være i både små og bittesmå dataområder samtidigt"
@@ -1230,7 +1230,7 @@ msgstr "Variabel \"%s\" kan ikke være i både tomme og bittesmå dataområder samti
#: elf32-v850.c:1072
msgid "FAILED to find previous HI16 reloc\n"
-msgstr "MISLYKKEDES med at finde tidligere HI16-relokalisering\n"
+msgstr "MISLYKKEDES med at finde tidligere HI16-relokering\n"
#: elf32-v850.c:1703
msgid "could not locate special linker symbol __gp"
@@ -1291,20 +1291,20 @@ msgstr "%s: advarsel: PLT-addendum %d til \"%s\" fra sektionen %s ignoreredes"
#: elf32-vax.c:1814
#, c-format
msgid "%s: warning: %s relocation against symbol `%s' from %s section"
-msgstr "%s: advarsel: %s-relokalisering mod symbol \"%s\" fra sektionen %s"
+msgstr "%s: advarsel: %s-relokering mod symbol \"%s\" fra sektionen %s"
#: elf32-vax.c:1820
#, c-format
msgid "%s: warning: %s relocation to 0x%x from %s section"
-msgstr "%s: advarsel: %s-relokalisering til 0x%x fra sektionen %s"
+msgstr "%s: advarsel: %s-relokering til 0x%x fra sektionen %s"
#: elf32-ia64.c:2280 elf32-xstormy16.c:414 elf64-ia64.c:2280
msgid "non-zero addend in @fptr reloc"
-msgstr "ikke-tomt addendum i @fptr-relokalisering"
+msgstr "ikke-tomt addendum i @fptr-relokering"
#: elf64-alpha.c:1097
msgid "GPDISP relocation did not find ldah and lda instructions"
-msgstr "GPDISP-relokalisering fandt ingen ldah- og lda-instruktioner"
+msgstr "GPDISP-relokering fandt ingen ldah- og lda-instruktioner"
#: elf64-alpha.c:3675
#, c-format
@@ -1314,12 +1314,12 @@ msgstr "%s: .got-subsegment overskrider 64 kB (størrelse %d)"
#: elf64-alpha.c:4498 elf64-alpha.c:4510
#, c-format
msgid "%s: gp-relative relocation against dynamic symbol %s"
-msgstr "%s: gp-relativ relokalisering mod dynamisk symbol %s"
+msgstr "%s: gp-relativ relokering mod dynamisk symbol %s"
#: elf64-alpha.c:4536 elf64-alpha.c:4676
#, c-format
msgid "%s: pc-relative relocation against dynamic symbol %s"
-msgstr "%s: pc-relativ relokalisering mod dynamisk symbol %s"
+msgstr "%s: pc-relativ relokering mod dynamisk symbol %s"
#: elf64-alpha.c:4564
#, c-format
@@ -1333,27 +1333,27 @@ msgstr "<ukendt>"
#: elf64-alpha.c:4594
#, c-format
msgid "%s: !samegp reloc against symbol without .prologue: %s"
-msgstr "%s: !samegp-relokalisering mod symbol uden .prologue: %s"
+msgstr "%s: !samegp-relokering mod symbol uden .prologue: %s"
#: elf64-alpha.c:4639
#, c-format
msgid "%s: unhandled dynamic relocation against %s"
-msgstr "%s: uhåndteret dynamisk relokalisering mod %s"
+msgstr "%s: uhåndteret dynamisk relokering mod %s"
#: elf64-alpha.c:4752
#, c-format
msgid "%s: dtp-relative relocation against dynamic symbol %s"
-msgstr "%s: dtp-relativ relokalisering mod dynamisk symbol %s"
+msgstr "%s: dtp-relativ relokering mod dynamisk symbol %s"
#: elf64-alpha.c:4775
#, c-format
msgid "%s: tp-relative relocation against dynamic symbol %s"
-msgstr "%s: tp-relativ relokalisering mod dynamisk symbol %s"
+msgstr "%s: tp-relativ relokering mod dynamisk symbol %s"
#: elf64-hppa.c:2080
#, c-format
msgid "stub entry for %s cannot load .plt, dp offset = %ld"
-msgstr "stubpost for %s kan ikke læse in .plt, dp-afstand = %ld"
+msgstr "stubpost for %s kan ikke indlæse .plt, dp-afstand = %ld"
#: elf64-mmix.c:1002
#, c-format
@@ -1361,28 +1361,28 @@ msgid ""
"%s: Internal inconsistency error for value for\n"
" linker-allocated global register: linked: 0x%lx%08lx != relaxed: 0x%lx%08lx\n"
msgstr ""
-"%s: Intern inkkonsistensfejl for værdien for\n"
-" lænkerallokeret globalt register: lænket: 0x%lx%08lx != afslappet: 0x%lx%08lx\n"
+"%s: Intern inkonsistensfejl for værdien for\n"
+" lænkerallokeret globalt register: lænket: 0x%lx%08lx != forenklet: 0x%lx%08lx\n"
#: elf64-mmix.c:1386
#, c-format
msgid "%s: base-plus-offset relocation against register symbol: (unknown) in %s"
-msgstr "%s: base-plus-afstandsrelokalisering mod registersymbol: (ukendt) i %s"
+msgstr "%s: base-plus-afstandsrelokering mod registersymbol: (ukendt) i %s"
#: elf64-mmix.c:1391
#, c-format
msgid "%s: base-plus-offset relocation against register symbol: %s in %s"
-msgstr "%s: base-plus-afstandsrelokalisering mod registersymbol: %s i %s"
+msgstr "%s: base-plus-afstandsrelokering mod registersymbol: %s i %s"
#: elf64-mmix.c:1435
#, c-format
msgid "%s: register relocation against non-register symbol: (unknown) in %s"
-msgstr "%s: registerrelokalisering mod ikke-registersymbol: (ukendt) i %s"
+msgstr "%s: registerrelokering mod ikke-registersymbol: (ukendt) i %s"
#: elf64-mmix.c:1440
#, c-format
msgid "%s: register relocation against non-register symbol: %s in %s"
-msgstr "%s: registerrelokalisering mod ikke-registersymbol: %s i %s"
+msgstr "%s: registerrelokering mod ikke-registersymbol: %s i %s"
#: elf64-mmix.c:1477
#, c-format
@@ -1415,17 +1415,17 @@ msgstr ""
#: elf64-ppc.c:1669 libbfd.c:1435
#, c-format
msgid "%s: compiled for a big endian system and target is little endian"
-msgstr "%s: kompileret for et big endian-system og målet er little endian"
+msgstr "%s: oversat for et big endian-system og målet er little endian"
#: elf64-ppc.c:1671 libbfd.c:1437
#, c-format
msgid "%s: compiled for a little endian system and target is big endian"
-msgstr "%s: kompileret for et little endian-system og målet er big endian"
+msgstr "%s: oversat for et little endian-system og målet er big endian"
#: elf64-ppc.c:3610
#, c-format
msgid "%s: unexpected reloc type %u in .opd section"
-msgstr "%s: uventet relokaliseringstype %u i .opd-sektion"
+msgstr "%s: uventet relokeringstype %u i .opd-sektion"
#: elf64-ppc.c:3630
#, c-format
@@ -1459,17 +1459,17 @@ msgstr "stubbe stemmer ikke overens med beregnet størrelse"
#: elf64-ppc.c:5828
#, c-format
msgid "%s: Relocation %s is not supported for symbol %s."
-msgstr "%s: Relokaliseringen %s understøttes ikke for symbol %s."
+msgstr "%s: Relokeringen %s understøttes ikke for symbol %s."
#: elf64-ppc.c:5872
#, c-format
msgid "%s: error: relocation %s not a multiple of 4"
-msgstr "%s: fejl: relokaliseringen %s er ikke en multipel af 4"
+msgstr "%s: fejl: relokeringen %s er ikke en multipel af 4"
#: elf64-sparc.c:1280
#, c-format
msgid "%s: check_relocs: unhandled reloc type %d"
-msgstr "%s: check_relocs: uhåndteret relokaliseringstype %d"
+msgstr "%s: check_relocs: uhåndteret relokeringstype %d"
#: elf64-sparc.c:1317
#, c-format
@@ -1504,7 +1504,7 @@ msgstr "%s: versionsantal (%ld) stemmer ikke med symbolantal (%ld)"
#: elflink.c:440
#, c-format
msgid "%s: Section %s is too large to add hole of %ld bytes"
-msgstr "%s: Sektionen %s er for stor til at stoppa hul med %ld byte i"
+msgstr "%s: Sektionen %s er for stor til at stoppe hul med %ld byte i"
#: elflink.h:1090
#, c-format
@@ -1547,7 +1547,7 @@ msgstr "Fejl: ikke mere hukommelse"
#: elflink.h:4781
msgid "Not enough memory to sort relocations"
-msgstr "Ikke nok hukommelse til at sortere relokaliseringer"
+msgstr "Ikke nok hukommelse til at sortere relokeringer"
#: elflink.h:5682 elflink.h:5725
#, c-format
@@ -1567,15 +1567,15 @@ msgstr "%s: kunne ikke finde uddatasektionen %s for inddatasektionen %s"
#: elflink.h:6486
#, c-format
msgid "%s: relocation size mismatch in %s section %s"
-msgstr "%s: relokaliseringsstørrelsen stemmer ikke overens i %s-sektionen %s"
+msgstr "%s: relokeringsstørrelsen stemmer ikke overens i %s-sektionen %s"
#: elflink.h:6849
msgid "warning: relocation against removed section; zeroing"
-msgstr "advarsel: relokalisering mod fjernet sektion; nulstiller"
+msgstr "advarsel: relokering mod fjernet sektion; nulstiller"
#: elflink.h:6879
msgid "warning: relocation against removed section"
-msgstr "advarsel: relokalisering mod fjernet sektion"
+msgstr "advarsel: relokering mod fjernet sektion"
#: elflink.h:6892
#, c-format
@@ -1598,12 +1598,12 @@ msgstr "%s: %s+0x%lx: hop til stubrutine som ikke er jal"
#: elfxx-mips.c:4270
#, c-format
msgid "%s: Malformed reloc detected for section %s"
-msgstr "%s: Fejlagtig relokalisering for sektion %s opdaget"
+msgstr "%s: Fejlagtig relokering for sektion %s opdaget"
#: elfxx-mips.c:4348
#, c-format
msgid "%s: CALL16 reloc at 0x%lx not against global symbol"
-msgstr "%s: CALL16-relokalisering ved 0x%lx er ikke mod globalt symbol"
+msgstr "%s: CALL16-relokering ved 0x%lx er ikke mod globalt symbol"
#: elfxx-mips.c:7301
#, c-format
@@ -1763,37 +1763,37 @@ msgstr "%s: uventet type efter ATN"
#: ihex.c:258
#, c-format
msgid "%s:%d: unexpected character `%s' in Intel Hex file\n"
-msgstr "%s:%d: uventet tegn \"%s\" i hexadecimal Intel-fil\n"
+msgstr "%s:%d: uventet tegn \"%s\" i heksadecimal Intel-fil\n"
#: ihex.c:366
#, c-format
msgid "%s:%u: bad checksum in Intel Hex file (expected %u, found %u)"
-msgstr "%s:%u: fejlagtig kontrolsum i hexadecimal Intel-fil (forventede %u, fandt %u)"
+msgstr "%s:%u: fejlagtig kontrolsum i heksadecimal Intel-fil (forventede %u, fandt %u)"
#: ihex.c:420
#, c-format
msgid "%s:%u: bad extended address record length in Intel Hex file"
-msgstr "%s:%u: fejlagtig længde på post for udvidet adresse i hexadecimal Intel-fil"
+msgstr "%s:%u: fejlagtig længde på post for udvidet adresse i heksadecimal Intel-fil"
#: ihex.c:437
#, c-format
msgid "%s:%u: bad extended start address length in Intel Hex file"
-msgstr "%s:%u: fejlagtig længde på udvidet startadresse i hexadecimal Intel-fil"
+msgstr "%s:%u: fejlagtig længde på udvidet startadresse i heksadecimal Intel-fil"
#: ihex.c:454
#, c-format
msgid "%s:%u: bad extended linear address record length in Intel Hex file"
-msgstr "%s:%u: fejlagtig længde på post for udvidet lineær adresse i hexadecimal Intel-fil"
+msgstr "%s:%u: fejlagtig længde på post for udvidet lineær adresse i heksadecimal Intel-fil"
#: ihex.c:471
#, c-format
msgid "%s:%u: bad extended linear start address length in Intel Hex file"
-msgstr "%s:%u: fejlagtig længde på post for udvidet lineær startadresse i hexadecimal Intel-fil"
+msgstr "%s:%u: fejlagtig længde på post for udvidet lineær startadresse i heksadecimal Intel-fil"
#: ihex.c:488
#, c-format
msgid "%s:%u: unrecognized ihex type %u in Intel Hex file\n"
-msgstr "%s:%u: ukendt ihex-type %u i hexadecimal Intel-fil\n"
+msgstr "%s:%u: ukendt ihex-type %u i heksadecimal Intel-fil\n"
#: ihex.c:607
#, c-format
@@ -1808,7 +1808,7 @@ msgstr "%s: fejlagtig sektionslængde i ihex_read_sektion"
#: ihex.c:860
#, c-format
msgid "%s: address 0x%s out of range for Intel Hex file"
-msgstr "%s: adressen 0x%s er udenfor intervallet for hexadecimal Intel-fil"
+msgstr "%s: adressen 0x%s er uden for intervallet for heksadecimal Intel-fil"
#: libbfd.c:492
#, c-format
@@ -1837,7 +1837,7 @@ msgstr "%s: indirekte symbol \"%s\" til \"%s\" er en løkke"
#: linker.c:2776
#, c-format
msgid "Attempt to do relocateable link with %s input and %s output"
-msgstr "Forsøg at lave en relokaliseringsbar lænke med %s-inddata og %s-uddata"
+msgstr "Forsøg at lave en relokérbar lænke med %s-inddata og %s-uddata"
#: merge.c:892
#, c-format
@@ -1852,7 +1852,7 @@ msgstr "%s: Ingen kerne til at allokere sektionsnavn %s\n"
#: mmo.c:536
#, c-format
msgid "%s: No core to allocate a symbol %d bytes long\n"
-msgstr "%s: Ingen kerne for at allokere et %d byte langt symbol\n"
+msgstr "%s: Ingen kerne til at allokere et %d byte langt symbol\n"
#: mmo.c:1245
#, c-format
@@ -1862,12 +1862,12 @@ msgstr "%s: ugyldig mmo-fil: initieringsværdi for $255 er ikke \"Main\"\n"
#: mmo.c:1391
#, c-format
msgid "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name starting with `%s'\n"
-msgstr "%s: bred tegnsekvens som ikke understøttes 0x%02X 0x%02X efter symbolnavnet som begynder med \"%s\"\n"
+msgstr "%s: bred tegn-sekvens som ikke understøttes 0x%02X 0x%02X efter symbolnavnet som begynder med \"%s\"\n"
#: mmo.c:1633
#, c-format
msgid "%s: invalid mmo file: unsupported lopcode `%d'\n"
-msgstr "%s: ugyldig mmo-fil: lopkod \"%d\" understøttes ikke\n"
+msgstr "%s: ugyldig mmo-fil: lopkode \"%d\" understøttes ikke\n"
#: mmo.c:1643
#, c-format
@@ -2028,7 +2028,7 @@ msgstr "%s: Ukendt maskintype (0x%x) i Import Library Format-arkiv"
#: peicode.h:1174
#, c-format
msgid "%s: Recognised but unhandled machine type (0x%x) in Import Library Format archive"
-msgstr "%s: Kendt men uhåndteret maskintype (0x%x) i Import Library Format-arkiv"
+msgstr "%s: Kendt, men uhåndteret maskintype (0x%x) i Import Library Format-arkiv"
#: peicode.h:1191
#, c-format
@@ -2101,15 +2101,15 @@ msgstr "som_sizeof_headers er ikke implementeret"
msgid "%s:%d: Unexpected character `%s' in S-record file\n"
msgstr "%s:%d: Uventet tegn \"%s\" i S-postfil\n"
-# Vad er stabs?
+# Hvad er stabs?
#: stabs.c:319
#, c-format
msgid "%s(%s+0x%lx): Stabs entry has invalid string index."
-msgstr "%s(%s+0x%lx): Stabpost har ugyldigt strengindex."
+msgstr "%s(%s+0x%lx): Stabpost har ugyldigt strengindeks."
#: syms.c:1044
msgid "Unsupported .stab relocation"
-msgstr ".stab-relokalisering som ikke understøttes"
+msgstr ".stab-relokering som ikke understøttes"
#: vms-gsd.c:356
#, c-format
@@ -2150,7 +2150,7 @@ msgstr "_bfd_vms_output_counted kaldt med nul byte"
#: vms-misc.c:924
msgid "_bfd_vms_output_counted called with too many bytes"
-msgstr "_bfd_vms_output_counted called kaldt med for mange byte"
+msgstr "_bfd_vms_output_counted kaldt med for mange byte"
#: vms-misc.c:1055
#, c-format
@@ -2169,7 +2169,7 @@ msgstr "Ingen hukommelse!"
#: vms-tir.c:362
#, c-format
msgid "bad section index in %s"
-msgstr "fejlagtigt sektionsindex i %s"
+msgstr "fejlagtigt sektionsindeks i %s"
#: vms-tir.c:375
#, c-format
@@ -2263,17 +2263,17 @@ msgstr "objektkode %d kunne ikke findes"
#: vms-tir.c:2019
#, c-format
msgid "SEC_RELOC with no relocs in section %s"
-msgstr "SEC_RELOC uden relokaliseringer i sektion %s"
+msgstr "SEC_RELOC uden relokeringer i sektion %s"
#: vms-tir.c:2307
#, c-format
msgid "Unhandled relocation %s"
-msgstr "Uhåndteret relokalisering %s"
+msgstr "Uhåndteret relokering %s"
#: xcofflink.c:1243
#, c-format
msgid "%s: `%s' has line numbers but no enclosing section"
-msgstr "%s: \"%s\" har linjenumre men ingen omsluttende sektion"
+msgstr "%s: \"%s\" har linjenumre, men ingen omsluttende sektion"
#: xcofflink.c:1296
#, c-format
@@ -2308,7 +2308,7 @@ msgstr "%s: fejlagtigt placeret XTY_LD \"%s\""
#: xcofflink.c:1957
#, c-format
msgid "%s: reloc %s:%d not in csect"
-msgstr "%s: relokaliseringen %s:%d er ikke i csect"
+msgstr "%s: relokeringen %s:%d er ikke i csect"
#: xcofflink.c:2092
#, c-format
@@ -2337,26 +2337,26 @@ msgstr "advarsel: forsøg på at eksportere udefineret symbol \"%s\""
#: xcofflink.c:4447
#, c-format
msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling"
-msgstr "TOC giver overløb: 0x%lx > 0x10000; prøv -mminimal-toc ved kompilering"
+msgstr "TOC giver overløb: 0x%lx > 0x10000; prøv -mminimal-toc ved oversættelse"
#: xcofflink.c:5287 xcofflink.c:5756 xcofflink.c:5818 xcofflink.c:6119
#, c-format
msgid "%s: loader reloc in unrecognized section `%s'"
-msgstr "%s: indlæserrelokalisering i ukendt sektion \"%s\""
+msgstr "%s: indlæserrelokering i ukendt sektion \"%s\""
#: xcofflink.c:5309 xcofflink.c:6130
#, c-format
msgid "%s: `%s' in loader reloc but not loader sym"
-msgstr "%s: \"%s\" i indlæserrelokalisering men ikke indlæsersym"
+msgstr "%s: \"%s\" i indlæserrelokering, men ikke indlæsersym"
#: xcofflink.c:5324
#, c-format
msgid "%s: loader reloc in read-only section %s"
-msgstr "%s: indlæserrelokalisering i skrivebeskyttet sektion %s"
+msgstr "%s: indlæserrelokering i skrivebeskyttet sektion %s"
#: elf32-ia64.c:2222 elf64-ia64.c:2222
msgid "@pltoff reloc against local symbol"
-msgstr "@pltoff-relokalisering mod lokalt symbol"
+msgstr "@pltoff-relokering mod lokalt symbol"
#: elf32-ia64.c:3562 elf64-ia64.c:3562
#, c-format
@@ -2376,12 +2376,12 @@ msgstr "%s: lænker ikke-pic-kode i delt bibliotek"
#: elf32-ia64.c:3891 elf64-ia64.c:3891
#, c-format
msgid "%s: @gprel relocation against dynamic symbol %s"
-msgstr "%s: @gprel-relokalisering mod dynamisk symbol %s"
+msgstr "%s: @gprel-relokering mod dynamisk symbol %s"
#: elf32-ia64.c:4030 elf64-ia64.c:4030
#, c-format
msgid "%s: dynamic relocation against speculation fixup"
-msgstr "%s: dynamisk relokalisering uden spekulationsrettelser"
+msgstr "%s: dynamisk relokering uden spekulationsrettelser"
#: elf32-ia64.c:4038 elf64-ia64.c:4038
#, c-format
@@ -2390,7 +2390,7 @@ msgstr "%s: spekulationsfix mod udefineret svagt symbol"
#: elf32-ia64.c:4271 elf64-ia64.c:4271
msgid "unsupported reloc"
-msgstr "relokaliseringen understøttes ikke"
+msgstr "relokeringen understøttes ikke"
#: elf32-ia64.c:4551 elf64-ia64.c:4551
#, c-format
@@ -2425,11 +2425,11 @@ msgstr "%s: linjenummer giver overløb: 0x%lx > 0xffff"
#: peigen.c:979 pepigen.c:979
#, c-format
msgid "%s: reloc overflow 1: 0x%lx > 0xffff"
-msgstr "%s: relokalisering giver overløb 1: 0x%lx > 0xffff"
+msgstr "%s: relokering giver overløb 1: 0x%lx > 0xffff"
#: peigen.c:993 pepigen.c:993
msgid "Export Directory [.edata (or where ever we found it)]"
-msgstr "Exportkatalog [.edata (eller hvor vi fandt det)]"
+msgstr "Eksportkatalog [.edata (eller hvor vi fandt det)]"
#: peigen.c:994 pepigen.c:994
msgid "Import Directory [parts of .idata]"
@@ -2449,7 +2449,7 @@ msgstr "Sikkerhedskatalog"
#: peigen.c:998 pepigen.c:998
msgid "Base Relocation Directory [.reloc]"
-msgstr "Baserelokaliseringskatalog [.reloc]"
+msgstr "Baserelokeringskatalog [.reloc]"
#: peigen.c:999 pepigen.c:999
msgid "Debug Directory"
@@ -2535,7 +2535,7 @@ msgstr ""
"\n"
"Importtabellerne (tolket indhold i %s-sektion)\n"
-# Vad er thunk?
+# Hvad er thunk?
#: peigen.c:1130 pepigen.c:1130
msgid ""
" vma: Hint Time Forward DLL First\n"
@@ -2555,7 +2555,7 @@ msgstr ""
#: peigen.c:1192 pepigen.c:1192
msgid "\tvma: Hint/Ord Member-Name Bound-To\n"
-msgstr "\tvma: Tips/Ordn Medlemsnavn Bundet till\n"
+msgstr "\tvma: Tips/Ordn Medlemsnavn Bundet til\n"
#: peigen.c:1217 pepigen.c:1217
msgid ""
@@ -2580,7 +2580,7 @@ msgid ""
"There is an export table in %s at 0x%lx\n"
msgstr ""
"\n"
-"Det findes en eksporttabel i %s ved 0x%lx\n"
+"Der findes en eksporttabel i %s ved 0x%lx\n"
#: peigen.c:1393 pepigen.c:1393
#, c-format
@@ -2600,7 +2600,7 @@ msgstr "Eksportflag \t\t\t%lx\n"
#: peigen.c:1400 pepigen.c:1400
#, c-format
msgid "Time/Date stamp \t\t%lx\n"
-msgstr "Tids/datostempel \t\t%lx\n"
+msgstr "Tids-/datostempel \t\t%lx\n"
#: peigen.c:1403 pepigen.c:1403
#, c-format
@@ -2694,7 +2694,7 @@ msgid ""
" \t\tAddress Address Handler Data Address Mask\n"
msgstr ""
" vma:\t\tStart- Slut- EH- EH- Prologsluts- Undtagelses-\n"
-" \t\tadresse adresse håndterere data adresse maske\n"
+" \t\tadresse adresse håndterer data adresse maske\n"
#: peigen.c:1624 pepigen.c:1624
msgid " Register save millicode"
@@ -2716,7 +2716,7 @@ msgid ""
msgstr ""
"\n"
"\n"
-"PE-filbaserelokaliseringer (tolket indhold i .reloc-sektionen)\n"
+"PE-filbaserelokeringer (tolket indhold i .reloc-sektionen)\n"
#: peigen.c:1712 pepigen.c:1712
#, c-format
@@ -2730,7 +2730,7 @@ msgstr ""
#: peigen.c:1725 pepigen.c:1725
#, c-format
msgid "\treloc %4d offset %4x [%4lx] %s"
-msgstr "\trelokalisering %4d afstand %4x [%4lx] %s"
+msgstr "\trelokering %4d afstand %4x [%4lx] %s"
#. The MS dumpbin program reportedly ands with 0xff0f before
#. printing the characteristics field. Not sure why. No reason to
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 71f17402be0..0885e03232e 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -4,21 +4,21 @@
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
@@ -645,7 +645,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;
@@ -2575,6 +2576,22 @@ 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.
@@ -3685,7 +3702,7 @@ const char *
bfd_get_reloc_code_name (code)
bfd_reloc_code_real_type code;
{
- if (code > BFD_RELOC_UNUSED)
+ if ((int) code > (int) BFD_RELOC_UNUSED)
return 0;
return bfd_reloc_code_real_names[(int)code];
}
@@ -3813,7 +3830,7 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data,
/* We're not relaxing the section, so just copy the size info. */
input_section->_cooked_size = input_section->_raw_size;
- input_section->reloc_done = true;
+ input_section->reloc_done = (unsigned int) true;
reloc_count = bfd_canonicalize_reloc (input_bfd,
input_section,
diff --git a/bfd/reloc16.c b/bfd/reloc16.c
index 1db8daf2aa4..44d4f4f4657 100644
--- a/bfd/reloc16.c
+++ b/bfd/reloc16.c
@@ -199,30 +199,31 @@ bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again)
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];
@@ -235,12 +236,12 @@ bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again)
}
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,
+ relocateable,
+ symbols)
bfd *in_abfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
@@ -266,11 +267,11 @@ bfd_coff_reloc16_get_relocated_section_contents(in_abfd,
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/bfd/section.c b/bfd/section.c
index 51b21c70fbb..b5871e9bbfa 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -643,7 +643,8 @@ bfd_section_hash_newfunc (entry, table, string)
subclass. */
if (entry == NULL)
{
- entry = bfd_hash_allocate (table, sizeof (struct section_hash_entry));
+ entry = (struct bfd_hash_entry *)
+ bfd_hash_allocate (table, sizeof (struct section_hash_entry));
if (entry == NULL)
return entry;
}
@@ -1186,7 +1187,7 @@ bfd_set_section_contents (abfd, section, location, offset, count)
/* Record a copy of the data in memory if desired. */
if (section->contents
- && location != section->contents + offset)
+ && location != (PTR) (section->contents + offset))
memcpy (section->contents + offset, location, (size_t) count);
if (BFD_SEND (abfd, _bfd_set_section_contents,
diff --git a/bfd/simple.c b/bfd/simple.c
new file mode 100644
index 00000000000..f0f5ee64123
--- /dev/null
+++ b/bfd/simple.c
@@ -0,0 +1,212 @@
+/* simple.c -- BFD simple client routines
+ Copyright 2002
+ 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 boolean simple_dummy_warning
+ PARAMS ((struct bfd_link_info *, const char *, const char *, bfd *,
+ asection *, bfd_vma));
+
+static boolean simple_dummy_undefined_symbol
+ PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *,
+ bfd_vma, boolean));
+
+static boolean simple_dummy_reloc_overflow
+ PARAMS ((struct bfd_link_info *, const char *, const char *, bfd_vma,
+ bfd *, asection *, bfd_vma));
+
+static boolean simple_dummy_reloc_dangerous
+ PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma));
+
+static boolean simple_dummy_unattached_reloc
+ PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma));
+
+bfd_byte * bfd_simple_get_relocated_section_contents
+ PARAMS ((bfd *, asection *, bfd_byte *));
+
+static boolean
+simple_dummy_warning (link_info, warning, symbol, abfd, section, address)
+ 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 boolean
+simple_dummy_undefined_symbol (link_info, name, abfd, section, address, fatal)
+ 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;
+ boolean fatal ATTRIBUTE_UNUSED;
+{
+ return true;
+}
+
+static boolean
+simple_dummy_reloc_overflow (link_info, name, reloc_name, addend, abfd,
+ section, address)
+ 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 boolean
+simple_dummy_reloc_dangerous (link_info, message, abfd, section, address)
+ 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 boolean
+simple_dummy_unattached_reloc (link_info, name, abfd, section, address)
+ 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;
+}
+
+/*
+FUNCTION
+ bfd_simple_relocate_secton
+
+SYNOPSIS
+ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf);
+
+DESCRIPTION
+ Returns the relocated contents of section @var{sec}. Only symbols
+ from @var{abfd} and the output offsets assigned to sections in
+ @var{abfd} are used. 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 (abfd, sec, outbuf)
+ bfd *abfd;
+ asection *sec;
+ bfd_byte *outbuf;
+{
+ struct bfd_link_info link_info;
+ struct bfd_link_order link_order;
+ struct bfd_link_callbacks callbacks;
+ bfd_byte *contents, *data;
+ int storage_needed, number_of_symbols;
+ asymbol **symbol_table;
+
+ 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_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;
+ }
+ bfd_link_add_symbols (abfd, &link_info);
+
+ storage_needed = bfd_get_symtab_upper_bound (abfd);
+ symbol_table = (asymbol **) bfd_malloc (storage_needed);
+ number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
+
+ contents = bfd_get_relocated_section_contents (abfd,
+ &link_info,
+ &link_order,
+ outbuf,
+ 0,
+ symbol_table);
+ if (contents == NULL && data != NULL)
+ free (data);
+
+ /* Foul hack to prevent bfd_section_size aborts. This flag only controls
+ that macro (and the related size macros), selecting between _raw_size
+ and _cooked_size. Debug sections won't change size while we're only
+ relocating. There may be trouble here someday if it tries to run
+ relaxation unexpectedly, so make sure. */
+ BFD_ASSERT (sec->_raw_size == sec->_cooked_size);
+ sec->reloc_done = 0;
+
+ bfd_link_hash_table_free (abfd, link_info.hash);
+
+ return contents;
+}
diff --git a/bfd/srec.c b/bfd/srec.c
index 129b2ba4bb5..6c29fa16881 100644
--- a/bfd/srec.c
+++ b/bfd/srec.c
@@ -181,7 +181,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 = 0;
+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. */
@@ -1203,7 +1203,7 @@ srec_get_symtab (abfd, alocation)
csymbols = (asymbol *) bfd_alloc (abfd, symcount * sizeof (asymbol));
if (csymbols == NULL && symcount != 0)
- return false;
+ return (long) false;
abfd->tdata.srec_data->csymbols = csymbols;
for (s = abfd->tdata.srec_data->symbols, c = csymbols;
diff --git a/bfd/stabs.c b/bfd/stabs.c
index e225d9cd60d..0cb37412983 100644
--- a/bfd/stabs.c
+++ b/bfd/stabs.c
@@ -331,7 +331,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
symbol, ignoring nesting, adding up all the characters in the
symbol names, not including the file numbers in types (the
first number after an open parenthesis). */
- if (type == N_BINCL)
+ if (type == (int) N_BINCL)
{
bfd_vma val;
int nest;
@@ -351,13 +351,13 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
incl_type = incl_sym[TYPEOFF];
if (incl_type == 0)
break;
- else if (incl_type == N_EINCL)
+ else if (incl_type == (int) N_EINCL)
{
if (nest == 0)
break;
--nest;
}
- else if (incl_type == N_BINCL)
+ else if (incl_type == (int) N_BINCL)
++nest;
else if (nest == 0)
{
@@ -400,7 +400,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
goto error_return;
ne->offset = sym - stabbuf;
ne->val = val;
- ne->type = N_BINCL;
+ ne->type = (int) N_BINCL;
ne->next = secinfo->excls;
secinfo->excls = ne;
@@ -422,7 +422,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
/* We have seen this header file before. Tell the final
pass to change the type to N_EXCL. */
- ne->type = N_EXCL;
+ ne->type = (int) N_EXCL;
/* Mark the skipped symbols. */
@@ -435,7 +435,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
incl_type = incl_sym[TYPEOFF];
- if (incl_type == N_EINCL)
+ if (incl_type == (int) N_EINCL)
{
if (nest == 0)
{
@@ -445,7 +445,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
}
--nest;
}
- else if (incl_type == N_BINCL)
+ else if (incl_type == (int) N_BINCL)
++nest;
else if (nest == 0)
{
@@ -597,7 +597,7 @@ _bfd_discard_section_stabs (abfd, stabsec, psecinfo,
type = sym[TYPEOFF];
- if (type == N_FUN)
+ if (type == (int) N_FUN)
{
int strx = bfd_get_32 (abfd, sym + STRDXOFF);
@@ -624,7 +624,7 @@ _bfd_discard_section_stabs (abfd, stabsec, psecinfo,
else if (deleting == -1)
{
/* Outside of a function. Check for deleted variables. */
- if (type == N_STSYM || type == N_LCSYM)
+ if (type == (int) N_STSYM || type == (int) N_LCSYM)
if ((*reloc_symbol_deleted_p) (sym + VALOFF - stabbuf, cookie))
{
*pstridx = -1;
@@ -674,7 +674,7 @@ _bfd_discard_section_stabs (abfd, stabsec, psecinfo,
BFD_ASSERT (offset != 0);
}
- return (skip > 0);
+ return (boolean) (skip > 0);
error_return:
if (stabbuf != NULL)
diff --git a/bfd/syms.c b/bfd/syms.c
index 6eea2d807df..b135726c334 100644
--- a/bfd/syms.c
+++ b/bfd/syms.c
@@ -713,7 +713,7 @@ boolean
bfd_is_undefined_symclass (symclass)
int symclass;
{
- return symclass == 'U' || symclass == 'w' || symclass == 'v';
+ return (boolean) (symclass == 'U' || symclass == 'w' || symclass == 'v');
}
/*
@@ -1070,7 +1070,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
saw_fun = 1;
for (stab = info->stabs; stab < info->stabs + stabsize; stab += STABSIZE)
{
- if (stab[TYPEOFF] == N_SO)
+ if (stab[TYPEOFF] == (bfd_byte) N_SO)
{
/* N_SO with null name indicates EOF */
if (bfd_get_32 (abfd, stab + STRDXOFF) == 0)
@@ -1084,12 +1084,12 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
/* two N_SO's in a row is a filename and directory. Skip */
if (stab + STABSIZE < info->stabs + stabsize
- && *(stab + STABSIZE + TYPEOFF) == N_SO)
+ && *(stab + STABSIZE + TYPEOFF) == (bfd_byte) N_SO)
{
stab += STABSIZE;
}
}
- else if (stab[TYPEOFF] == N_FUN)
+ else if (stab[TYPEOFF] == (bfd_byte) N_FUN)
{
saw_fun = 1;
++info->indextablesize;
@@ -1158,7 +1158,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
{
last_stab = stab;
if (stab + STABSIZE >= info->stabs + stabsize
- || *(stab + STABSIZE + TYPEOFF) != N_SO)
+ || *(stab + STABSIZE + TYPEOFF) != (bfd_byte) N_SO)
{
directory_name = NULL;
}
diff --git a/bfd/targets.c b/bfd/targets.c
index b9be8e7535f..6a68eaa13f0 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -4,21 +4,21 @@
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"
@@ -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 };
@@ -508,7 +512,6 @@ extern const bfd_target bfd_elf32_big_generic_vec;
extern const bfd_target bfd_elf32_bigarc_vec;
extern const bfd_target bfd_elf32_bigarm_oabi_vec;
extern const bfd_target bfd_elf32_bigarm_vec;
-extern const bfd_target bfd_elf32_bigarmqnx_vec;
extern const bfd_target bfd_elf32_bigmips_vec;
extern const bfd_target bfd_elf32_cris_vec;
extern const bfd_target bfd_elf32_d10v_vec;
@@ -522,7 +525,6 @@ extern const bfd_target bfd_elf32_hppa_vec;
extern const bfd_target bfd_elf32_i370_vec;
extern const bfd_target bfd_elf32_i386_freebsd_vec;
extern const bfd_target bfd_elf32_i386_vec;
-extern const bfd_target bfd_elf32_i386qnx_vec;
extern const bfd_target bfd_elf32_i860_little_vec;
extern const bfd_target bfd_elf32_i860_vec;
extern const bfd_target bfd_elf32_i960_vec;
@@ -533,7 +535,6 @@ 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_littlearmqnx_vec;
extern const bfd_target bfd_elf32_littlemips_vec;
extern const bfd_target bfd_elf32_m32r_vec;
extern const bfd_target bfd_elf32_m68hc11_vec;
@@ -554,11 +555,11 @@ extern const bfd_target bfd_elf32_pj_vec;
extern const bfd_target bfd_elf32_pjl_vec;
extern const bfd_target bfd_elf32_powerpc_vec;
extern const bfd_target bfd_elf32_powerpcle_vec;
-extern const bfd_target bfd_elf32_powerpcleqnx_vec;
-extern const bfd_target bfd_elf32_powerpcqnx_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;
@@ -566,9 +567,7 @@ extern const bfd_target bfd_elf32_shblin_vec;
extern const bfd_target bfd_elf32_shl_vec;
extern const bfd_target bfd_elf32_shlin_vec;
extern const bfd_target bfd_elf32_shlnbsd_vec;
-extern const bfd_target bfd_elf32_shlqnx_vec;
extern const bfd_target bfd_elf32_shnbsd_vec;
-extern const bfd_target bfd_elf32_shqnx_vec;
extern const bfd_target bfd_elf32_sparc_vec;
extern const bfd_target bfd_elf32_tradbigmips_vec;
extern const bfd_target bfd_elf32_tradlittlemips_vec;
@@ -595,6 +594,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;
@@ -648,6 +649,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;
@@ -664,6 +668,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;
@@ -683,6 +689,7 @@ 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;
@@ -802,7 +809,6 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf32_i370_vec,
&bfd_elf32_i386_freebsd_vec,
&bfd_elf32_i386_vec,
- &bfd_elf32_i386qnx_vec,
&bfd_elf32_i860_little_vec,
&bfd_elf32_i860_vec,
&bfd_elf32_i960_vec,
@@ -837,8 +843,6 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf32_pjl_vec,
&bfd_elf32_powerpc_vec,
&bfd_elf32_powerpcle_vec,
- &bfd_elf32_powerpcleqnx_vec,
- &bfd_elf32_powerpcqnx_vec,
&bfd_elf32_s390_vec,
&bfd_elf32_sh_vec,
&bfd_elf32_shblin_vec,
@@ -851,6 +855,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,
@@ -881,6 +887,8 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf64_sh64l_vec,
&bfd_elf64_sh64lnbsd_vec,
&bfd_elf64_sh64nbsd_vec,
+ &bfd_elf64_sh64lin_vec,
+ &bfd_elf64_sh64blin_vec,
#if 0
&bfd_elf64_sparc_vec,
#endif
@@ -959,6 +967,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,
@@ -986,6 +997,8 @@ 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,
@@ -1015,6 +1028,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,
@@ -1098,6 +1112,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. */
@@ -1269,14 +1294,17 @@ bfd_target_list ()
vec_length++;
amt = (vec_length + 1) * sizeof (char **);
- name_ptr = name_list = (const char **) bfd_zmalloc (amt);
+ name_ptr = name_list = (const char **) bfd_malloc (amt);
if (name_list == NULL)
return NULL;
for (target = &bfd_target_vector[0]; *target != NULL; target++)
- *(name_ptr++) = (*target)->name;
+ if (target == &bfd_target_vector[0]
+ || *target != bfd_target_vector[0])
+ *name_ptr++ = (*target)->name;
+ *name_ptr = NULL;
return name_list;
}
diff --git a/bfd/version.h b/bfd/version.h
index 83fd0856cd1..001aec54aba 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1 +1,3 @@
-#define BFD_VERSION_DATE 20021004
+#define BFD_VERSION_DATE 20021115
+#define BFD_VERSION @bfd_version@
+#define BFD_VERSION_STRING @bfd_version_string@
diff --git a/bfd/vms-gsd.c b/bfd/vms-gsd.c
index 002412232dc..10fbb2d35c7 100644
--- a/bfd/vms-gsd.c
+++ b/bfd/vms-gsd.c
@@ -420,7 +420,7 @@ _bfd_vms_slurp_gsd (abfd, objtype)
{
bfd_set_error (bfd_error_no_memory);
return -1;
- }
+ }
}
}
else
@@ -661,13 +661,13 @@ _bfd_vms_slurp_gsd (abfd, objtype)
}
else /* symbol reference */
{
- symbol->name =
+ symbol->name =
_bfd_vms_save_counted_string (vms_rec+8);
#if VMS_DEBUG
vms_debug(4, "egsd sym ref #%d (%s, %04x=%s)\n", abfd->symcount,
symbol->name, old_flags, flag2str(gsyflagdesc, old_flags));
#endif
- symbol->section = bfd_make_section (abfd, BFD_UND_SECTION_NAME);
+ symbol->section = bfd_make_section (abfd, BFD_UND_SECTION_NAME);
}
symbol->flags = new_flags;
@@ -901,7 +901,7 @@ _bfd_vms_write_gsd (abfd, objtype)
unsigned long ca_psindx = 0;
unsigned long psindx;
- if (old_flags & BSF_FUNCTION)
+ if ((old_flags & BSF_FUNCTION) && symbol->udata.p != NULL)
{
code_address = ((asymbol *) (symbol->udata.p))->value;
ca_psindx = ((asymbol *) (symbol->udata.p))->section->index;
diff --git a/bfd/vms-hdr.c b/bfd/vms-hdr.c
index fa8af973055..fbeb42e4eb3 100644
--- a/bfd/vms-hdr.c
+++ b/bfd/vms-hdr.c
@@ -25,6 +25,7 @@ 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 "bfdver.h"
#include "sysdep.h"
#include "bfdlink.h"
#include "safe-ctype.h"
diff --git a/bfd/vms.c b/bfd/vms.c
index fc6bcc3e161..41a9717fcdd 100644
--- a/bfd/vms.c
+++ b/bfd/vms.c
@@ -382,6 +382,7 @@ vms_object_p (abfd)
const struct bfd_target *target_vector = 0;
const bfd_arch_info_type *arch = 0;
PTR tdata_save = abfd->tdata.any;
+ bfd_vma saddr_save = bfd_get_start_address (abfd);
#if VMS_DEBUG
vms_debug (1, "vms_object_p(%p)\n", abfd);
@@ -519,6 +520,7 @@ vms_object_p (abfd)
if (abfd->tdata.any != tdata_save && abfd->tdata.any != NULL)
bfd_release (abfd, abfd->tdata.any);
abfd->tdata.any = tdata_save;
+ bfd_set_start_address (abfd, saddr_save);
return NULL;
}
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index a869d7d3d6d..e4e4755cddb 100644
--- a/bfd/xcofflink.c
+++ b/bfd/xcofflink.c
@@ -1986,6 +1986,7 @@ xcoff_link_add_symbols (abfd, info)
&& h->descriptor == NULL)
{
struct xcoff_link_hash_entry *hds;
+ struct bfd_link_hash_entry *bh;
hds = xcoff_link_hash_lookup (xcoff_hash_table (info),
h->root.root.string + 1,
@@ -1994,13 +1995,14 @@ xcoff_link_add_symbols (abfd, info)
goto error_return;
if (hds->root.type == bfd_link_hash_new)
{
+ bh = &hds->root;
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,
- (struct bfd_link_hash_entry **) &hds)))
+ true, &bh)))
goto error_return;
+ hds = (struct xcoff_link_hash_entry *) bh;
}
hds->flags |= XCOFF_DESCRIPTOR;
BFD_ASSERT ((hds->flags & XCOFF_CALLED) == 0
diff --git a/bfd/xsym.c b/bfd/xsym.c
new file mode 100644
index 00000000000..e6b3c4b11d5
--- /dev/null
+++ b/bfd/xsym.c
@@ -0,0 +1,2484 @@
+/* xSYM symbol-file support for BFD.
+ Copyright 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "xsym.h"
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+#define bfd_sym_close_and_cleanup _bfd_generic_close_and_cleanup
+#define bfd_sym_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define bfd_sym_new_section_hook _bfd_generic_new_section_hook
+#define bfd_sym_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define bfd_sym_get_lineno _bfd_nosymbols_get_lineno
+#define bfd_sym_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define bfd_sym_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define bfd_sym_read_minisymbols _bfd_generic_read_minisymbols
+#define bfd_sym_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define bfd_sym_get_reloc_upper_bound _bfd_norelocs_get_reloc_upper_bound
+#define bfd_sym_canonicalize_reloc _bfd_norelocs_canonicalize_reloc
+#define bfd_sym_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
+#define bfd_sym_set_arch_mach _bfd_generic_set_arch_mach
+#define bfd_sym_get_section_contents _bfd_generic_get_section_contents
+#define bfd_sym_set_section_contents _bfd_generic_set_section_contents
+#define bfd_sym_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
+#define bfd_sym_bfd_relax_section bfd_generic_relax_section
+#define bfd_sym_bfd_gc_sections bfd_generic_gc_sections
+#define bfd_sym_bfd_merge_sections bfd_generic_merge_sections
+#define bfd_sym_bfd_discard_group bfd_generic_discard_group
+#define bfd_sym_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define bfd_sym_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
+#define bfd_sym_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define bfd_sym_bfd_link_just_syms _bfd_generic_link_just_syms
+#define bfd_sym_bfd_final_link _bfd_generic_final_link
+#define bfd_sym_bfd_link_split_section _bfd_generic_link_split_section
+#define bfd_sym_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+
+static int pstrcmp PARAMS ((unsigned char *, unsigned char *));
+static unsigned long compute_offset
+ PARAMS ((unsigned long, unsigned long, unsigned long, unsigned long));
+
+extern const bfd_target sym_vec;
+
+static int
+pstrcmp (a, b)
+ unsigned char *a;
+ unsigned char *b;
+{
+ unsigned char clen;
+ int ret;
+
+ clen = (a[0] > b[0]) ? a[0] : b[0];
+ ret = memcmp (a + 1, b + 1, clen);
+ if (ret != 0)
+ return ret;
+
+ if (a[0] == b[0])
+ return 0;
+ else if (a[0] < b[0])
+ return -1;
+ else
+ return 0;
+}
+
+static unsigned long
+compute_offset (first_page, page_size, entry_size, index)
+ unsigned long first_page;
+ unsigned long page_size;
+ unsigned long entry_size;
+ unsigned long index;
+{
+ unsigned long entries_per_page = page_size / entry_size;
+ unsigned long page_number = first_page + (index / entries_per_page);
+ unsigned long page_offset = (index % entries_per_page) * entry_size;
+
+ return (page_number * page_size) + page_offset;
+}
+
+boolean
+bfd_sym_mkobject (abfd)
+ bfd *abfd ATTRIBUTE_UNUSED;
+{
+ return (boolean) true;
+}
+
+void
+bfd_sym_print_symbol (abfd, afile, symbol, how)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ PTR afile ATTRIBUTE_UNUSED;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ bfd_print_symbol_type how ATTRIBUTE_UNUSED;
+{
+ return;
+}
+
+boolean
+bfd_sym_valid (abfd)
+ bfd *abfd;
+{
+ if (abfd == NULL || abfd->xvec == NULL)
+ return 0;
+
+ return abfd->xvec == &sym_vec;
+}
+
+unsigned char *
+bfd_sym_read_name_table (abfd, dshb)
+ bfd *abfd;
+ bfd_sym_header_block *dshb;
+{
+ unsigned char *rstr;
+ long ret;
+ size_t table_size = dshb->dshb_nte.dti_page_count * dshb->dshb_page_size;
+ size_t table_offset = dshb->dshb_nte.dti_first_page * dshb->dshb_page_size;
+
+ rstr = (unsigned char *) bfd_alloc (abfd, table_size);
+ if (rstr == NULL)
+ return rstr;
+
+ bfd_seek (abfd, table_offset, SEEK_SET);
+ ret = bfd_bread (rstr, table_size, abfd);
+ if (ret < 0 || (unsigned long) ret != table_size)
+ {
+ bfd_release (abfd, rstr);
+ return NULL;
+ }
+
+ return rstr;
+}
+
+void
+bfd_sym_parse_file_reference_v32 (buf, len, entry)
+ unsigned char *buf;
+ size_t len;
+ bfd_sym_file_reference *entry;
+{
+ BFD_ASSERT (len == 6);
+
+ entry->fref_frte_index = bfd_getb16 (buf);
+ entry->fref_offset = bfd_getb32 (buf + 2);
+}
+
+void
+bfd_sym_parse_disk_table_v32 (buf, len, table)
+ unsigned char *buf;
+ size_t len;
+ bfd_sym_table_info *table;
+{
+ BFD_ASSERT (len == 8);
+
+ table->dti_first_page = bfd_getb16 (buf);
+ table->dti_page_count = bfd_getb16 (buf + 2);
+ table->dti_object_count = bfd_getb32 (buf + 4);
+}
+
+void
+bfd_sym_parse_header_v32 (buf, len, header)
+ unsigned char *buf;
+ size_t len;
+ bfd_sym_header_block *header;
+{
+ BFD_ASSERT (len == 154);
+
+ memcpy (header->dshb_id, buf, 32);
+ header->dshb_page_size = bfd_getb16 (buf + 32);
+ header->dshb_hash_page = bfd_getb16 (buf + 34);
+ header->dshb_root_mte = bfd_getb16 (buf + 36);
+ header->dshb_mod_date = bfd_getb32 (buf + 38);
+
+ bfd_sym_parse_disk_table_v32 (buf + 42, 8, &header->dshb_frte);
+ bfd_sym_parse_disk_table_v32 (buf + 50, 8, &header->dshb_rte);
+ bfd_sym_parse_disk_table_v32 (buf + 58, 8, &header->dshb_mte);
+ bfd_sym_parse_disk_table_v32 (buf + 66, 8, &header->dshb_cmte);
+ bfd_sym_parse_disk_table_v32 (buf + 74, 8, &header->dshb_cvte);
+ bfd_sym_parse_disk_table_v32 (buf + 82, 8, &header->dshb_csnte);
+ bfd_sym_parse_disk_table_v32 (buf + 90, 8, &header->dshb_clte);
+ bfd_sym_parse_disk_table_v32 (buf + 98, 8, &header->dshb_ctte);
+ bfd_sym_parse_disk_table_v32 (buf + 106, 8, &header->dshb_tte);
+ bfd_sym_parse_disk_table_v32 (buf + 114, 8, &header->dshb_nte);
+ bfd_sym_parse_disk_table_v32 (buf + 122, 8, &header->dshb_tinfo);
+ bfd_sym_parse_disk_table_v32 (buf + 130, 8, &header->dshb_fite);
+ bfd_sym_parse_disk_table_v32 (buf + 138, 8, &header->dshb_const);
+
+ memcpy (&header->dshb_file_creator, buf + 146, 4);
+ memcpy (&header->dshb_file_type, buf + 150, 4);
+}
+
+int
+bfd_sym_read_header_v32 (abfd, header)
+ bfd *abfd;
+ bfd_sym_header_block *header;
+{
+ unsigned char buf[154];
+ long ret;
+
+ ret = bfd_bread (buf, 154, abfd);
+ if (ret != 154)
+ return -1;
+
+ bfd_sym_parse_header_v32 (buf, 154, header);
+
+ return 0;
+}
+
+int
+bfd_sym_read_header_v34 (abfd, header)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd_sym_header_block *header ATTRIBUTE_UNUSED;
+{
+ abort ();
+}
+
+int
+bfd_sym_read_header (abfd, header, version)
+ bfd *abfd;
+ bfd_sym_header_block *header;
+ bfd_sym_version version;
+{
+ switch (version)
+ {
+ case BFD_SYM_VERSION_3_5:
+ case BFD_SYM_VERSION_3_4:
+ return bfd_sym_read_header_v34 (abfd, header);
+ case BFD_SYM_VERSION_3_3:
+ case BFD_SYM_VERSION_3_2:
+ return bfd_sym_read_header_v32 (abfd, header);
+ case BFD_SYM_VERSION_3_1:
+ default:
+ return false;
+ }
+}
+
+int
+bfd_sym_read_version (abfd, version)
+ bfd *abfd;
+ bfd_sym_version *version;
+{
+ unsigned char version_string[32];
+ long ret;
+
+ ret = bfd_bread (version_string, sizeof (version_string), abfd);
+ if (ret != sizeof (version_string))
+ return -1;
+
+ if (pstrcmp (version_string, BFD_SYM_VERSION_STR_3_1) == 0)
+ *version = BFD_SYM_VERSION_3_1;
+ else if (pstrcmp (version_string, BFD_SYM_VERSION_STR_3_2) == 0)
+ *version = BFD_SYM_VERSION_3_2;
+ else if (pstrcmp (version_string, BFD_SYM_VERSION_STR_3_3) == 0)
+ *version = BFD_SYM_VERSION_3_3;
+ else if (pstrcmp (version_string, BFD_SYM_VERSION_STR_3_4) == 0)
+ *version = BFD_SYM_VERSION_3_4;
+ else if (pstrcmp (version_string, BFD_SYM_VERSION_STR_3_5) == 0)
+ *version = BFD_SYM_VERSION_3_5;
+ else
+ return -1;
+
+ return 0;
+}
+
+void
+bfd_sym_display_table_summary (f, dti, name)
+ FILE *f;
+ bfd_sym_table_info *dti;
+ const char *name;
+{
+ fprintf (f, "%-6s %13ld %13ld %13ld\n",
+ name,
+ dti->dti_first_page,
+ dti->dti_page_count,
+ dti->dti_object_count);
+}
+
+void
+bfd_sym_display_header (f, dshb)
+ FILE *f;
+ bfd_sym_header_block *dshb;
+{
+ fprintf (f, " Version: %.*s\n", dshb->dshb_id[0], dshb->dshb_id + 1);
+ fprintf (f, " Page Size: 0x%x\n", dshb->dshb_page_size);
+ fprintf (f, " Hash Page: %lu\n", dshb->dshb_hash_page);
+ fprintf (f, " Root MTE: %lu\n", dshb->dshb_root_mte);
+ fprintf (f, " Modification Date: ");
+ fprintf (f, "[unimplemented]");
+ fprintf (f, " (0x%lx)\n", dshb->dshb_mod_date);
+
+ fprintf (f, " File Creator: %.4s Type: %.4s\n\n",
+ dshb->dshb_file_creator, dshb->dshb_file_type);
+
+ fprintf (f, "Table Name First Page Page Count Object Count\n");
+ fprintf (f, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
+
+ bfd_sym_display_table_summary (f, &dshb->dshb_nte, "NTE");
+ bfd_sym_display_table_summary (f, &dshb->dshb_rte, "RTE");
+ bfd_sym_display_table_summary (f, &dshb->dshb_mte, "MTE");
+ bfd_sym_display_table_summary (f, &dshb->dshb_frte, "FRTE");
+ bfd_sym_display_table_summary (f, &dshb->dshb_cmte, "CMTE");
+ bfd_sym_display_table_summary (f, &dshb->dshb_cvte, "CVTE");
+ bfd_sym_display_table_summary (f, &dshb->dshb_csnte, "CSNTE");
+ bfd_sym_display_table_summary (f, &dshb->dshb_clte, "CLTE");
+ bfd_sym_display_table_summary (f, &dshb->dshb_ctte, "CTTE");
+ bfd_sym_display_table_summary (f, &dshb->dshb_tte, "TTE");
+ bfd_sym_display_table_summary (f, &dshb->dshb_tinfo, "TINFO");
+ bfd_sym_display_table_summary (f, &dshb->dshb_fite, "FITE");
+ bfd_sym_display_table_summary (f, &dshb->dshb_const, "CONST");
+
+ fprintf (f, "\n");
+}
+
+void
+bfd_sym_parse_resources_table_entry_v32 (buf, len, entry)
+ unsigned char *buf;
+ size_t len;
+ bfd_sym_resources_table_entry *entry;
+{
+ BFD_ASSERT (len == 18);
+
+ memcpy (&entry->rte_res_type, buf, 4);
+ entry->rte_res_number = bfd_getb16 (buf + 4);
+ entry->rte_nte_index = bfd_getb32 (buf + 6);
+ entry->rte_mte_first = bfd_getb16 (buf + 10);
+ entry->rte_mte_last = bfd_getb16 (buf + 12);
+ entry->rte_res_size = bfd_getb32 (buf + 14);
+}
+
+void
+bfd_sym_parse_modules_table_entry_v33 (buf, len, entry)
+ unsigned char *buf;
+ size_t len;
+ bfd_sym_modules_table_entry *entry;
+{
+ BFD_ASSERT (len == 46);
+
+ entry->mte_rte_index = bfd_getb16 (buf);
+ entry->mte_res_offset = bfd_getb32 (buf + 2);
+ entry->mte_size = bfd_getb32 (buf + 6);
+ entry->mte_kind = buf[10];
+ entry->mte_scope = buf[11];
+ entry->mte_parent = bfd_getb16 (buf + 12);
+ bfd_sym_parse_file_reference_v32 (buf + 14, 6, &entry->mte_imp_fref);
+ entry->mte_imp_end = bfd_getb32 (buf + 20);
+ entry->mte_nte_index = bfd_getb32 (buf + 24);
+ entry->mte_cmte_index = bfd_getb16 (buf + 28);
+ entry->mte_cvte_index = bfd_getb32 (buf + 30);
+ entry->mte_clte_index = bfd_getb16 (buf + 34);
+ entry->mte_ctte_index = bfd_getb16 (buf + 36);
+ entry->mte_csnte_idx_1 = bfd_getb32 (buf + 38);
+ entry->mte_csnte_idx_2 = bfd_getb32 (buf + 42);
+}
+
+void
+bfd_sym_parse_file_references_table_entry_v32 (buf, len, entry)
+ unsigned char *buf;
+ size_t len;
+ bfd_sym_file_references_table_entry *entry;
+{
+ unsigned int type;
+
+ BFD_ASSERT (len == 10);
+
+ memset (entry, 0, sizeof (bfd_sym_file_references_table_entry));
+ type = bfd_getb16 (buf);
+
+ switch (type)
+ {
+ case BFD_SYM_END_OF_LIST_3_2:
+ entry->generic.type = BFD_SYM_END_OF_LIST;
+ break;
+
+ case BFD_SYM_FILE_NAME_INDEX_3_2:
+ entry->filename.type = BFD_SYM_FILE_NAME_INDEX;
+ entry->filename.nte_index = bfd_getb32 (buf + 2);
+ entry->filename.mod_date = bfd_getb32 (buf + 6);
+ break;
+
+ default:
+ entry->entry.mte_index = type;
+ entry->entry.file_offset = bfd_getb32 (buf + 2);
+ }
+}
+
+void
+bfd_sym_parse_contained_modules_table_entry_v32 (buf, len, entry)
+ unsigned char *buf;
+ size_t len;
+ bfd_sym_contained_modules_table_entry *entry;
+{
+ unsigned int type;
+
+ BFD_ASSERT (len == 6);
+
+ memset (entry, 0, sizeof (bfd_sym_contained_modules_table_entry));
+ type = bfd_getb16 (buf);
+
+ switch (type)
+ {
+ case BFD_SYM_END_OF_LIST_3_2:
+ entry->generic.type = BFD_SYM_END_OF_LIST;
+ break;
+
+ default:
+ entry->entry.mte_index = type;
+ entry->entry.nte_index = bfd_getb32 (buf + 2);
+ break;
+ }
+}
+
+void
+bfd_sym_parse_contained_variables_table_entry_v32 (buf, len, entry)
+ unsigned char *buf;
+ size_t len;
+ bfd_sym_contained_variables_table_entry *entry;
+{
+ unsigned int type;
+
+ BFD_ASSERT (len == 26);
+
+ memset (entry, 0, sizeof (bfd_sym_contained_variables_table_entry));
+ type = bfd_getb16 (buf);
+
+ switch (type)
+ {
+ case BFD_SYM_END_OF_LIST_3_2:
+ entry->generic.type = BFD_SYM_END_OF_LIST;
+ break;
+
+ case BFD_SYM_SOURCE_FILE_CHANGE_3_2:
+ entry->file.type = BFD_SYM_SOURCE_FILE_CHANGE;
+ bfd_sym_parse_file_reference_v32 (buf + 2, 6, &entry->file.fref);
+ break;
+
+ default:
+ entry->entry.tte_index = type;
+ entry->entry.nte_index = bfd_getb32 (buf + 2);
+ entry->entry.file_delta = bfd_getb16 (buf + 6);
+ entry->entry.scope = buf[8];
+ entry->entry.la_size = buf[9];
+
+ if (entry->entry.la_size == BFD_SYM_CVTE_SCA)
+ {
+ entry->entry.address.scstruct.sca_kind = buf[10];
+ entry->entry.address.scstruct.sca_class = buf[11];
+ entry->entry.address.scstruct.sca_offset = bfd_getb32 (buf + 12);
+ }
+ else if (entry->entry.la_size <= BFD_SYM_CVTE_SCA)
+ {
+ memcpy (&entry->entry.address.lastruct.la, buf + 10, BFD_SYM_CVTE_SCA);
+ entry->entry.address.lastruct.la_kind = buf[23];
+ }
+ else if (entry->entry.la_size == BFD_SYM_CVTE_BIG_LA)
+ {
+ entry->entry.address.biglastruct.big_la = bfd_getb32 (buf + 10);
+ entry->entry.address.biglastruct.big_la_kind = buf[12];
+ }
+ }
+}
+
+void
+bfd_sym_parse_contained_statements_table_entry_v32 (buf, len, entry)
+ unsigned char *buf;
+ size_t len;
+ bfd_sym_contained_statements_table_entry *entry;
+{
+ unsigned int type;
+
+ BFD_ASSERT (len == 8);
+
+ memset (entry, 0, sizeof (bfd_sym_contained_statements_table_entry));
+ type = bfd_getb16 (buf);
+
+ switch (type)
+ {
+ case BFD_SYM_END_OF_LIST_3_2:
+ entry->generic.type = BFD_SYM_END_OF_LIST;
+ break;
+
+ case BFD_SYM_SOURCE_FILE_CHANGE_3_2:
+ entry->file.type = BFD_SYM_SOURCE_FILE_CHANGE;
+ bfd_sym_parse_file_reference_v32 (buf + 2, 6, &entry->file.fref);
+ break;
+
+ default:
+ entry->entry.mte_index = type;
+ entry->entry.mte_offset = bfd_getb16 (buf + 2);
+ entry->entry.file_delta = bfd_getb32 (buf + 4);
+ break;
+ }
+}
+
+void
+bfd_sym_parse_contained_labels_table_entry_v32 (buf, len, entry)
+ unsigned char *buf;
+ size_t len;
+ bfd_sym_contained_labels_table_entry *entry;
+{
+ unsigned int type;
+
+ BFD_ASSERT (len == 12);
+
+ memset (entry, 0, sizeof (bfd_sym_contained_labels_table_entry));
+ type = bfd_getb16 (buf);
+
+ switch (type)
+ {
+ case BFD_SYM_END_OF_LIST_3_2:
+ entry->generic.type = BFD_SYM_END_OF_LIST;
+ break;
+
+ case BFD_SYM_SOURCE_FILE_CHANGE_3_2:
+ entry->file.type = BFD_SYM_SOURCE_FILE_CHANGE;
+ bfd_sym_parse_file_reference_v32 (buf + 2, 6, &entry->file.fref);
+ break;
+
+ default:
+ entry->entry.mte_index = type;
+ entry->entry.mte_offset = bfd_getb16 (buf + 2);
+ entry->entry.nte_index = bfd_getb32 (buf + 4);
+ entry->entry.file_delta = bfd_getb16 (buf + 8);
+ entry->entry.scope = bfd_getb16 (buf + 10);
+ break;
+ }
+}
+
+void
+bfd_sym_parse_type_table_entry_v32 (buf, len, entry)
+ unsigned char *buf;
+ size_t len;
+ bfd_sym_type_table_entry *entry;
+{
+ BFD_ASSERT (len == 4);
+
+ *entry = bfd_getb32 (buf);
+}
+
+int
+bfd_sym_fetch_resources_table_entry (abfd, entry, index)
+ bfd *abfd;
+ bfd_sym_resources_table_entry *entry;
+ unsigned long index;
+{
+ void (*parser) PARAMS ((unsigned char *, size_t,
+ bfd_sym_resources_table_entry *));
+ unsigned long offset;
+ unsigned long entry_size;
+ unsigned char buf[18];
+ bfd_sym_data_struct *sdata = NULL;
+
+ parser = NULL;
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (index == 0)
+ return -1;
+
+ switch (sdata->version)
+ {
+ case BFD_SYM_VERSION_3_5:
+ case BFD_SYM_VERSION_3_4:
+ return -1;
+
+ case BFD_SYM_VERSION_3_3:
+ case BFD_SYM_VERSION_3_2:
+ entry_size = 18;
+ parser = bfd_sym_parse_resources_table_entry_v32;
+ break;
+
+ case BFD_SYM_VERSION_3_1:
+ default:
+ return -1;
+ }
+ if (parser == NULL)
+ return -1;
+
+ offset = compute_offset (sdata->header.dshb_rte.dti_first_page,
+ sdata->header.dshb_page_size,
+ entry_size, index);
+
+ if (bfd_seek (abfd, offset, SEEK_SET) < 0)
+ return -1;
+ if (bfd_bread (buf, entry_size, abfd) != entry_size)
+ return -1;
+
+ (*parser) (buf, entry_size, entry);
+
+ return 0;
+}
+
+int
+bfd_sym_fetch_modules_table_entry (abfd, entry, index)
+ bfd *abfd;
+ bfd_sym_modules_table_entry *entry;
+ unsigned long index;
+{
+ void (*parser) PARAMS ((unsigned char *, size_t,
+ bfd_sym_modules_table_entry *));
+ unsigned long offset;
+ unsigned long entry_size;
+ unsigned char buf[46];
+ bfd_sym_data_struct *sdata = NULL;
+
+ parser = NULL;
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (index == 0)
+ return -1;
+
+ switch (sdata->version)
+ {
+ case BFD_SYM_VERSION_3_5:
+ case BFD_SYM_VERSION_3_4:
+ return -1;
+
+ case BFD_SYM_VERSION_3_3:
+ entry_size = 46;
+ parser = bfd_sym_parse_modules_table_entry_v33;
+ break;
+
+ case BFD_SYM_VERSION_3_2:
+ case BFD_SYM_VERSION_3_1:
+ default:
+ return -1;
+ }
+ if (parser == NULL)
+ return -1;
+
+ offset = compute_offset (sdata->header.dshb_mte.dti_first_page,
+ sdata->header.dshb_page_size,
+ entry_size, index);
+
+ if (bfd_seek (abfd, offset, SEEK_SET) < 0)
+ return -1;
+ if (bfd_bread (buf, entry_size, abfd) != entry_size)
+ return -1;
+
+ (*parser) (buf, entry_size, entry);
+
+ return 0;
+}
+
+int
+bfd_sym_fetch_file_references_table_entry (abfd, entry, index)
+ bfd *abfd;
+ bfd_sym_file_references_table_entry *entry;
+ unsigned long index;
+{
+ void (*parser) PARAMS ((unsigned char *, size_t,
+ bfd_sym_file_references_table_entry *));
+ unsigned long offset;
+ unsigned long entry_size = 0;
+ unsigned char buf[8];
+ bfd_sym_data_struct *sdata = NULL;
+
+ parser = NULL;
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (index == 0)
+ return -1;
+
+ switch (sdata->version)
+ {
+ case BFD_SYM_VERSION_3_3:
+ case BFD_SYM_VERSION_3_2:
+ entry_size = 10;
+ parser = bfd_sym_parse_file_references_table_entry_v32;
+ break;
+
+ case BFD_SYM_VERSION_3_5:
+ case BFD_SYM_VERSION_3_4:
+ case BFD_SYM_VERSION_3_1:
+ default:
+ break;
+ }
+
+ if (parser == NULL)
+ return -1;
+
+ offset = compute_offset (sdata->header.dshb_frte.dti_first_page,
+ sdata->header.dshb_page_size,
+ entry_size, index);
+
+ if (bfd_seek (abfd, offset, SEEK_SET) < 0)
+ return -1;
+ if (bfd_bread (buf, entry_size, abfd) != entry_size)
+ return -1;
+
+ (*parser) (buf, entry_size, entry);
+
+ return 0;
+}
+
+int
+bfd_sym_fetch_contained_modules_table_entry (abfd, entry, index)
+ bfd *abfd;
+ bfd_sym_contained_modules_table_entry *entry;
+ unsigned long index;
+{
+ void (*parser) PARAMS ((unsigned char *, size_t,
+ bfd_sym_contained_modules_table_entry *));
+ unsigned long offset;
+ unsigned long entry_size = 0;
+ unsigned char buf[6];
+ bfd_sym_data_struct *sdata = NULL;
+
+ parser = NULL;
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (index == 0)
+ return -1;
+
+ switch (sdata->version)
+ {
+ case BFD_SYM_VERSION_3_3:
+ case BFD_SYM_VERSION_3_2:
+ entry_size = 6;
+ parser = bfd_sym_parse_contained_modules_table_entry_v32;
+ break;
+
+ case BFD_SYM_VERSION_3_5:
+ case BFD_SYM_VERSION_3_4:
+ case BFD_SYM_VERSION_3_1:
+ default:
+ break;
+ }
+
+ if (parser == NULL)
+ return -1;
+
+ offset = compute_offset (sdata->header.dshb_cmte.dti_first_page,
+ sdata->header.dshb_page_size,
+ entry_size, index);
+
+ if (bfd_seek (abfd, offset, SEEK_SET) < 0)
+ return -1;
+ if (bfd_bread (buf, entry_size, abfd) != entry_size)
+ return -1;
+
+ (*parser) (buf, entry_size, entry);
+
+ return 0;
+}
+
+int
+bfd_sym_fetch_contained_variables_table_entry (abfd, entry, index)
+ bfd *abfd;
+ bfd_sym_contained_variables_table_entry *entry;
+ unsigned long index;
+{
+ void (*parser) PARAMS ((unsigned char *, size_t,
+ bfd_sym_contained_variables_table_entry *));
+ unsigned long offset;
+ unsigned long entry_size = 0;
+ unsigned char buf[26];
+ bfd_sym_data_struct *sdata = NULL;
+
+ parser = NULL;
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (index == 0)
+ return -1;
+
+ switch (sdata->version)
+ {
+ case BFD_SYM_VERSION_3_3:
+ case BFD_SYM_VERSION_3_2:
+ entry_size = 26;
+ parser = bfd_sym_parse_contained_variables_table_entry_v32;
+ break;
+
+ case BFD_SYM_VERSION_3_5:
+ case BFD_SYM_VERSION_3_4:
+ case BFD_SYM_VERSION_3_1:
+ default:
+ break;
+ }
+
+ if (parser == NULL)
+ return -1;
+
+ offset = compute_offset (sdata->header.dshb_cvte.dti_first_page,
+ sdata->header.dshb_page_size,
+ entry_size, index);
+
+ if (bfd_seek (abfd, offset, SEEK_SET) < 0)
+ return -1;
+ if (bfd_bread (buf, entry_size, abfd) != entry_size)
+ return -1;
+
+ (*parser) (buf, entry_size, entry);
+
+ return 0;
+}
+
+int
+bfd_sym_fetch_contained_statements_table_entry (abfd, entry, index)
+ bfd *abfd;
+ bfd_sym_contained_statements_table_entry *entry;
+ unsigned long index;
+{
+ void (*parser) PARAMS ((unsigned char *, size_t,
+ bfd_sym_contained_statements_table_entry *));
+ unsigned long offset;
+ unsigned long entry_size = 0;
+ unsigned char buf[8];
+ bfd_sym_data_struct *sdata = NULL;
+
+ parser = NULL;
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (index == 0)
+ return -1;
+
+ switch (sdata->version)
+ {
+ case BFD_SYM_VERSION_3_3:
+ case BFD_SYM_VERSION_3_2:
+ entry_size = 8;
+ parser = bfd_sym_parse_contained_statements_table_entry_v32;
+ break;
+
+ case BFD_SYM_VERSION_3_5:
+ case BFD_SYM_VERSION_3_4:
+ case BFD_SYM_VERSION_3_1:
+ default:
+ break;
+ }
+
+ if (parser == NULL)
+ return -1;
+
+ offset = compute_offset (sdata->header.dshb_csnte.dti_first_page,
+ sdata->header.dshb_page_size,
+ entry_size, index);
+
+ if (bfd_seek (abfd, offset, SEEK_SET) < 0)
+ return -1;
+ if (bfd_bread (buf, entry_size, abfd) != entry_size)
+ return -1;
+
+ (*parser) (buf, entry_size, entry);
+
+ return 0;
+}
+
+int
+bfd_sym_fetch_contained_labels_table_entry (abfd, entry, index)
+ bfd *abfd;
+ bfd_sym_contained_labels_table_entry *entry;
+ unsigned long index;
+{
+ void (*parser) PARAMS ((unsigned char *, size_t,
+ bfd_sym_contained_labels_table_entry *));
+ unsigned long offset;
+ unsigned long entry_size = 0;
+ unsigned char buf[12];
+ bfd_sym_data_struct *sdata = NULL;
+
+ parser = NULL;
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (index == 0)
+ return -1;
+
+ switch (sdata->version)
+ {
+ case BFD_SYM_VERSION_3_3:
+ case BFD_SYM_VERSION_3_2:
+ entry_size = 12;
+ parser = bfd_sym_parse_contained_labels_table_entry_v32;
+ break;
+
+ case BFD_SYM_VERSION_3_5:
+ case BFD_SYM_VERSION_3_4:
+ case BFD_SYM_VERSION_3_1:
+ default:
+ break;
+ }
+
+ if (parser == NULL)
+ return -1;
+
+ offset = compute_offset (sdata->header.dshb_clte.dti_first_page,
+ sdata->header.dshb_page_size,
+ entry_size, index);
+
+ if (bfd_seek (abfd, offset, SEEK_SET) < 0)
+ return -1;
+ if (bfd_bread (buf, entry_size, abfd) != entry_size)
+ return -1;
+
+ (*parser) (buf, entry_size, entry);
+
+ return 0;
+}
+
+int
+bfd_sym_fetch_contained_types_table_entry (abfd, entry, index)
+ bfd *abfd;
+ bfd_sym_contained_types_table_entry *entry;
+ unsigned long index;
+{
+ void (*parser) PARAMS ((unsigned char *, size_t,
+ bfd_sym_contained_types_table_entry *));
+ unsigned long offset;
+ unsigned long entry_size = 0;
+ unsigned char buf[0];
+ bfd_sym_data_struct *sdata = NULL;
+
+ parser = NULL;
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (index == 0)
+ return -1;
+
+ switch (sdata->version)
+ {
+ case BFD_SYM_VERSION_3_3:
+ case BFD_SYM_VERSION_3_2:
+ entry_size = 0;
+ parser = NULL;
+ break;
+
+ case BFD_SYM_VERSION_3_5:
+ case BFD_SYM_VERSION_3_4:
+ case BFD_SYM_VERSION_3_1:
+ default:
+ break;
+ }
+
+ if (parser == NULL)
+ return -1;
+
+ offset = compute_offset (sdata->header.dshb_ctte.dti_first_page,
+ sdata->header.dshb_page_size,
+ entry_size, index);
+
+ if (bfd_seek (abfd, offset, SEEK_SET) < 0)
+ return -1;
+ if (bfd_bread (buf, entry_size, abfd) != entry_size)
+ return -1;
+
+ (*parser) (buf, entry_size, entry);
+
+ return 0;
+}
+
+int
+bfd_sym_fetch_file_references_index_table_entry (abfd, entry, index)
+ bfd *abfd;
+ bfd_sym_file_references_index_table_entry *entry;
+ unsigned long index;
+{
+ void (*parser) PARAMS ((unsigned char *, size_t,
+ bfd_sym_file_references_index_table_entry *));
+ unsigned long offset;
+ unsigned long entry_size = 0;
+ unsigned char buf[0];
+ bfd_sym_data_struct *sdata = NULL;
+
+ parser = NULL;
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (index == 0)
+ return -1;
+
+ switch (sdata->version)
+ {
+ case BFD_SYM_VERSION_3_3:
+ case BFD_SYM_VERSION_3_2:
+ entry_size = 0;
+ parser = NULL;
+ break;
+
+ case BFD_SYM_VERSION_3_5:
+ case BFD_SYM_VERSION_3_4:
+ case BFD_SYM_VERSION_3_1:
+ default:
+ break;
+ }
+
+ if (parser == NULL)
+ return -1;
+
+ offset = compute_offset (sdata->header.dshb_fite.dti_first_page,
+ sdata->header.dshb_page_size,
+ entry_size, index);
+
+ if (bfd_seek (abfd, offset, SEEK_SET) < 0)
+ return -1;
+ if (bfd_bread (buf, entry_size, abfd) != entry_size)
+ return -1;
+
+ (*parser) (buf, entry_size, entry);
+
+ return 0;
+}
+
+int
+bfd_sym_fetch_constant_pool_entry (abfd, entry, index)
+ bfd *abfd;
+ bfd_sym_constant_pool_entry *entry;
+ unsigned long index;
+{
+ void (*parser) PARAMS ((unsigned char *, size_t,
+ bfd_sym_constant_pool_entry *));
+ unsigned long offset;
+ unsigned long entry_size = 0;
+ unsigned char buf[0];
+ bfd_sym_data_struct *sdata = NULL;
+
+ parser = NULL;
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (index == 0)
+ return -1;
+
+ switch (sdata->version)
+ {
+ case BFD_SYM_VERSION_3_3:
+ case BFD_SYM_VERSION_3_2:
+ entry_size = 0;
+ parser = NULL;
+ break;
+
+ case BFD_SYM_VERSION_3_5:
+ case BFD_SYM_VERSION_3_4:
+ case BFD_SYM_VERSION_3_1:
+ default:
+ break;
+ }
+
+ if (parser == NULL)
+ return -1;
+
+ offset = compute_offset (sdata->header.dshb_fite.dti_first_page,
+ sdata->header.dshb_page_size,
+ entry_size, index);
+
+ if (bfd_seek (abfd, offset, SEEK_SET) < 0)
+ return -1;
+ if (bfd_bread (buf, entry_size, abfd) != entry_size)
+ return -1;
+
+ (*parser) (buf, entry_size, entry);
+
+ return 0;
+}
+
+int
+bfd_sym_fetch_type_table_entry (abfd, entry, index)
+ bfd *abfd;
+ bfd_sym_type_table_entry *entry;
+ unsigned long index;
+{
+ void (*parser) PARAMS ((unsigned char *, size_t,
+ bfd_sym_type_table_entry *));
+ unsigned long offset;
+ unsigned long entry_size = 0;
+ unsigned char buf[4];
+ bfd_sym_data_struct *sdata = NULL;
+
+ parser = NULL;
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ switch (sdata->version)
+ {
+ case BFD_SYM_VERSION_3_3:
+ case BFD_SYM_VERSION_3_2:
+ entry_size = 4;
+ parser = bfd_sym_parse_type_table_entry_v32;
+ break;
+
+ case BFD_SYM_VERSION_3_5:
+ case BFD_SYM_VERSION_3_4:
+ case BFD_SYM_VERSION_3_1:
+ default:
+ break;
+ }
+
+ if (parser == NULL)
+ return -1;
+
+ offset = compute_offset (sdata->header.dshb_tte.dti_first_page,
+ sdata->header.dshb_page_size,
+ entry_size, index);
+
+ if (bfd_seek (abfd, offset, SEEK_SET) < 0)
+ return -1;
+ if (bfd_bread (buf, entry_size, abfd) != entry_size)
+ return -1;
+
+ (*parser) (buf, entry_size, entry);
+
+ return 0;
+}
+
+int
+bfd_sym_fetch_type_information_table_entry (abfd, entry, offset)
+ bfd *abfd;
+ bfd_sym_type_information_table_entry *entry;
+ unsigned long offset;
+{
+ unsigned char buf[4];
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (index == 0)
+ return -1;
+
+ if (bfd_seek (abfd, offset, SEEK_SET) < 0)
+ return -1;
+
+ if (bfd_bread (buf, 4, abfd) != 4)
+ return -1;
+ entry->nte_index = bfd_getb32 (buf);
+
+ if (bfd_bread (buf, 2, abfd) != 2)
+ return -1;
+ entry->physical_size = bfd_getb16 (buf);
+
+ if (entry->physical_size & 0x8000)
+ {
+ if (bfd_bread (buf, 4, abfd) != 4)
+ return -1;
+ entry->physical_size &= 0x7fff;
+ entry->logical_size = bfd_getb32 (buf);
+ entry->offset = offset + 10;
+ }
+ else
+ {
+ if (bfd_bread (buf, 2, abfd) != 2)
+ return -1;
+ entry->physical_size &= 0x7fff;
+ entry->logical_size = bfd_getb16 (buf);
+ entry->offset = offset + 8;
+ }
+
+ return 0;
+}
+
+int
+bfd_sym_fetch_type_table_information (abfd, entry, index)
+ bfd *abfd;
+ bfd_sym_type_information_table_entry *entry;
+ unsigned long index;
+{
+ bfd_sym_type_table_entry tindex;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (sdata->header.dshb_tte.dti_object_count <= 99)
+ return -1;
+ if (index < 100)
+ return -1;
+
+ if (bfd_sym_fetch_type_table_entry (abfd, &tindex, index - 100) < 0)
+ return -1;
+ if (bfd_sym_fetch_type_information_table_entry (abfd, entry, tindex) < 0)
+ return -1;
+
+ return 0;
+}
+
+const unsigned char *
+bfd_sym_symbol_name (abfd, index)
+ bfd *abfd;
+ unsigned long index;
+{
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (index == 0)
+ return "";
+
+ index *= 2;
+ if ((index / sdata->header.dshb_page_size)
+ > sdata->header.dshb_nte.dti_page_count)
+ return "\009[INVALID]";
+
+ return (const unsigned char *) sdata->name_table + index;
+}
+
+const unsigned char *
+bfd_sym_module_name (abfd, index)
+ bfd *abfd;
+ unsigned long index;
+{
+ bfd_sym_modules_table_entry entry;
+
+ if (bfd_sym_fetch_modules_table_entry (abfd, &entry, index) < 0)
+ return "\011[INVALID]";
+
+ return bfd_sym_symbol_name (abfd, entry.mte_nte_index);
+}
+
+const char *
+bfd_sym_unparse_storage_kind (kind)
+ enum bfd_sym_storage_kind kind;
+{
+ switch (kind)
+ {
+ case BFD_SYM_STORAGE_KIND_LOCAL: return "LOCAL";
+ case BFD_SYM_STORAGE_KIND_VALUE: return "VALUE";
+ case BFD_SYM_STORAGE_KIND_REFERENCE: return "REFERENCE";
+ case BFD_SYM_STORAGE_KIND_WITH: return "WITH";
+ default: return "[UNKNOWN]";
+ }
+}
+
+const char *
+bfd_sym_unparse_storage_class (kind)
+ enum bfd_sym_storage_class kind;
+{
+ switch (kind)
+ {
+ case BFD_SYM_STORAGE_CLASS_REGISTER: return "REGISTER";
+ case BFD_SYM_STORAGE_CLASS_GLOBAL: return "GLOBAL";
+ case BFD_SYM_STORAGE_CLASS_FRAME_RELATIVE: return "FRAME_RELATIVE";
+ case BFD_SYM_STORAGE_CLASS_STACK_RELATIVE: return "STACK_RELATIVE";
+ case BFD_SYM_STORAGE_CLASS_ABSOLUTE: return "ABSOLUTE";
+ case BFD_SYM_STORAGE_CLASS_CONSTANT: return "CONSTANT";
+ case BFD_SYM_STORAGE_CLASS_RESOURCE: return "RESOURCE";
+ case BFD_SYM_STORAGE_CLASS_BIGCONSTANT: return "BIGCONSTANT";
+ default: return "[UNKNOWN]";
+ }
+}
+
+const char *
+bfd_sym_unparse_module_kind (kind)
+ enum bfd_sym_module_kind kind;
+{
+ switch (kind)
+ {
+ case BFD_SYM_MODULE_KIND_NONE: return "NONE";
+ case BFD_SYM_MODULE_KIND_PROGRAM: return "PROGRAM";
+ case BFD_SYM_MODULE_KIND_UNIT: return "UNIT";
+ case BFD_SYM_MODULE_KIND_PROCEDURE: return "PROCEDURE";
+ case BFD_SYM_MODULE_KIND_FUNCTION: return "FUNCTION";
+ case BFD_SYM_MODULE_KIND_DATA: return "DATA";
+ case BFD_SYM_MODULE_KIND_BLOCK: return "BLOCK";
+ default: return "[UNKNOWN]";
+ }
+}
+
+const char *
+bfd_sym_unparse_symbol_scope (scope)
+ enum bfd_sym_symbol_scope scope;
+{
+ switch (scope)
+ {
+ case BFD_SYM_SYMBOL_SCOPE_LOCAL: return "LOCAL";
+ case BFD_SYM_SYMBOL_SCOPE_GLOBAL: return "GLOBAL";
+ default:
+ return "[UNKNOWN]";
+ }
+}
+
+void
+bfd_sym_print_file_reference (abfd, f, entry)
+ bfd *abfd;
+ FILE *f;
+ bfd_sym_file_reference *entry;
+{
+ bfd_sym_file_references_table_entry frtentry;
+ int ret;
+
+ ret = bfd_sym_fetch_file_references_table_entry (abfd, &frtentry,
+ entry->fref_frte_index);
+ fprintf (f, "FILE ");
+
+ if ((ret < 0) || (frtentry.generic.type != BFD_SYM_FILE_NAME_INDEX))
+ fprintf (f, "[INVALID]");
+ else
+ fprintf (f, "\"%.*s\"",
+ bfd_sym_symbol_name (abfd, frtentry.filename.nte_index)[0],
+ &bfd_sym_symbol_name (abfd, frtentry.filename.nte_index)[1]);
+
+ fprintf (f, " (FRTE %lu)", entry->fref_frte_index);
+}
+
+void
+bfd_sym_print_resources_table_entry (abfd, f, entry)
+ bfd *abfd;
+ FILE *f;
+ bfd_sym_resources_table_entry *entry;
+{
+ fprintf (f, " \"%.*s\" (NTE %lu), type \"%.4s\", num %u, size %lu, MTE %lu -- %lu",
+ bfd_sym_symbol_name (abfd, entry->rte_nte_index)[0],
+ &bfd_sym_symbol_name (abfd, entry->rte_nte_index)[1],
+ entry->rte_nte_index, entry->rte_res_type, entry->rte_res_number,
+ entry->rte_res_size, entry->rte_mte_first, entry->rte_mte_last);
+}
+
+void
+bfd_sym_print_modules_table_entry (abfd, f, entry)
+ bfd *abfd;
+ FILE *f;
+ bfd_sym_modules_table_entry *entry;
+{
+ fprintf (f, "\"%.*s\" (NTE %lu)",
+ bfd_sym_symbol_name (abfd, entry->mte_nte_index)[0],
+ &bfd_sym_symbol_name (abfd, entry->mte_nte_index)[1],
+ entry->mte_nte_index);
+
+ fprintf (f, "\n ");
+
+ bfd_sym_print_file_reference (abfd, f, &entry->mte_imp_fref);
+ fprintf (f, " range %lu -- %lu",
+ entry->mte_imp_fref.fref_offset, entry->mte_imp_end);
+
+ fprintf (f, "\n ");
+
+ fprintf (f, "kind %s", bfd_sym_unparse_module_kind (entry->mte_kind));
+ fprintf (f, ", scope %s", bfd_sym_unparse_symbol_scope (entry->mte_scope));
+
+ fprintf (f, ", RTE %lu, offset %lu, size %lu",
+ entry->mte_rte_index, entry->mte_res_offset, entry->mte_size);
+
+ fprintf (f, "\n ");
+
+ fprintf (f, "CMTE %lu, CVTE %lu, CLTE %lu, CTTE %lu, CSNTE1 %lu, CSNTE2 %lu",
+ entry->mte_cmte_index, entry->mte_cvte_index,
+ entry->mte_clte_index, entry->mte_ctte_index,
+ entry->mte_csnte_idx_1, entry->mte_csnte_idx_2);
+
+ if (entry->mte_parent != 0)
+ fprintf (f, ", parent %lu", entry->mte_parent);
+ else
+ fprintf (f, ", no parent");
+
+ if (entry->mte_cmte_index != 0)
+ fprintf (f, ", child %lu", entry->mte_cmte_index);
+ else
+ fprintf (f, ", no child");
+
+#if 0
+ {
+ MTE bfd_sym_modules_table_entry pentry;
+
+ ret = bfd_sym_fetch_modules_table_entry (abfd, &pentry, entry->mte_parent);
+ if (ret < 0)
+ fprintf (f, " parent MTE %lu [INVALID]\n", entry->mte_parent);
+ else
+ fprintf (f, " parent MTE %lu \"%.*s\"\n",
+ entry->mte_parent,
+ bfd_sym_symbol_name (abfd, pentry.mte_nte_index)[0],
+ &bfd_sym_symbol_name (abfd, pentry.mte_nte_index)[1]);
+ }
+#endif
+}
+
+void
+bfd_sym_print_file_references_table_entry (abfd, f, entry)
+ bfd *abfd;
+ FILE *f;
+ bfd_sym_file_references_table_entry *entry;
+{
+ switch (entry->generic.type)
+ {
+ case BFD_SYM_FILE_NAME_INDEX:
+ fprintf (f, "FILE \"%.*s\" (NTE %lu), modtime ",
+ bfd_sym_symbol_name (abfd, entry->filename.nte_index)[0],
+ &bfd_sym_symbol_name (abfd, entry->filename.nte_index)[1],
+ entry->filename.nte_index);
+
+ fprintf (f, "[UNIMPLEMENTED]");
+ /* printModDate (entry->filename.mod_date); */
+ fprintf (f, " (0x%lx)", entry->filename.mod_date);
+ break;
+
+ case BFD_SYM_END_OF_LIST:
+ fprintf (f, "END");
+ break;
+
+ default:
+ fprintf (f, "\"%.*s\" (MTE %lu), offset %lu",
+ bfd_sym_module_name (abfd, entry->entry.mte_index)[0],
+ &bfd_sym_module_name (abfd, entry->entry.mte_index)[1],
+ entry->entry.mte_index,
+ entry->entry.file_offset);
+ break;
+ }
+}
+
+void
+bfd_sym_print_contained_modules_table_entry (abfd, f, entry)
+ bfd *abfd;
+ FILE *f;
+ bfd_sym_contained_modules_table_entry *entry;
+{
+ switch (entry->generic.type)
+ {
+ case BFD_SYM_END_OF_LIST:
+ fprintf (f, "END");
+ break;
+
+ default:
+ fprintf (f, "\"%.*s\" (MTE %lu, NTE %lu)",
+ bfd_sym_module_name (abfd, entry->entry.mte_index)[0],
+ &bfd_sym_module_name (abfd, entry->entry.mte_index)[1],
+ entry->entry.mte_index,
+ entry->entry.nte_index);
+ break;
+ }
+}
+
+void
+bfd_sym_print_contained_variables_table_entry (abfd, f, entry)
+ bfd *abfd;
+ FILE *f;
+ bfd_sym_contained_variables_table_entry *entry;
+{
+ if (entry->generic.type == BFD_SYM_END_OF_LIST)
+ {
+ fprintf (f, "END");
+ return;
+ }
+
+ if (entry->generic.type == BFD_SYM_SOURCE_FILE_CHANGE)
+ {
+ bfd_sym_print_file_reference (abfd, f, &entry->file.fref);
+ fprintf (f, " offset %lu", entry->file.fref.fref_offset);
+ return;
+ }
+
+ fprintf (f, "\"%.*s\" (NTE %lu)",
+ bfd_sym_symbol_name (abfd, entry->entry.nte_index)[0],
+ &bfd_sym_symbol_name (abfd, entry->entry.nte_index)[1],
+ entry->entry.nte_index);
+
+ fprintf (f, ", TTE %lu", entry->entry.tte_index);
+ fprintf (f, ", offset %lu", entry->entry.file_delta);
+ fprintf (f, ", scope %s", bfd_sym_unparse_symbol_scope (entry->entry.scope));
+
+ if (entry->entry.la_size == BFD_SYM_CVTE_SCA)
+ fprintf (f, ", latype %s, laclass %s, laoffset %lu",
+ bfd_sym_unparse_storage_kind (entry->entry.address.scstruct.sca_kind),
+ bfd_sym_unparse_storage_class (entry->entry.address.scstruct.sca_class),
+ entry->entry.address.scstruct.sca_offset);
+ else if (entry->entry.la_size <= BFD_SYM_CVTE_LA_MAX_SIZE)
+ {
+ unsigned long i;
+
+ fprintf (f, ", la [");
+ for (i = 0; i < entry->entry.la_size; i++)
+ fprintf (f, "0x%02x ", entry->entry.address.lastruct.la[i]);
+ fprintf (f, "]");
+ }
+ else if (entry->entry.la_size == BFD_SYM_CVTE_BIG_LA)
+ fprintf (f, ", bigla %lu, biglakind %u",
+ entry->entry.address.biglastruct.big_la,
+ entry->entry.address.biglastruct.big_la_kind);
+
+ else
+ fprintf (f, ", la [INVALID]");
+}
+
+void
+bfd_sym_print_contained_statements_table_entry (abfd, f, entry)
+ bfd *abfd;
+ FILE *f;
+ bfd_sym_contained_statements_table_entry *entry;
+{
+ if (entry->generic.type == BFD_SYM_END_OF_LIST)
+ {
+ fprintf (f, "END");
+ return;
+ }
+
+ if (entry->generic.type == BFD_SYM_SOURCE_FILE_CHANGE)
+ {
+ bfd_sym_print_file_reference (abfd, f, &entry->file.fref);
+ fprintf (f, " offset %lu", entry->file.fref.fref_offset);
+ return;
+ }
+
+ fprintf (f, "\"%.*s\" (MTE %lu), offset %lu, delta %lu",
+ bfd_sym_module_name (abfd, entry->entry.mte_index)[0],
+ &bfd_sym_module_name (abfd, entry->entry.mte_index)[1],
+ entry->entry.mte_index,
+ entry->entry.mte_offset,
+ entry->entry.file_delta);
+}
+
+void
+bfd_sym_print_contained_labels_table_entry (abfd, f, entry)
+ bfd *abfd;
+ FILE *f;
+ bfd_sym_contained_labels_table_entry *entry;
+{
+ if (entry->generic.type == BFD_SYM_END_OF_LIST)
+ {
+ fprintf (f, "END");
+ return;
+ }
+
+ if (entry->generic.type == BFD_SYM_SOURCE_FILE_CHANGE)
+ {
+ bfd_sym_print_file_reference (abfd, f, &entry->file.fref);
+ fprintf (f, " offset %lu", entry->file.fref.fref_offset);
+ return;
+ }
+
+ fprintf (f, "\"%.*s\" (MTE %lu), offset %lu, delta %lu, scope %s",
+ bfd_sym_module_name (abfd, entry->entry.mte_index)[0],
+ &bfd_sym_module_name (abfd, entry->entry.mte_index)[1],
+ entry->entry.mte_index,
+ entry->entry.mte_offset,
+ entry->entry.file_delta,
+ bfd_sym_unparse_symbol_scope (entry->entry.scope));
+}
+
+void
+bfd_sym_print_contained_types_table_entry (abfd, f, entry)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ FILE *f;
+ bfd_sym_contained_types_table_entry *entry ATTRIBUTE_UNUSED;
+{
+ fprintf (f, "[UNIMPLEMENTED]");
+}
+
+const char *
+bfd_sym_type_operator_name (num)
+ unsigned char num;
+{
+ switch (num)
+ {
+ case 1: return "TTE";
+ case 2: return "PointerTo";
+ case 3: return "ScalarOf";
+ case 4: return "ConstantOf";
+ case 5: return "EnumerationOf";
+ case 6: return "VectorOf";
+ case 7: return "RecordOf";
+ case 8: return "UnionOf";
+ case 9: return "SubRangeOf";
+ case 10: return "SetOf";
+ case 11: return "NamedTypeOf";
+ case 12: return "ProcOf";
+ case 13: return "ValueOf";
+ case 14: return "ArrayOf";
+ default: return "[UNKNOWN OPERATOR]";
+ }
+}
+
+const char *
+bfd_sym_type_basic_name (num)
+ unsigned char num;
+{
+ switch (num)
+ {
+ case 0: return "void";
+ case 1: return "pascal string";
+ case 2: return "unsigned long";
+ case 3: return "signed long";
+ case 4: return "extended (10 bytes)";
+ case 5: return "pascal boolean (1 byte)";
+ case 6: return "unsigned byte";
+ case 7: return "signed byte";
+ case 8: return "character (1 byte)";
+ case 9: return "wide character (2 bytes)";
+ case 10: return "unsigned short";
+ case 11: return "signed short";
+ case 12: return "singled";
+ case 13: return "double";
+ case 14: return "extended (12 bytes)";
+ case 15: return "computational (8 bytes)";
+ case 16: return "c string";
+ case 17: return "as-is string";
+ default: return "[UNKNOWN BASIC TYPE]";
+ }
+}
+
+int
+bfd_sym_fetch_long (buf, len, offset, offsetptr, value)
+ unsigned char *buf;
+ unsigned long len;
+ unsigned long offset;
+ unsigned long *offsetptr;
+ long *value;
+{
+ int ret;
+
+ if (offset >= len)
+ {
+ *value = 0;
+ offset += 0;
+ ret = -1;
+ }
+ else if (! (buf[offset] & 0x80))
+ {
+ *value = buf[offset];
+ offset += 1;
+ ret = 0;
+ }
+ else if (buf[offset] == 0xc0)
+ {
+ if ((offset + 5) > len)
+ {
+ *value = 0;
+ offset = len;
+ ret = -1;
+ }
+ else
+ {
+ *value = bfd_getb32 (buf + offset + 1);
+ offset += 5;
+ ret = 0;
+ }
+ }
+ else if ((buf[offset] & 0xc0) == 0xc0)
+ {
+ *value = -(buf[offset] & 0x3f);
+ offset += 1;
+ ret = 0;
+ }
+ else if ((buf[offset] & 0xc0) == 0x80)
+ {
+ if ((offset + 2) > len)
+ {
+ *value = 0;
+ offset = len;
+ ret = -1;
+ }
+ else
+ {
+ *value = bfd_getb16 (buf + offset) & 0x3fff;
+ offset += 2;
+ ret = 0;
+ }
+ }
+ else
+ abort ();
+
+ if (offsetptr != NULL)
+ *offsetptr = offset;
+
+ return ret;
+}
+
+void
+bfd_sym_print_type_information (abfd, f, buf, len, offset, offsetptr)
+ bfd *abfd;
+ FILE *f;
+ unsigned char *buf;
+ unsigned long len;
+ unsigned long offset;
+ unsigned long *offsetptr;
+{
+ unsigned int type;
+
+ if (offset >= len)
+ {
+ fprintf (f, "[NULL]");
+
+ if (offsetptr != NULL)
+ *offsetptr = offset;
+ return;
+ }
+
+ type = buf[offset];
+ offset++;
+
+ if (! (type & 0x80))
+ {
+ fprintf (f, "[%s] (0x%x)", bfd_sym_type_basic_name (type & 0x7f), type);
+
+ if (offsetptr != NULL)
+ *offsetptr = offset;
+ return;
+ }
+
+ if (type & 0x40)
+ fprintf (f, "[packed ");
+ else
+ fprintf (f, "[");
+
+ switch (type & 0x3f)
+ {
+ case 1:
+ {
+ long value;
+ bfd_sym_type_information_table_entry tinfo;
+
+ bfd_sym_fetch_long (buf, len, offset, &offset, &value);
+ if (value <= 0)
+ fprintf (f, "[INVALID]");
+ else
+ {
+ if (bfd_sym_fetch_type_table_information (abfd, &tinfo, value) < 0)
+ fprintf (f, "[INVALID]");
+ else
+ fprintf (f, "\"%.*s\"",
+ bfd_sym_symbol_name (abfd, tinfo.nte_index)[0],
+ &bfd_sym_symbol_name (abfd, tinfo.nte_index)[1]);
+ }
+ fprintf (f, " (TTE %lu)", value);
+ break;
+ }
+
+ case 2:
+ fprintf (f, "pointer (0x%x) to ", type);
+ bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
+ break;
+
+ case 3:
+ {
+ unsigned long value;
+
+ fprintf (f, "scalar (0x%x) of ", type);
+ bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
+ bfd_sym_fetch_long (buf, len, offset, &offset, &value);
+ fprintf (f, " (%lu)", value);
+ break;
+ }
+
+ case 5:
+ {
+ unsigned long lower, upper, nelem;
+ unsigned long i;
+
+ fprintf (f, "enumeration (0x%x) of ", type);
+ bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
+ bfd_sym_fetch_long (buf, len, offset, &offset, &lower);
+ bfd_sym_fetch_long (buf, len, offset, &offset, &upper);
+ bfd_sym_fetch_long (buf, len, offset, &offset, &nelem);
+ fprintf (f, " from %lu to %lu with %lu elements: ", lower, upper, nelem);
+
+ for (i = 0; i < nelem; i++)
+ {
+ fprintf (f, "\n ");
+ bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
+ }
+ break;
+ }
+
+ case 6:
+ fprintf (f, "vector (0x%x)", type);
+ fprintf (f, "\n index ");
+ bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
+ fprintf (f, "\n target ");
+ bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
+ break;
+
+ case 7:
+ case 8:
+ {
+ long nrec, eloff, i;
+
+ if ((type & 0x3f) == 7)
+ fprintf (f, "record (0x%x) of ", type);
+ else
+ fprintf (f, "union (0x%x) of ", type);
+
+ bfd_sym_fetch_long (buf, len, offset, &offset, &nrec);
+ fprintf (f, "%lu elements: ", nrec);
+
+ for (i = 0; i < nrec; i++)
+ {
+ bfd_sym_fetch_long (buf, len, offset, &offset, &eloff);
+ fprintf (f, "\n ");
+ fprintf (f, "offset %lu: ", eloff);
+ bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
+ }
+ break;
+ }
+
+ case 9:
+ fprintf (f, "subrange (0x%x) of ", type);
+ bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
+ fprintf (f, " lower ");
+ bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
+ fprintf (f, " upper ");
+ bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
+ break;
+
+ case 11:
+ {
+ long value;
+
+ fprintf (f, "named type (0x%x) ", type);
+ bfd_sym_fetch_long (buf, len, offset, &offset, &value);
+ if (value <= 0)
+ fprintf (f, "[INVALID]");
+ else
+ fprintf (f, "\"%.*s\"",
+ bfd_sym_symbol_name (abfd, value)[0],
+ &bfd_sym_symbol_name (abfd, value)[1]);
+
+ fprintf (f, " (NTE %lu) with type ", value);
+ bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
+ break;
+ }
+
+ default:
+ fprintf (f, "%s (0x%x)", bfd_sym_type_operator_name (type), type);
+ break;
+ }
+
+ if (type == (0x40 | 0x6))
+ {
+ /* Vector. */
+ long n, width, m;
+ long l;
+ long i;
+
+ bfd_sym_fetch_long (buf, len, offset, &offset, &n);
+ bfd_sym_fetch_long (buf, len, offset, &offset, &width);
+ bfd_sym_fetch_long (buf, len, offset, &offset, &m);
+ /* fprintf (f, "\n "); */
+ fprintf (f, " N %ld, width %ld, M %ld, ", n, width, m);
+ for (i = 0; i < m; i++)
+ {
+ bfd_sym_fetch_long (buf, len, offset, &offset, &l);
+ if (i != 0)
+ fprintf (f, " ");
+ fprintf (f, "%ld", l);
+ }
+ }
+ else if (type & 0x40)
+ {
+ /* Other packed type. */
+ long msb, lsb;
+
+ bfd_sym_fetch_long (buf, len, offset, &offset, &msb);
+ bfd_sym_fetch_long (buf, len, offset, &offset, &lsb);
+ /* fprintf (f, "\n "); */
+ fprintf (f, " msb %ld, lsb %ld", msb, lsb);
+ }
+
+ fprintf (f, "]");
+
+ if (offsetptr != NULL)
+ *offsetptr = offset;
+}
+
+void
+bfd_sym_print_type_information_table_entry (abfd, f, entry)
+ bfd *abfd;
+ FILE *f;
+ bfd_sym_type_information_table_entry *entry;
+{
+ unsigned char *buf;
+ unsigned long offset;
+ unsigned int i;
+
+ fprintf (f, "\"%.*s\" (NTE %lu), %lu bytes at %lu, logical size %lu",
+ bfd_sym_symbol_name (abfd, entry->nte_index)[0],
+ &bfd_sym_symbol_name (abfd, entry->nte_index)[1],
+ entry->nte_index,
+ entry->physical_size, entry->offset, entry->logical_size);
+
+ fprintf (f, "\n ");
+
+ buf = alloca (entry->physical_size);
+ if (buf == NULL)
+ {
+ fprintf (f, "[ERROR]\n");
+ return;
+ }
+ if (bfd_seek (abfd, entry->offset, SEEK_SET) < 0)
+ {
+ fprintf (f, "[ERROR]\n");
+ return;
+ }
+ if (bfd_bread (buf, entry->physical_size, abfd) != entry->physical_size)
+ {
+ fprintf (f, "[ERROR]\n");
+ return;
+ }
+
+ fprintf (f, "[");
+ for (i = 0; i < entry->physical_size; i++)
+ {
+ if (i == 0)
+ fprintf (f, "0x%02x", buf[i]);
+ else
+ fprintf (f, " 0x%02x", buf[i]);
+ }
+
+ fprintf (f, "]");
+ fprintf (f, "\n ");
+
+ bfd_sym_print_type_information (abfd, f, buf, entry->physical_size, 0, &offset);
+
+ if (offset != entry->physical_size)
+ fprintf (f, "\n [parser used %lu bytes instead of %lu]", offset, entry->physical_size); }
+
+void
+bfd_sym_print_file_references_index_table_entry (abfd, f, entry)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ FILE *f;
+ bfd_sym_file_references_index_table_entry *entry ATTRIBUTE_UNUSED;
+{
+ fprintf (f, "[UNIMPLEMENTED]");
+}
+
+void
+bfd_sym_print_constant_pool_entry (abfd, f, entry)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ FILE *f;
+ bfd_sym_constant_pool_entry *entry ATTRIBUTE_UNUSED;
+{
+ fprintf (f, "[UNIMPLEMENTED]");
+}
+
+unsigned char *
+bfd_sym_display_name_table_entry (abfd, f, entry)
+ bfd *abfd;
+ FILE *f;
+ unsigned char *entry;
+{
+ unsigned long index;
+ unsigned long offset;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+ index = (entry - sdata->name_table) / 2;
+
+ if (sdata->version >= BFD_SYM_VERSION_3_4 && entry[0] == 255 && entry[1] == 0)
+ {
+ unsigned short length = bfd_getb16 (entry + 2);
+ fprintf (f, "[%8lu] \"%.*s\"\n", index, length, entry + 4);
+ offset = 2 + length + 1;
+ }
+ else
+ {
+ if (! (entry[0] == 0 || (entry[0] == 1 && entry[1] == '\0')))
+ fprintf (f, "[%8lu] \"%.*s\"\n", index, entry[0], entry + 1);
+
+ if (sdata->version >= BFD_SYM_VERSION_3_4)
+ offset = entry[0] + 2;
+ else
+ offset = entry[0] + 1;
+ }
+
+ return (entry + offset + (offset % 2));
+}
+
+void
+bfd_sym_display_name_table (abfd, f)
+ bfd *abfd;
+ FILE *f;
+{
+ unsigned long name_table_len;
+ unsigned char *name_table, *name_table_end, *cur;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ name_table_len = sdata->header.dshb_nte.dti_page_count * sdata->header.dshb_page_size;
+ name_table = sdata->name_table;
+ name_table_end = name_table + name_table_len;
+
+ fprintf (f, "name table (NTE) contains %lu bytes:\n\n", name_table_len);
+
+ cur = name_table;
+ for (;;)
+ {
+ cur = bfd_sym_display_name_table_entry (abfd, f, cur);
+ if (cur >= name_table_end)
+ break;
+ }
+}
+
+void
+bfd_sym_display_resources_table (abfd, f)
+ bfd *abfd;
+ FILE *f;
+{
+ unsigned long i;
+ bfd_sym_resources_table_entry entry;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ fprintf (f, "resource table (RTE) contains %lu objects:\n\n",
+ sdata->header.dshb_rte.dti_object_count);
+
+ for (i = 1; i <= sdata->header.dshb_rte.dti_object_count; i++)
+ {
+ if (bfd_sym_fetch_resources_table_entry (abfd, &entry, i) < 0)
+ fprintf (f, " [%8lu] [INVALID]\n", i);
+ else
+ {
+ fprintf (f, " [%8lu] ", i);
+ bfd_sym_print_resources_table_entry (abfd, f, &entry);
+ fprintf (f, "\n");
+ }
+ }
+}
+
+void
+bfd_sym_display_modules_table (abfd, f)
+ bfd *abfd;
+ FILE *f;
+{
+ unsigned long i;
+ bfd_sym_modules_table_entry entry;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ fprintf (f, "module table (MTE) contains %lu objects:\n\n",
+ sdata->header.dshb_mte.dti_object_count);
+
+ for (i = 1; i <= sdata->header.dshb_mte.dti_object_count; i++)
+ {
+ if (bfd_sym_fetch_modules_table_entry (abfd, &entry, i) < 0)
+ fprintf (f, " [%8lu] [INVALID]\n", i);
+ else
+ {
+ fprintf (f, " [%8lu] ", i);
+ bfd_sym_print_modules_table_entry (abfd, f, &entry);
+ fprintf (f, "\n");
+ }
+ }
+}
+
+void
+bfd_sym_display_file_references_table (abfd, f)
+ bfd *abfd;
+ FILE *f;
+{
+ unsigned long i;
+ bfd_sym_file_references_table_entry entry;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ fprintf (f, "file reference table (FRTE) contains %lu objects:\n\n",
+ sdata->header.dshb_frte.dti_object_count);
+
+ for (i = 1; i <= sdata->header.dshb_frte.dti_object_count; i++)
+ {
+ if (bfd_sym_fetch_file_references_table_entry (abfd, &entry, i) < 0)
+ fprintf (f, " [%8lu] [INVALID]\n", i);
+ else
+ {
+ fprintf (f, " [%8lu] ", i);
+ bfd_sym_print_file_references_table_entry (abfd, f, &entry);
+ fprintf (f, "\n");
+ }
+ }
+}
+
+void
+bfd_sym_display_contained_modules_table (abfd, f)
+ bfd *abfd;
+ FILE *f;
+{
+ unsigned long i;
+ bfd_sym_contained_modules_table_entry entry;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ fprintf (f, "contained modules table (CMTE) contains %lu objects:\n\n",
+ sdata->header.dshb_cmte.dti_object_count);
+
+ for (i = 1; i <= sdata->header.dshb_cmte.dti_object_count; i++)
+ {
+ if (bfd_sym_fetch_contained_modules_table_entry (abfd, &entry, i) < 0)
+ fprintf (f, " [%8lu] [INVALID]\n", i);
+ else
+ {
+ fprintf (f, " [%8lu] ", i);
+ bfd_sym_print_contained_modules_table_entry (abfd, f, &entry);
+ fprintf (f, "\n");
+ }
+ }
+}
+
+void
+bfd_sym_display_contained_variables_table (abfd, f)
+ bfd *abfd;
+ FILE *f;
+{
+ unsigned long i;
+ bfd_sym_contained_variables_table_entry entry;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ fprintf (f, "contained variables table (CVTE) contains %lu objects:\n\n",
+ sdata->header.dshb_cvte.dti_object_count);
+
+ for (i = 1; i <= sdata->header.dshb_cvte.dti_object_count; i++)
+ {
+ if (bfd_sym_fetch_contained_variables_table_entry (abfd, &entry, i) < 0)
+ fprintf (f, " [%8lu] [INVALID]\n", i);
+ else
+ {
+ fprintf (f, " [%8lu] ", i);
+ bfd_sym_print_contained_variables_table_entry (abfd, f, &entry);
+ fprintf (f, "\n");
+ }
+ }
+
+ fprintf (f, "\n");
+}
+
+void
+bfd_sym_display_contained_statements_table (abfd, f)
+ bfd *abfd;
+ FILE *f;
+{
+ unsigned long i;
+ bfd_sym_contained_statements_table_entry entry;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ fprintf (f, "contained statements table (CSNTE) contains %lu objects:\n\n",
+ sdata->header.dshb_csnte.dti_object_count);
+
+ for (i = 1; i <= sdata->header.dshb_csnte.dti_object_count; i++)
+ {
+ if (bfd_sym_fetch_contained_statements_table_entry (abfd, &entry, i) < 0)
+ fprintf (f, " [%8lu] [INVALID]\n", i);
+ else
+ {
+ fprintf (f, " [%8lu] ", i);
+ bfd_sym_print_contained_statements_table_entry (abfd, f, &entry);
+ fprintf (f, "\n");
+ }
+ }
+}
+
+void
+bfd_sym_display_contained_labels_table (abfd, f)
+ bfd *abfd;
+ FILE *f;
+{
+ unsigned long i;
+ bfd_sym_contained_labels_table_entry entry;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ fprintf (f, "contained labels table (CLTE) contains %lu objects:\n\n",
+ sdata->header.dshb_clte.dti_object_count);
+
+ for (i = 1; i <= sdata->header.dshb_clte.dti_object_count; i++)
+ {
+ if (bfd_sym_fetch_contained_labels_table_entry (abfd, &entry, i) < 0)
+ fprintf (f, " [%8lu] [INVALID]\n", i);
+ else
+ {
+ fprintf (f, " [%8lu] ", i);
+ bfd_sym_print_contained_labels_table_entry (abfd, f, &entry);
+ fprintf (f, "\n");
+ }
+ }
+}
+
+void
+bfd_sym_display_contained_types_table (abfd, f)
+ bfd *abfd;
+ FILE *f;
+{
+ unsigned long i;
+ bfd_sym_contained_types_table_entry entry;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ fprintf (f, "contained types table (CTTE) contains %lu objects:\n\n",
+ sdata->header.dshb_ctte.dti_object_count);
+
+ for (i = 1; i <= sdata->header.dshb_ctte.dti_object_count; i++)
+ {
+ if (bfd_sym_fetch_contained_types_table_entry (abfd, &entry, i) < 0)
+ fprintf (f, " [%8lu] [INVALID]\n", i);
+ else
+ {
+ fprintf (f, " [%8lu] ", i);
+ bfd_sym_print_contained_types_table_entry (abfd, f, &entry);
+ fprintf (f, "\n");
+ }
+ }
+}
+
+void
+bfd_sym_display_file_references_index_table (abfd, f)
+ bfd *abfd;
+ FILE *f;
+{
+ unsigned long i;
+ bfd_sym_file_references_index_table_entry entry;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ fprintf (f, "file references index table (FITE) contains %lu objects:\n\n",
+ sdata->header.dshb_fite.dti_object_count);
+
+ for (i = 1; i <= sdata->header.dshb_fite.dti_object_count; i++)
+ {
+ if (bfd_sym_fetch_file_references_index_table_entry (abfd, &entry, i) < 0)
+ fprintf (f, " [%8lu] [INVALID]\n", i);
+ else
+ {
+ fprintf (f, " [%8lu] ", i);
+ bfd_sym_print_file_references_index_table_entry (abfd, f, &entry);
+ fprintf (f, "\n");
+ }
+ }
+}
+
+void
+bfd_sym_display_constant_pool (abfd, f)
+ bfd *abfd;
+ FILE *f;
+{
+ unsigned long i;
+ bfd_sym_constant_pool_entry entry;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ fprintf (f, "constant pool (CONST) contains %lu objects:\n\n",
+ sdata->header.dshb_const.dti_object_count);
+
+ for (i = 1; i <= sdata->header.dshb_const.dti_object_count; i++)
+ {
+ if (bfd_sym_fetch_constant_pool_entry (abfd, &entry, i) < 0)
+ fprintf (f, " [%8lu] [INVALID]\n", i);
+ else
+ {
+ fprintf (f, " [%8lu] ", i);
+ bfd_sym_print_constant_pool_entry (abfd, f, &entry);
+ fprintf (f, "\n");
+ }
+ }
+}
+
+void
+bfd_sym_display_type_information_table (abfd, f)
+ bfd *abfd;
+ FILE *f;
+{
+ unsigned long i;
+ bfd_sym_type_table_entry index;
+ bfd_sym_type_information_table_entry entry;
+ bfd_sym_data_struct *sdata = NULL;
+
+ BFD_ASSERT (bfd_sym_valid (abfd));
+ sdata = abfd->tdata.sym_data;
+
+ if (sdata->header.dshb_tte.dti_object_count > 99)
+ fprintf (f, "type table (TINFO) contains %lu objects:\n\n",
+ sdata->header.dshb_tte.dti_object_count - 99);
+ else
+ {
+ fprintf (f, "type table (TINFO) contains [INVALID] objects:\n\n");
+ return;
+ }
+
+ for (i = 100; i <= sdata->header.dshb_tte.dti_object_count; i++)
+ {
+ if (bfd_sym_fetch_type_table_entry (abfd, &index, i - 100) < 0)
+ fprintf (f, " [%8lu] [INVALID]\n", i);
+ else
+ {
+ fprintf (f, " [%8lu] (TINFO %lu) ", i, index);
+
+ if (bfd_sym_fetch_type_information_table_entry (abfd, &entry, index) < 0)
+ fprintf (f, "[INVALID]");
+ else
+ bfd_sym_print_type_information_table_entry (abfd, f, &entry);
+
+ fprintf (f, "\n");
+ }
+ }
+}
+
+int
+bfd_sym_scan (abfd, version, mdata)
+ bfd *abfd;
+ bfd_sym_version version;
+ bfd_sym_data_struct *mdata;
+{
+ asection *bfdsec;
+ const char *name = "symbols";
+
+ mdata->name_table = 0;
+ mdata->sbfd = abfd;
+ mdata->version = version;
+
+ bfd_seek (abfd, 0, SEEK_SET);
+ if (bfd_sym_read_header (abfd, &mdata->header, mdata->version) != 0)
+ return -1;
+
+ mdata->name_table = bfd_sym_read_name_table (abfd, &mdata->header);
+ if (mdata->name_table == NULL)
+ return -1;
+
+ bfdsec = bfd_make_section_anyway (abfd, name);
+ if (bfdsec == NULL)
+ return -1;
+
+ bfdsec->vma = 0;
+ bfdsec->lma = 0;
+ bfdsec->_raw_size = 0;
+ bfdsec->filepos = 0;
+ bfdsec->alignment_power = 0;
+
+ bfdsec->flags = SEC_HAS_CONTENTS;
+
+ abfd->tdata.sym_data = mdata;
+
+ return 0;
+}
+
+const bfd_target *
+bfd_sym_object_p (abfd)
+ bfd *abfd;
+{
+ struct bfd_preserve preserve;
+ bfd_sym_version version = -1;
+
+ preserve.marker = NULL;
+ bfd_seek (abfd, 0, SEEK_SET);
+ if (bfd_sym_read_version (abfd, &version) != 0)
+ goto wrong;
+
+ preserve.marker = bfd_alloc (abfd, sizeof (bfd_sym_data_struct));
+ if (preserve.marker == NULL
+ || ! bfd_preserve_save (abfd, &preserve))
+ goto fail;
+
+ if (bfd_sym_scan (abfd, version,
+ (bfd_sym_data_struct *) preserve.marker) != 0)
+ goto wrong;
+
+ bfd_preserve_finish (abfd, &preserve);
+ return abfd->xvec;
+
+ wrong:
+ bfd_set_error (bfd_error_wrong_format);
+
+ fail:
+ if (preserve.marker != NULL)
+ bfd_preserve_restore (abfd, &preserve);
+ return NULL;
+}
+
+asymbol *
+bfd_sym_make_empty_symbol (abfd)
+ bfd *abfd;
+{
+ return (asymbol *) bfd_alloc (abfd, sizeof (asymbol));
+}
+
+void
+bfd_sym_get_symbol_info (abfd, symbol, ret)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asymbol *symbol;
+ symbol_info *ret;
+{
+ bfd_symbol_info (symbol, ret);
+}
+
+long
+bfd_sym_get_symtab_upper_bound (abfd)
+ bfd *abfd ATTRIBUTE_UNUSED;
+{
+ return 0;
+}
+
+long
+bfd_sym_get_symtab (abfd, sym)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asymbol **sym ATTRIBUTE_UNUSED;
+{
+ return 0;
+}
+
+int
+bfd_sym_sizeof_headers (abfd, exec)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ boolean exec ATTRIBUTE_UNUSED;
+{
+ return 0;
+}
+
+const bfd_target sym_vec =
+{
+ "sym", /* name */
+ bfd_target_sym_flavour, /* flavour */
+ BFD_ENDIAN_BIG, /* byteorder */
+ BFD_ENDIAN_BIG, /* header_byteorder */
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
+ (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE | SEC_DATA
+ | SEC_ROM | SEC_HAS_CONTENTS), /* section_flags */
+ 0, /* symbol_leading_char */
+ ' ', /* ar_pad_char */
+ 16, /* ar_max_namelen */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+ { /* bfd_check_format */
+ _bfd_dummy_target,
+ bfd_sym_object_p, /* bfd_check_format */
+ _bfd_dummy_target,
+ _bfd_dummy_target,
+ },
+ { /* bfd_set_format */
+ bfd_false,
+ bfd_sym_mkobject,
+ bfd_false,
+ bfd_false,
+ },
+ { /* bfd_write_contents */
+ bfd_false,
+ bfd_true,
+ bfd_false,
+ bfd_false,
+ },
+
+ BFD_JUMP_TABLE_GENERIC (bfd_sym),
+ BFD_JUMP_TABLE_COPY (_bfd_generic),
+ BFD_JUMP_TABLE_CORE (_bfd_nocore),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
+ BFD_JUMP_TABLE_SYMBOLS (bfd_sym),
+ BFD_JUMP_TABLE_RELOCS (bfd_sym),
+ BFD_JUMP_TABLE_WRITE (bfd_sym),
+ BFD_JUMP_TABLE_LINK (bfd_sym),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ NULL,
+
+ NULL
+};
+
diff --git a/bfd/xsym.h b/bfd/xsym.h
new file mode 100644
index 00000000000..a381c5538d3
--- /dev/null
+++ b/bfd/xsym.h
@@ -0,0 +1,701 @@
+/* xSYM symbol-file support for BFD.
+ Copyright 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include <stdio.h>
+
+#ifndef __xSYM_H__
+#define __xSYM_H__
+
+#define BFD_SYM_VERSION_STR_3_1 "\013Version 3.1"
+#define BFD_SYM_VERSION_STR_3_2 "\013Version 3.2"
+#define BFD_SYM_VERSION_STR_3_3 "\013Version 3.3"
+#define BFD_SYM_VERSION_STR_3_4 "\013Version 3.4"
+#define BFD_SYM_VERSION_STR_3_5 "\013Version 3.5"
+#define BFD_SYM_END_OF_LIST_3_2 0xffff
+#define BFD_SYM_END_OF_LIST_3_4 0xffffffff
+#define BFD_SYM_END_OF_LIST BFD_SYM_END_OF_LIST_3_4
+#define BFD_SYM_FILE_NAME_INDEX_3_2 0xfffe
+#define BFD_SYM_FILE_NAME_INDEX_3_4 0xfffffffe
+#define BFD_SYM_FILE_NAME_INDEX BFD_SYM_FILE_NAME_INDEX_3_4
+#define BFD_SYM_SOURCE_FILE_CHANGE_3_2 0xfffe
+#define BFD_SYM_SOURCE_FILE_CHANGE_3_4 0xfffffffe
+#define BFD_SYM_SOURCE_FILE_CHANGE BFD_SYM_SOURCE_FILE_CHANGE_3_4
+#define BFD_SYM_MAXIMUM_LEGAL_INDEX_3_2 0xfffd
+#define BFD_SYM_MAXIMUM_LEGAL_INDEX_3_4 0xfffffffd
+#define BFD_SYM_MAXIMUM_LEGAL_INDEX BFD_SYM_MAXIMUM_LEGAL_INDEX_3_4
+
+enum bfd_sym_storage_class
+{
+ BFD_SYM_STORAGE_CLASS_REGISTER = 0,
+ BFD_SYM_STORAGE_CLASS_GLOBAL = 1,
+ BFD_SYM_STORAGE_CLASS_FRAME_RELATIVE = 2,
+ BFD_SYM_STORAGE_CLASS_STACK_RELATIVE = 3,
+ BFD_SYM_STORAGE_CLASS_ABSOLUTE = 4,
+ BFD_SYM_STORAGE_CLASS_CONSTANT = 5,
+ BFD_SYM_STORAGE_CLASS_BIGCONSTANT = 6,
+ BFD_SYM_STORAGE_CLASS_RESOURCE = 99
+};
+typedef enum bfd_sym_storage_class bfd_sym_storage_class;
+
+enum bfd_sym_storage_kind
+{
+ BFD_SYM_STORAGE_KIND_LOCAL = 0,
+ BFD_SYM_STORAGE_KIND_VALUE = 1,
+ BFD_SYM_STORAGE_KIND_REFERENCE = 2,
+ BFD_SYM_STORAGE_KIND_WITH = 3
+};
+typedef enum bfd_sym_storage_kind bfd_sym_storage_kind;
+
+enum bfd_sym_version
+{
+ BFD_SYM_VERSION_3_1,
+ BFD_SYM_VERSION_3_2,
+ BFD_SYM_VERSION_3_3,
+ BFD_SYM_VERSION_3_4,
+ BFD_SYM_VERSION_3_5
+};
+typedef enum bfd_sym_version bfd_sym_version;
+
+enum bfd_sym_module_kind
+{
+ BFD_SYM_MODULE_KIND_NONE = 0,
+ BFD_SYM_MODULE_KIND_PROGRAM = 1,
+ BFD_SYM_MODULE_KIND_UNIT = 2,
+ BFD_SYM_MODULE_KIND_PROCEDURE = 3,
+ BFD_SYM_MODULE_KIND_FUNCTION = 4,
+ BFD_SYM_MODULE_KIND_DATA = 5,
+ BFD_SYM_MODULE_KIND_BLOCK = 6
+};
+typedef enum bfd_sym_module_kind bfd_sym_module_kind;
+
+enum bfd_sym_symbol_scope
+{
+ BFD_SYM_SYMBOL_SCOPE_LOCAL = 0, /* Object is seen only inside current scope. */
+ BFD_SYM_SYMBOL_SCOPE_GLOBAL = 1 /* Object has global scope. */
+};
+typedef enum bfd_sym_symbol_scope bfd_sym_symbol_scope;
+
+struct bfd_sym_file_reference
+{
+ unsigned long fref_frte_index; /* File reference table index. */
+ unsigned long fref_offset; /* Absolute offset into source file. */
+};
+typedef struct bfd_sym_file_reference bfd_sym_file_reference;
+
+/* NAME TABLE (NTE). */
+
+/* RESOURCES TABLE (RTE)
+
+ All code and data is *defined* to reside in a resource. Even A5
+ relative data is defined to reside in a dummy resource of ResType
+ 'gbld'. Code always resides in a resource. Because a code/data
+ is built of many modules, when walking through a resource we must
+ point back to the modules in the order they were defined. This is
+ done by requiring the entries in the Modules Entry table to be
+ ordered by resource/resource-number and by the location in that
+ resource. Hence, the resource table entry points to the first
+ module making up that resource. All modules table entries following
+ that first one with the same restype/resnum are contiguous and offset
+ from that first entry. */
+
+struct bfd_sym_resources_table_entry
+{
+ unsigned char rte_res_type[4]; /* Resource Type. */
+ unsigned short rte_res_number; /* Resource Number. */
+ unsigned long rte_nte_index; /* Name of the resource. */
+ unsigned long rte_mte_first; /* Index of first module in the resource. */
+ unsigned long rte_mte_last; /* Index of the last module in the resource. */
+ unsigned long rte_res_size; /* Size of the resource. */
+};
+typedef struct bfd_sym_resources_table_entry bfd_sym_resources_table_entry;
+
+/* MODULES TABLE (MTE)
+
+ Modules table entries are ordered by their appearance in a resource.
+ (Note that having a single module copied into two resources is not
+ possible). Modules map back to their resource via an index into the
+ resource table and an offset into the resource. Modules also point
+ to their source files, both the definition module and implemention
+ module. Because modules can be textually nested within other
+ modules, a link to the parent (containing) module is required. This
+ module can textually contain other modules. A link to the contiguous
+ list of child (contained) modules is required. Variables, statements,
+ and types defined in the module are pointed to by indexing the head of
+ the contiguous lists of contained variables, contained statements,
+ and contained types. */
+
+struct bfd_sym_modules_table_entry
+{
+ unsigned long mte_rte_index; /* Which resource it is in. */
+ unsigned long mte_res_offset; /* Offset into the resource. */
+ unsigned long mte_size; /* Size of module. */
+ char mte_kind; /* What kind of module this is. */
+ char mte_scope; /* How visible is it? */
+ unsigned long mte_parent; /* Containing module. */
+ bfd_sym_file_reference mte_imp_fref; /* Implementation source. */
+ unsigned long mte_imp_end; /* End of implementation source. */
+ unsigned long mte_nte_index; /* The name of the module. */
+ unsigned long mte_cmte_index; /* Modules contained in this. */
+ unsigned long mte_cvte_index; /* Variables contained in this. */
+ unsigned long mte_clte_index; /* Local labels defined here. */
+ unsigned long mte_ctte_index; /* Types contained in this. */
+ unsigned long mte_csnte_idx_1; /* CSNTE index of mte_snbr_first. */
+ unsigned long mte_csnte_idx_2; /* CSNTE index of mte_snbr_last. */
+};
+typedef struct bfd_sym_modules_table_entry bfd_sym_modules_table_entry;
+
+/* FILE REFERENCES TABLE (FRTE)
+
+ The FILE REFERENCES TABLE maps from source file to module & offset.
+ The table is ordered by increasing file offset. Each new offset
+ references a module.
+
+ FRT = FILE_SOURCE_START
+ FILE_SOURCE_INCREMENT*
+ END_OF_LIST.
+
+ *** THIS MECHANISM IS VERY SLOW FOR FILE+STATEMENT_NUMBER TO
+ *** MODULE/CODE ADDRESS OPERATIONS. ANOTHER MECHANISM IS
+ *** REQUIRED!! */
+
+union bfd_sym_file_references_table_entry
+{
+ struct
+ {
+ /* END_OF_LIST, FILE_NAME_INDEX, or module table entry. */
+ unsigned long type;
+ }
+ generic;
+
+ struct
+ {
+ /* FILE_NAME_INDEX. */
+ unsigned long type;
+ unsigned long nte_index;
+ unsigned long mod_date;
+ }
+ filename;
+
+ struct
+ {
+ /* < FILE_NAME_INDEX. */
+ unsigned long mte_index;
+ unsigned long file_offset;
+ }
+ entry;
+};
+typedef union bfd_sym_file_references_table_entry bfd_sym_file_references_table_entry;
+
+/* CONTAINED MODULES TABLE (CMTE)
+
+ Contained Modules are lists of indices into the modules table. The
+ lists are terminated by an END_OF_LIST index. All entries are of the
+ same size, hence mapping an index into a CMTE list is simple.
+
+ CMT = MTE_INDEX* END_OF_LIST. */
+
+union bfd_sym_contained_modules_table_entry
+{
+ struct
+ {
+ /* END_OF_LIST, index. */
+ unsigned long type;
+ }
+ generic;
+
+ struct
+ {
+ unsigned long mte_index; /* Index into the Modules Table. */
+ unsigned long nte_index; /* The name of the module. */
+ }
+ entry;
+};
+typedef union bfd_sym_contained_modules_table_entry bfd_sym_contained_modules_table_entry;
+
+/* CONTAINED VARIABLES TABLE (CVTE)
+
+ Contained Variables map into the module table, file table, name table, and type
+ table. Contained Variables are a contiguous list of source file change record,
+ giving the name of and offset into the source file corresponding to all variables
+ following. Variable definition records contain an index into the name table (giving
+ the text of the variable as it appears in the source code), an index into the type
+ table giving the type of the variable, an increment added to the source file
+ offset giving the start of the implementation of the variable, and a storage
+ class address, giving information on variable's runtime address.
+
+ CVT = SOURCE_FILE_CHANGE SYMBOL_INFO* END_OF_LIST.
+ SYMBOL_INFO = SYMBOL_DEFINITION | SOURCE_FILE_CHANGE .
+
+ All entries are of the same size, making the fetching of data simple. The
+ variable entries in the list are in ALPHABETICAL ORDER to simplify the display of
+ available variables for several of the debugger's windows. */
+
+/* 'la_size' determines the variant used below:
+
+ == BFD_SYM_CVTE_SCA
+ Traditional STORAGE_CLASS_ADDRESS;
+
+ <= BFD_SYM_CVTE_LA_MAX_SIZE
+ That many logical address bytes ("in-situ");
+
+ == BFD_SYM_CVTE_BIG_LA
+ Logical address bytes in constant pool, at offset 'big_la'. */
+
+#define BFD_SYM_CVTE_SCA 0 /* Indicate SCA variant of CVTE. */
+#define BFD_SYM_CVTE_LA_MAX_SIZE 13 /* Max# of logical address bytes in a CVTE. */
+#define BFD_SYM_CVTE_BIG_LA 127 /* Indicates LA redirection to constant pool. */
+
+union bfd_sym_contained_variables_table_entry
+{
+ struct
+ {
+ /* END_OF_LIST, SOURCE_FILE_CHANGE, or type table entry. */
+ unsigned long type;
+ }
+ generic;
+
+ struct
+ {
+ /* SOURCE_FILE_CHANGE. */
+ unsigned long type;
+ bfd_sym_file_reference fref;
+ }
+ file;
+
+ struct
+ {
+ /* < SOURCE_FILE_CHANGE. */
+ unsigned long tte_index;
+ unsigned long nte_index;
+ unsigned long file_delta; /* Increment from previous source. */
+ unsigned char scope;
+ unsigned char la_size; /* #bytes of LAs below. */
+
+ union
+ {
+ /* la_size == BFD_SYM_CVTE_SCA. */
+ struct
+ {
+ unsigned char sca_kind; /* Distinguish local from value/var formal. */
+ unsigned char sca_class; /* The storage class itself. */
+ unsigned long sca_offset;
+ }
+ scstruct;
+
+ /* la_size <= BFD_SYM_CVTE_LA_MAX_SIZE. */
+ struct {
+ unsigned char la[BFD_SYM_CVTE_LA_MAX_SIZE]; /* Logical address bytes. */
+ unsigned char la_kind; /* Eqv. cvte_location.sca_kind. */
+ }
+ lastruct;
+
+ /* la_size == BFD_SYM_CVTE_BIG_LA 127. */
+ struct
+ {
+ unsigned long big_la; /* Logical address bytes in constant pool. */
+ unsigned char big_la_kind; /* Eqv. cvte_location.sca_kind. */
+ }
+ biglastruct;
+ }
+ address;
+ }
+ entry;
+};
+typedef union bfd_sym_contained_variables_table_entry bfd_sym_contained_variables_table_entry;
+
+/* CONTAINED STATEMENTS TABLE (CSNTE)
+
+ Contained Statements table. This table is similar to the Contained
+ Variables table except that instead of VARIABLE_DEFINITION entries, this
+ module contains STATEMENT_NUMBER_DEFINITION entries. A statement number
+ definition points back to the containing module (via an index into
+ the module entry table) and contains the file and resource deltas
+ to add to the previous values to get to this statement.
+ All entries are of the same size, making the fetching of data simple. The
+ entries in the table are in order of increasing statement number within the
+ source file.
+
+ The Contained Statements table is indexed from two places. An MTE contains
+ an index to the first statement number within the module. An FRTE contains
+ an index to the first statement in the table (Possibly. This is slow.) Or
+ a table of fast statement number to CSNTE entry mappings indexes into the
+ table. Choice not yet made. */
+
+union bfd_sym_contained_statements_table_entry
+{
+ struct
+ {
+ /* END_OF_LIST, SOURCE_FILE_CHANGE, or statement table entry. */
+ unsigned long type;
+ }
+ generic;
+
+ struct
+ {
+ /* SOURCE_FILE_CHANGE. */
+ unsigned long type;
+ bfd_sym_file_reference fref; /* File name table. */
+ }
+ file;
+
+ struct
+ {
+ unsigned long mte_index; /* Which module contains it. */
+ unsigned long file_delta; /* Where it is defined. */
+ unsigned long mte_offset; /* Where it is in the module. */
+ }
+ entry;
+};
+typedef union bfd_sym_contained_statements_table_entry bfd_sym_contained_statements_table_entry;
+
+/* CONTAINED LABELS TABLE (CLTE)
+
+ Contained Labels table names those labels local to the module. It is similar
+ to the Contained Statements table. */
+
+union bfd_sym_contained_labels_table_entry
+{
+ struct
+ {
+ /* END_OF_LIST, SOURCE_FILE_CHANGE, index. */
+ unsigned long type;
+ }
+ generic;
+
+ struct
+ {
+ /* SOURCE_FILE_CHANGE. */
+ unsigned long type;
+ bfd_sym_file_reference fref;
+ }
+ file;
+
+ struct
+ {
+ /* < SOURCE_FILE_CHANGE. */
+ unsigned long mte_index; /* Which module contains us. */
+ unsigned long mte_offset; /* Where it is in the module. */
+ unsigned long nte_index; /* The name of the label. */
+ unsigned long file_delta; /* Where it is defined. */
+ unsigned short scope; /* How visible the label is. */
+ }
+ entry;
+};
+typedef union bfd_sym_contained_labels_table_entry bfd_sym_contained_labels_table_entry;
+
+/* CONTAINED TYPES TABLE (CTTE)
+
+ Contained Types define the named types that are in the module. It is used to
+ map name indices into type indices. The type entries in the table are in
+ alphabetical order by type name. */
+
+union bfd_sym_contained_types_table_entry
+{
+ struct
+ {
+ /* END_OF_LIST, SOURCE_FILE_CHANGE, or type table entry. */
+ unsigned long type;
+ }
+ generic;
+
+ struct
+ {
+ /* SOURCE_FILE_CHANGE. */
+ unsigned long type;
+ bfd_sym_file_reference fref;
+ }
+ file;
+
+ struct
+ {
+ /* < SOURCE_FILE_CHANGE. */
+ unsigned long tte_index;
+ unsigned long nte_index;
+ unsigned long file_delta; /* From last file definition. */
+ }
+ entry;
+};
+typedef union bfd_sym_contained_types_table_entry bfd_sym_contained_types_table_entry;
+
+/* TYPE TABLE (TTE). */
+
+typedef unsigned long bfd_sym_type_table_entry;
+
+/* TYPE INFORMATION TABLE (TINFO). */
+
+struct bfd_sym_type_information_table_entry
+{
+ unsigned long nte_index;
+ unsigned long physical_size;
+ unsigned long logical_size;
+ unsigned long offset;
+};
+typedef struct bfd_sym_type_information_table_entry bfd_sym_type_information_table_entry;
+
+/* FILE REFERENCES INDEX TABLE (FITE)
+
+ The FRTE INDEX TABLE indexes into the FILE REFERENCE TABLE above. The FRTE
+ at that index is the FILE_SOURCE_START for a series of files. The FRTEs are
+ indexed from 1. The list is terminated with an END_OF_LIST. */
+
+union bfd_sym_file_references_index_table_entry
+{
+ struct
+ {
+ unsigned long type;
+ }
+ generic;
+
+ struct
+ {
+ unsigned long frte_index; /* Index into the FRTE table. */
+ unsigned long nte_index; /* Name table index, gives filename. */
+ }
+ entry;
+};
+typedef union bfd_sym_file_references_index_table_entry bfd_sym_file_references_index_table_entry;
+
+/* CONSTANT POOL (CONST)
+
+ The CONSTANT_POOL consists of entries that start on word boundaries. The entries
+ are referenced by byte index into the constant pool, not by record number.
+
+ Each entry takes the form:
+
+ <16-bit size>
+ <that many bytes of stuff>
+
+ Entries do not cross page boundaries. */
+
+typedef short bfd_sym_constant_pool_entry;
+
+/* The DISK_SYMBOL_HEADER_BLOCK is the first record in a .SYM file,
+ defining the physical characteristics of the symbolic information.
+ The remainder of the * .SYM file is stored in fixed block
+ allocations. For the purposes of paging, the * file is considered
+ to be an array of dshb_page_size blocks, with block 0 (and *
+ possibly more) devoted to the DISK_SYMBOL_HEADER_BLOCK.
+
+ The dti_object_count field means that the allowed indices for that
+ type of object are 0 .. dti_object_count. An index of 0, although
+ allowed, is never done. However, an 0th entry is created in the
+ table. That entry is filled with all zeroes. The reason for this
+ is to avoid off-by-one programming errors that would otherwise
+ occur: an index of k *MEANS* k, not k-1 when going to the disk
+ table. */
+
+struct bfd_sym_table_info
+{
+ unsigned long dti_first_page; /* First page for this table. */
+ unsigned long dti_page_count; /* Number of pages for the table. */
+ unsigned long dti_object_count; /* Number of objects in the table. */
+};
+typedef struct bfd_sym_table_info bfd_sym_table_info;
+
+struct bfd_sym_header_block
+{
+ unsigned char dshb_id[32]; /* Version information. */
+ unsigned short dshb_page_size; /* Size of the pages/blocks. */
+ unsigned long dshb_hash_page; /* Disk page for the hash table. */
+ unsigned long dshb_root_mte; /* MTE index of the program root. */
+ unsigned long dshb_mod_date; /* modification date of executable. */
+ bfd_sym_table_info dshb_frte; /* Per TABLE information. */
+ bfd_sym_table_info dshb_rte;
+ bfd_sym_table_info dshb_mte;
+ bfd_sym_table_info dshb_cmte;
+ bfd_sym_table_info dshb_cvte;
+ bfd_sym_table_info dshb_csnte;
+ bfd_sym_table_info dshb_clte;
+ bfd_sym_table_info dshb_ctte;
+ bfd_sym_table_info dshb_tte;
+ bfd_sym_table_info dshb_nte;
+ bfd_sym_table_info dshb_tinfo;
+ bfd_sym_table_info dshb_fite; /* File information. */
+ bfd_sym_table_info dshb_const; /* Constant pool. */
+
+ unsigned char dshb_file_creator[4]; /* Executable's creator. */
+ unsigned char dshb_file_type[4]; /* Executable's file type. */
+};
+typedef struct bfd_sym_header_block bfd_sym_header_block;
+
+struct bfd_sym_data_struct
+{
+ unsigned char *name_table;
+ bfd_sym_header_block header;
+ bfd_sym_version version;
+ bfd *sbfd;
+};
+typedef struct bfd_sym_data_struct bfd_sym_data_struct;
+
+extern boolean bfd_sym_mkobject
+ PARAMS ((bfd *));
+extern void bfd_sym_print_symbol
+ PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
+extern boolean bfd_sym_valid
+ PARAMS ((bfd *));
+extern unsigned char * bfd_sym_read_name_table
+ PARAMS ((bfd *, bfd_sym_header_block *));
+extern void bfd_sym_parse_file_reference_v32
+ PARAMS ((unsigned char *, size_t, bfd_sym_file_reference *));
+extern void bfd_sym_parse_disk_table_v32
+ PARAMS ((unsigned char *, size_t, bfd_sym_table_info *));
+extern void bfd_sym_parse_header_v32
+ PARAMS ((unsigned char *, size_t, bfd_sym_header_block *));
+extern int bfd_sym_read_header_v32
+ PARAMS ((bfd *, bfd_sym_header_block *));
+extern int bfd_sym_read_header_v34
+ PARAMS ((bfd *, bfd_sym_header_block *));
+extern int bfd_sym_read_header
+ PARAMS ((bfd *, bfd_sym_header_block *, bfd_sym_version));
+extern int bfd_sym_read_version
+ PARAMS ((bfd *, bfd_sym_version *));
+extern void bfd_sym_display_table_summary
+ PARAMS ((FILE *, bfd_sym_table_info *, const char *));
+extern void bfd_sym_display_header
+ PARAMS ((FILE *, bfd_sym_header_block *));
+extern void bfd_sym_parse_resources_table_entry_v32
+ PARAMS ((unsigned char *, size_t, bfd_sym_resources_table_entry *));
+extern void bfd_sym_parse_modules_table_entry_v33
+ PARAMS ((unsigned char *, size_t, bfd_sym_modules_table_entry *));
+extern void bfd_sym_parse_file_references_table_entry_v32
+ PARAMS ((unsigned char *, size_t, bfd_sym_file_references_table_entry *));
+extern void bfd_sym_parse_contained_modules_table_entry_v32
+ PARAMS ((unsigned char *, size_t, bfd_sym_contained_modules_table_entry *));
+extern void bfd_sym_parse_contained_variables_table_entry_v32
+ PARAMS ((unsigned char *, size_t, bfd_sym_contained_variables_table_entry *));
+extern void bfd_sym_parse_contained_statements_table_entry_v32
+ PARAMS ((unsigned char *, size_t, bfd_sym_contained_statements_table_entry *));
+extern void bfd_sym_parse_contained_labels_table_entry_v32
+ PARAMS ((unsigned char *, size_t, bfd_sym_contained_labels_table_entry *));
+extern void bfd_sym_parse_type_table_entry_v32
+ PARAMS ((unsigned char *, size_t, bfd_sym_type_table_entry *));
+extern int bfd_sym_fetch_resources_table_entry
+ PARAMS ((bfd *, bfd_sym_resources_table_entry *, unsigned long));
+extern int bfd_sym_fetch_modules_table_entry
+ PARAMS ((bfd *, bfd_sym_modules_table_entry *, unsigned long));
+extern int bfd_sym_fetch_file_references_table_entry
+ PARAMS ((bfd *, bfd_sym_file_references_table_entry *, unsigned long));
+extern int bfd_sym_fetch_contained_modules_table_entry
+ PARAMS ((bfd *, bfd_sym_contained_modules_table_entry *, unsigned long));
+extern int bfd_sym_fetch_contained_variables_table_entry
+ PARAMS ((bfd *, bfd_sym_contained_variables_table_entry *, unsigned long));
+extern int bfd_sym_fetch_contained_statements_table_entry
+ PARAMS ((bfd *, bfd_sym_contained_statements_table_entry *, unsigned long));
+extern int bfd_sym_fetch_contained_labels_table_entry
+ PARAMS ((bfd *, bfd_sym_contained_labels_table_entry *, unsigned long));
+extern int bfd_sym_fetch_contained_types_table_entry
+ PARAMS ((bfd *, bfd_sym_contained_types_table_entry *, unsigned long));
+extern int bfd_sym_fetch_file_references_index_table_entry
+ PARAMS ((bfd *, bfd_sym_file_references_index_table_entry *, unsigned long));
+extern int bfd_sym_fetch_constant_pool_entry
+ PARAMS ((bfd *, bfd_sym_constant_pool_entry *, unsigned long));
+extern int bfd_sym_fetch_type_table_entry
+ PARAMS ((bfd *, bfd_sym_type_table_entry *, unsigned long));
+extern int bfd_sym_fetch_type_information_table_entry
+ PARAMS ((bfd *, bfd_sym_type_information_table_entry *, unsigned long));
+extern int bfd_sym_fetch_type_table_information
+ PARAMS ((bfd *, bfd_sym_type_information_table_entry *, unsigned long));
+extern const unsigned char * bfd_sym_symbol_name
+ PARAMS ((bfd *, unsigned long));
+extern const unsigned char * bfd_sym_module_name
+ PARAMS ((bfd *, unsigned long));
+extern const char * bfd_sym_unparse_storage_kind
+ PARAMS ((enum bfd_sym_storage_kind));
+extern const char * bfd_sym_unparse_storage_class
+ PARAMS ((enum bfd_sym_storage_class));
+extern const char * bfd_sym_unparse_module_kind
+ PARAMS ((enum bfd_sym_module_kind));
+extern const char * bfd_sym_unparse_symbol_scope
+ PARAMS ((enum bfd_sym_symbol_scope));
+extern void bfd_sym_print_file_reference
+ PARAMS ((bfd *, FILE *, bfd_sym_file_reference *));
+extern void bfd_sym_print_resources_table_entry
+ PARAMS ((bfd *, FILE *, bfd_sym_resources_table_entry *));
+extern void bfd_sym_print_modules_table_entry
+ PARAMS ((bfd *, FILE *, bfd_sym_modules_table_entry *));
+extern void bfd_sym_print_file_references_table_entry
+ PARAMS ((bfd *, FILE *, bfd_sym_file_references_table_entry *));
+extern void bfd_sym_print_contained_modules_table_entry
+ PARAMS ((bfd *, FILE *, bfd_sym_contained_modules_table_entry *));
+extern void bfd_sym_print_contained_variables_table_entry
+ PARAMS ((bfd *, FILE *f, bfd_sym_contained_variables_table_entry *));
+extern void bfd_sym_print_contained_statements_table_entry
+ PARAMS ((bfd *, FILE *, bfd_sym_contained_statements_table_entry *));
+extern void bfd_sym_print_contained_labels_table_entry
+ PARAMS ((bfd *, FILE *, bfd_sym_contained_labels_table_entry *));
+extern void bfd_sym_print_contained_types_table_entry
+ PARAMS ((bfd *, FILE *, bfd_sym_contained_types_table_entry *));
+extern const char * bfd_sym_type_operator_name
+ PARAMS ((unsigned char));
+extern const char * bfd_sym_type_basic_name
+ PARAMS ((unsigned char));
+extern int bfd_sym_fetch_long
+ PARAMS ((unsigned char *, unsigned long, unsigned long, unsigned long *, long *));
+extern void bfd_sym_print_type_information
+ PARAMS ((bfd *, FILE *, unsigned char *, unsigned long, unsigned long, unsigned long *));
+extern void bfd_sym_print_type_information_table_entry
+ PARAMS ((bfd *, FILE *, bfd_sym_type_information_table_entry *));
+extern void bfd_sym_print_file_references_index_table_entry
+ PARAMS ((bfd *, FILE *, bfd_sym_file_references_index_table_entry *));
+extern void bfd_sym_print_constant_pool_entry
+ PARAMS ((bfd *, FILE *, bfd_sym_constant_pool_entry *));
+extern unsigned char * bfd_sym_display_name_table_entry
+ PARAMS ((bfd *, FILE *, unsigned char *));
+extern void bfd_sym_display_name_table
+ PARAMS ((bfd *, FILE *));
+extern void bfd_sym_display_resources_table
+ PARAMS ((bfd *, FILE *));
+extern void bfd_sym_display_modules_table
+ PARAMS ((bfd *, FILE *));
+extern void bfd_sym_display_file_references_table
+ PARAMS ((bfd *, FILE *));
+extern void bfd_sym_display_contained_modules_table
+ PARAMS ((bfd *, FILE *));
+extern void bfd_sym_display_contained_variables_table
+ PARAMS ((bfd *, FILE *));
+extern void bfd_sym_display_contained_statements_table
+ PARAMS ((bfd *, FILE *));
+extern void bfd_sym_display_contained_labels_table
+ PARAMS ((bfd *, FILE *));
+extern void bfd_sym_display_contained_types_table
+ PARAMS ((bfd *, FILE *));
+extern void bfd_sym_display_file_references_index_table
+ PARAMS ((bfd *, FILE *));
+extern void bfd_sym_display_constant_pool
+ PARAMS ((bfd *, FILE *));
+extern void bfd_sym_display_type_information_table
+ PARAMS ((bfd *, FILE *));
+extern int bfd_sym_scan
+ PARAMS ((bfd *, bfd_sym_version, bfd_sym_data_struct *));
+extern const bfd_target * bfd_sym_object_p
+ PARAMS ((bfd *));
+extern asymbol * bfd_sym_make_empty_symbol
+ PARAMS ((bfd *));
+extern void bfd_sym_get_symbol_info
+ PARAMS ((bfd *, asymbol *, symbol_info *));
+extern long bfd_sym_get_symtab_upper_bound
+ PARAMS ((bfd *));
+extern long bfd_sym_get_symtab
+ PARAMS ((bfd *, asymbol **));
+extern int bfd_sym_sizeof_headers
+ PARAMS ((bfd *, boolean));
+
+#endif /* __xSYM_H__ */
diff --git a/config/ChangeLog b/config/ChangeLog
index 129ce6168f3..3f985d32a07 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,9 @@
+2002-11-10 Stan Shebs <shebs@apple.com>
+
+ Retire common MPW configury bits.
+ * mpw-mh-mpw: Remove.
+ * mpw: Remove directory along with all of its files.
+
2002-05-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* acinclude.m4: Allow for PWDCMD to override hardcoded pwd.
diff --git a/config/mpw-mh-mpw b/config/mpw-mh-mpw
deleted file mode 100644
index 543ef4fb2a1..00000000000
--- a/config/mpw-mh-mpw
+++ /dev/null
@@ -1,157 +0,0 @@
-# This is an MPW makefile fragment.
-
-# Since there are a multiplicity of Mac compilers and two different
-# processors, this file is primarily a library of options for each
-# compiler. Somebody else (such as a configure or build script) will
-# make the actual choice.
-
-# Compiler to use for compiling.
-
-CC_MPW_C = C -d MPW_C -d ALMOST_STDC -d ANSI_PROTOTYPES -d MPW -mc68020 -model far -b -w
-
-CC_SC = SC -d ALMOST_STDC -d ANSI_PROTOTYPES -d MPW -mc68020 -model far -b -i '' -i :
-
-CC_MWC68K = MWC68K -d MPW -enum int -mpw_chars -sym on -w off -mc68020 -model far
-
-CC_PPCC = PPCC -d powerc=1 -d pascal= -d ALMOST_STDC -d ANSI_PROTOTYPES -d MPW -w
-
-CC_MRC = MrC -d powerc=1 -d pascal= -d ALMOST_STDC -d ANSI_PROTOTYPES -d MPW -i '' -i : -jm
-
-CC_SMrC = SMrC -d MPW
-
-# "-mpw_chars" is necessary because GNU sources often mix signed and
-# unsigned casually.
-# "-w off" is not a great idea, but CW7 is complaining about enum
-# assignments.
-# "-opt global,peep,l4,speed" is sometimes good, and sometimes bad.
-# We must use {CIncludes} so that MPW tools will work; {MWCIncludes}
-# defines stdout, islower, etc, in ways that are incompatible with MPW's
-# runtime. However, this cannot be done via -i "{CIncludes}", since
-# that does not affect how <>-type includes happen; instead, the variable
-# MWCIncludes must be set to point at {CIncludes}.
-
-CC_MWCPPC = MWCPPC -d MPW -enum int -mpw_chars -sym on -w off
-
-# Note that GCC does *not* wire in a definition of "pascal", so that
-# it can be handled in another way if desired.
-
-CC_68K_GCC = gC -Dpascal= -DANSI_PROTOTYPES -DMPW
-
-CC_PPC_GCC = gC -Dpowerc=1 -Dpascal= -DANSI_PROTOTYPES -DMPW
-
-# Nothing for the default CFLAGS.
-
-CFLAGS =
-
-# Tool to use for making libraries/archives.
-
-AR_LIB = Lib
-
-AR_MWLINK68K = MWLink68K -xm library
-
-AR_PPCLINK = PPCLink -xm library
-
-AR_MWLINKPPC = MWLinkPPC -xm library
-
-AR_AR = ar
-
-AR_FLAGS = -o
-
-RANLIB_NULL = null-command
-
-RANLIB_RANLIB = ranlib
-
-# Compiler and/or linker to use for linking.
-
-CC_LD_LINK = Link -w -d -model far {CC_LD_TOOL_FLAGS}
-
-CC_LD_MWLINK68K = MWLink68K -w {CC_LD_TOOL_FLAGS} -sym on -model far
-
-CC_LD_PPCLINK = PPCLink -main __start -outputformat xcoff
-
-CC_LD_MWLINKPPC = MWLinkPPC -w {CC_LD_TOOL_FLAGS} -sym on
-
-CC_LD_GLD = gC
-
-# Extension for linker output.
-
-PROG_EXT_68K =
-
-PROG_EXT_XCOFF = .xcoff
-
-# Nothing for the default LDFLAGS.
-
-LDFLAGS = -w
-
-CC_LD_TOOL_FLAGS = -c 'MPS ' -t MPST
-
-# Libraries to link against.
-
-# It would appear that the math libraries are not
-# needed except to provide a definition for scalb,
-# which is called from ldexp, which is referenced
-# in the m68k opcodes library.
-
-EXTRALIBS_C = \Option-d
- "{CLibraries}"StdClib.o \Option-d
- "{CLibraries}"Math.o \Option-d
- "{CLibraries}"CSANELib.o \Option-d
- "{Libraries}"Stubs.o \Option-d
- "{Libraries}"Runtime.o \Option-d
- "{Libraries}"Interface.o \Option-d
- "{Libraries}"ToolLibs.o
-
-EXTRALIBS_MWC68K = \Option-d
- "{CLibraries}"StdClib.o \Option-d
- "{CLibraries}"Math.o \Option-d
- "{CLibraries}"CSANELib.o \Option-d
- "{Libraries}"Stubs.o \Option-d
- "{Libraries}"Runtime.o \Option-d
- "{Libraries}"Interface.o \Option-d
- "{Libraries}"ToolLibs.o \Option-d
- "{MW68KLibraries}MPW ANSI (4i) C.68K.Lib"
-
-EXTRALIBS_PPC_XCOFF = \Option-d
- "{PPCLibraries}"StdCRuntime.o \Option-d
- "{PPCLibraries}"InterfaceLib.xcoff \Option-d
- "{PPCLibraries}"MathLib.xcoff \Option-d
- "{PPCLibraries}"StdCLib.xcoff \Option-d
- "{PPCLibraries}"PPCToolLibs.o \Option-d
- "{PPCLibraries}"PPCCRuntime.o \Option-d
- "{GCCPPCLibraries}"libgcc.xcoff
-
-EXTRALIBS_PPC = \Option-d
- "{PPCLibraries}"StdCRuntime.o \Option-d
- "{SharedLibraries}"InterfaceLib \Option-d
- "{SharedLibraries}"MathLib \Option-d
- "{SharedLibraries}"StdCLib \Option-d
- "{PPCLibraries}"PPCToolLibs.o \Option-d
- "{PPCLibraries}"PPCCRuntime.o \Option-d
- "{GCCPPCLibraries}"libgcc.xcoff
-
-EXTRALIBS_MWCPPC = \Option-d
- "{MWPPCLibraries}"MWStdCRuntime.Lib \Option-d
- "{MWPPCLibraries}"InterfaceLib \Option-d
- "{MWPPCLibraries}"StdCLib \Option-d
- "{MWPPCLibraries}"MathLib \Option-d
- "{MWPPCLibraries}"PPCToolLibs.o
-
-# Tool to make PEF with, if needed.
-
-MAKEPEF_NULL = null-command
-
-MAKEPEF_PPC = MakePEF
-
-MAKEPEF_FLAGS = \Option-d
- -l InterfaceLib.xcoff=InterfaceLib \Option-d
- -l MathLib.xcoff=MathLib \Option-d
- -l StdCLib.xcoff=StdCLib
-
-MAKEPEF_TOOL_FLAGS = -ft MPST -fc 'MPS '
-
-# Resource compiler to use.
-
-REZ_68K = Rez
-
-REZ_PPC = Rez -d WANT_CFRG
-
diff --git a/config/mpw/ChangeLog b/config/mpw/ChangeLog
deleted file mode 100644
index 3cdefbf7a75..00000000000
--- a/config/mpw/ChangeLog
+++ /dev/null
@@ -1,53 +0,0 @@
-Tue Nov 26 12:34:12 1996 Stan Shebs <shebs@andros.cygnus.com>
-
- * g-mpw-make.sed: Fix some comments.
-
-Mon Sep 16 14:42:52 1996 Stan Shebs <shebs@andros.cygnus.com>
-
- * g-mpw-make.sed (HLDENV): Edit out all references.
-
-Thu Aug 15 19:49:23 1996 Stan Shebs <shebs@andros.cygnus.com>
-
- * true: New script, identical to mpw-true.
- * g-mpw-make.sed: Add @DASH_C_FLAG@ and @SEGMENT_FLAG()@
- to the editors for compile commands.
-
-Thu Aug 1 15:01:42 1996 Stan Shebs <shebs@andros.cygnus.com>
-
- * mpw-true, mpw-touch, null-command: New scripts.
- * README: Describe usage in more detail.
-
-Tue Dec 12 14:51:51 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * g-mpw-make.sed: Don't edit out "version=" occurrences.
-
-Fri Dec 1 11:46:18 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * g-mpw-make.sed (bindir, libdir): Edit the positions of
- pathname separators to work with other pathnames better.
-
-Tue Nov 7 15:08:07 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * g-mpw-make.sed: Add comment about Duplicate vs Catenate,
- add additional pattern for editing link-compile commands.
-
-Tue Oct 24 14:28:51 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * g-mpw-make.sed: Add handling for *.tab.[hc] files.
- (CHILL_FOR_TARGET, CHILL_LIB): Edit out tricky definitions
- of these.
-
-Thu Sep 28 21:05:10 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * g-mpw-make.sed: New file, generic sed commands to translate
- Unix makefiles into MPW makefile syntax.
-
-Fri Mar 17 11:51:20 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * README: Clarify instructions.
- * fi: Remove.
-
-Wed Dec 21 15:45:53 1994 Stan Shebs <shebs@andros.cygnus.com>
-
- * MoveIfChange, README, fi, forward-include, open-brace,
- tr-7to8-src: New files.
diff --git a/config/mpw/MoveIfChange b/config/mpw/MoveIfChange
deleted file mode 100644
index 0dbc12582f5..00000000000
--- a/config/mpw/MoveIfChange
+++ /dev/null
@@ -1,19 +0,0 @@
-# Rename a file only if it is different from a previously existing
-# file of the same name. This is useful for keeping make from doing
-# too much work if the contents of a file haven't changed.
-
-# This is an MPW translation of the standard GNU sh script move-if-change.
-
-Set exit 0
-
-If "`exists -f "{2}"`"
- Compare "{1}" "{2}" >dev:null
- If {status} != 0
- Rename -y "{1}" "{2}"
- Else
- Echo "{2}" is unchanged
- Delete -i -y "{1}"
- End
-Else
- Rename -y "{1}" "{2}"
-End
diff --git a/config/mpw/README b/config/mpw/README
deleted file mode 100644
index 554700adc81..00000000000
--- a/config/mpw/README
+++ /dev/null
@@ -1,23 +0,0 @@
-This directory contains MPW scripts and related files that are needed to
-build Cygnus GNU tools for MPW. The scripts should be somewhere on the
-command path; our usual practice has been to have a separate directory
-for the scripts, and put the tools (byacc, flex, and sed at least) there
-also; then it's easier to drag the support bits around as a group, or to
-upgrade MPW versions. The complete package of scripts and tool binaries
-is usually available as pub/mac/buildtools.cpt.hqx on ftp.cygnus.com.
-
-"tr-7to8-src" is actually the source to an MPW script that transforms
-sequences like "\Option-d" into the actual 8-bit chars that MPW needs.
-It's only the source because it can't itself include any 8-bit chars.
-It *can* be processed into a genuine "tr-7to8" by using itself:
-
- tr-7to8 tr-7to8-src | sed -e 's/Src//' >new-tr-7to8
-
-Use this to verify:
-
- compare tr-7to8 new-tr-7to8
-
-If you don't have a working tr-7to8, then you will have to manually
-replace all occurrences of "\Option-d" with real Option-d (which looks
-like a delta), then do similarly with all the other "\Option-..."
-strings, and then change "\SrcOption-d" into the string "\Option-d".
diff --git a/config/mpw/forward-include b/config/mpw/forward-include
deleted file mode 100644
index ddd6bd71105..00000000000
--- a/config/mpw/forward-include
+++ /dev/null
@@ -1,3 +0,0 @@
-Echo '#include' ¶""{1}"¶" >"{2}".tem
-MoveIfChange "{2}".tem "{2}"
-
diff --git a/config/mpw/g-mpw-make.sed b/config/mpw/g-mpw-make.sed
deleted file mode 100644
index e7d3c770736..00000000000
--- a/config/mpw/g-mpw-make.sed
+++ /dev/null
@@ -1,293 +0,0 @@
-# Sed commands to translate Unix makefiles into MPW makefiles.
-# These are nominally generic, but work best on the makefiles used
-# for GNU programs.
-
-# Whack out any commented-out lines that are probably commands;
-# they can only cause trouble later on.
-/^# /d
-
-# Change dependency char.
-/:$/s/:/ \\Option-f/g
-/^[^ :#][^:]*:/s/\([ ]*\):\([ ]*\)/ \\Option-f /g
-
-# Change syntax of Makefile vars.
-/\$/s/\${\([a-zA-Z0-9_-]*\)}/{\1}/g
-/\$/s/\$(\([a-zA-Z0-9_-]*\))/{\1}/g
-/ $@/s/ $@/ {Targ}/
-
-# Double-$ are literals to Unix but not to MPW make.
-/\$\$/s/\$\$/$/g
-
-# Change pathname syntax.
-/\//s,\.\./\/\.\./,:::,g
-/\//s,\.\./,::,g
-/\.\//s,\./,:,g
-/\//s,/,:,g
-# Undo excess changes.
-/and/s,and:or$,and/or,
-/and/s,and:or ,and/or ,
-/want/s,want:need,want/need,
-# Fixing up sed commands.
-/-e/s_":\([^:]*\):d"_"/\1/d"_g
-/-e/s_":\([^:]*\):,:\([^:]*\):d"_"/\1/,/\2/d"_g
-
-/=/s/ = \.$/ = :/
-
-# Make these go away so that later edits not confused.
-/HLDENV/s/{HLDENV}//
-
-# Comment out any explicit srcdir setting.
-/srcdir/s/^srcdir/# srcdir/
-
-/BASEDIR/s/^BASEDIR =.*$/BASEDIR = "{srcroot}"/
-/{BASEDIR}:/s/{BASEDIR}:/{BASEDIR}/g
-/{srcdir}:/s/{srcdir}:/"{srcdir}"/g
-/"{srcdir}":/s/"{srcdir}":/"{srcdir}"/g
-
-# Tweak some conventions that are backwards for the Mac.
-/bindir/s/{exec_prefix}:bin/{exec_prefix}bin:/
-/libdir/s/{exec_prefix}:lib/{exec_prefix}lib:/
-
-# Comment out settings of anything set by mpw host config.
-/CC/s/^CC *=/#CC =/
-/CFLAGS/s/^CFLAGS *=/#CFLAGS =/
-/AR/s/^AR *=/#AR =/
-/AR_FLAGS/s/^AR_FLAGS *=/#AR_FLAGS =/
-/RANLIB/s/^RANLIB *=/#RANLIB =/
-/CC_LD/s/^CC_LD *=/#CC_LD =/
-/LDFLAGS/s/^LDFLAGS *=/#LDFLAGS =/
-
-# Change -I usages.
-/-I/s/-I\./-i :/g
-/-I/s/-I::bfd/-i ::bfd:/g
-/-I/s/-I::include/-i ::include:/g
-/-I/s/-I/-i /g
-
-# Change -D usage.
-/-D/s/\([ =]\)-D\([^ ]*\)/\1-d \2/g
-
-# Change continuation char.
-/\\$/s/\\$/\\Option-d/
-
-# Change wildcard char.
-/\*/s/\*/\\Option-x/g
-
-# Change path of various types of source files. This rule does not allow
-# for file names with multiple dots in the name.
-/\.[chly]/s/\([ ><=]\)\([-a-zA-Z0-9_${}:"]*\)\.\([chly]\)/\1"{s}"\2.\3/g
-/\.[chly]/s/^\([-a-zA-Z0-9_${}:"]*\)\.\([chly]\)/"{s}"\1.\2/
-# Allow files named *.tab.[ch] as a special case.
-/\.tab\.[ch]/s/\([ ><=]\)\([-a-zA-Z0-9_${}:"]*\.tab\)\.\([ch]\)/\1"{s}"\2.\3/g
-/\.tab\.[ch]/s/^\([-a-zA-Z0-9_${}:"]*\.tab\)\.\([ch]\)/"{s}"\1.\2/
-# Fix some overenthusiasms.
-/{s}/s/"{s}""{srcdir}"/"{srcdir}"/g
-/{s}/s/"{s}"{\([a-zA-Z0-9_]*\)dir}/"{\1dir}"/g
-/{s}/s/"{s}"{\([a-zA-Z0-9_]*\)DIR}/"{\1DIR}"/g
-/{s}/s/"{s}""{\([a-zA-Z0-9_]*\)dir}"/"{\1dir}"/g
-/{s}/s/"{s}""{\([a-zA-Z0-9_]*\)DIR}"/"{\1DIR}"/g
-/{s}/s/"{s}":/:/g
-/{s}/s/^"{s}"//g
-/{s}/s/"{s}""{s}"/"{s}"/g
-/{s}/s/"{s}""{srcdir}"/"{s}"/g
-/{s}/s/"{srcdir}""{s}"/"{s}"/g
-
-# The .def files are also typically source files.
-/\.def/s/\([ ><]\)\([-a-zA-Z0-9_${}:"]*\)\.def/\1"{s}"\2.def/g
-/\.def/s/^\([-a-zA-Z0-9_${}:"]*\)\.def/"{s}"\1.def/g
-
-# Change extension and path of objects.
-/\.o/s/\([ =]\)\([-a-zA-Z0-9_${}:"]*\)\.o/\1"{o}"\2.c.o/g
-/\.o/s/^\([-a-zA-Z0-9_${}:"]*\)\.o/"{o}"\1.c.o/
-# Allow *.tab.o files as a special case of a 2-dot-name file.
-/\.o/s/\([ =]\)\([-a-zA-Z0-9_${}:"]*\)\.tab\.o/\1"{o}"\2.tab.c.o/g
-/\.o/s/^\([-a-zA-Z0-9_${}:"]*\)\.tab\.o/"{o}"\1.tab.c.o/
-# Clean up.
-/"{o}"/s/"{o}""{o}"/"{o}"/g
-/"{o}"/s/^"{o}"\([a-zA-Z0-9_]*\)=/\1=/
-
-# Change extension of libs.
-/\.a/s/lib\([a-z]*\)\.a/lib\1.o/g
-
-# Remove non-fail option.
-/-/s/^\([ ]*\)-/\1/
-# Fix overeagernesses - assumes no one-letter commands.
-/^[ ]*[a-z] /s/^\([ ]*\)\([a-z]\) /\1-\2 /
-
-# Remove non-echo option. (watch out for autoconf things)
-/@/s/^\([ ]*\)@/\1/
-
-# Change cp to Duplicate.
-# Catenate is perhaps more accurate, but the pattern would have to
-# identify the output file and add a '>' redirection into it.
-/cp/s/^\([ ]*\)cp /\1Duplicate -d -y /
-# Change mv to Rename.
-/mv/s/^\([ ]*\)mv /\1Rename -y /
-/Rename/s/^\([ ]*\)Rename -y -f/\1Rename -y/
-# Change rm to Delete.
-/rm -rf/s/^\([ ]*\)rm -rf /\1Delete -i -y /
-/rm -f/s/^\([ ]*\)rm -f /\1Delete -i -y /
-/rm/s/^\([ ]*\)rm /\1Delete -i -y /
-# Note that we don't mess with ln - directory-specific scripts
-# must decide what to do with symlinks.
-# Change cat to Catenate.
-/cat/s/^\([ ]*\)cat /\1Catenate /
-# Change touch to mpw-touch.
-/touch/s/^\([ ]*\)touch /\1mpw-touch /
-# Change mkdir to NewFolder.
-/mkdir/s/^\([ ]*\)mkdir /\1NewFolder /
-# Change var setting to Set.
-/=/s/^\([ ]*\)\([-a-zA-Z0-9_]*\)=\([^;]*\); \\Option-d/\1Set \2 \3/
-
-# Change tests.
-/if /s/if \[ *-f \([^ ]*\) ] *; *\\Option-d/If "`Exists "\1"`" != ""/
-/if /s/if \[ *-f \([^ ]*\) ] *; *then *\\Option-d/If "`Exists "\1"`" != ""/
-/if /s/if \[ ! *-f \([^ ]*\) ] *; *\\Option-d/If "`Exists "\1"`" == ""/
-/if /s/if \[ ! *-f \([^ ]*\) ] *; *then \\Option-d/If "`Exists "\1"`" == ""/
-
-/if /s/if \[ *-d \([^ ]*\) ] *; *\\Option-d/If "`Exists "\1"`" != ""/
-/if /s/if \[ *-d \([^ ]*\) ] *; *then *\\Option-d/If "`Exists "\1"`" != ""/
-/if /s/if \[ ! *-d \([^ ]*\) ] *; *\\Option-d/If "`Exists "\1"`" == ""/
-/if /s/if \[ ! *-d \([^ ]*\) ] *; *then *\\Option-d/If "`Exists "\1"`" == ""/
-
-/if /s/if \[ -d \([^ ]*\) ] *; then true *; else mkdir \([^ ;]*\) *; fi/If "`Exists "\1"`" != "" NewFolder \2 End If/
-
-/if /s/if \[ \([^ ]*\) = \([^ ]*\) ] *; *\\Option-d/If "\1" == "\2"/
-/if /s/if \[ \([^ ]*\) = \([^ ]*\) ] *; *then *\\Option-d/If "\1" == "\2"/
-
-/if /s/if \[ \([^ ]*\) != \([^ ]*\) ] *; *\\Option-d/If "\1" != "\2"/
-/if /s/if \[ \([^ ]*\) != \([^ ]*\) ] *; *then *\\Option-d/If "\1" != "\2"/
-
-/if /s/if \[ \([^ ]*\) -eq \([^ ]*\) ] *; *\\Option-d/If "\1" != "\2"/
-/if /s/if \[ \([^ ]*\) -eq \([^ ]*\) ] *; *then *\\Option-d/If "\1" != "\2"/
-
-/^[ ]*else true$/c\
- Else\
- mpw-true\
-
-
-/else/s/^\([ ]*\)else[ ]*$/\1Else/
-/else/s/^\([ ]*\)else[; ]*\\Option-d$/\1Else/
-
-/^[ ]*else[ ]*true[ ]*$/c\
- Else\
- mpw-true
-
-/^[ ]*else[ ]*true[; ]*fi$/c\
- Else\
- mpw-true\
- End If
-
-/fi/s/^\([ ]*\)fi *$/\1End/
-/fi/s/^\([ ]*\)fi *; *\\Option-d/\1End/
-
-# Change looping.
-/for/s/^\([ ]*\)for \([-a-zA-Z0-9_]*\) in \([^;]*\); *do *\\Option-d/\1For \2 In \3/
-/^\([ ]*\)do *\\Option-d/d
-/done/s/^\([ ]*\)done *; *\\Option-d/\1End/
-/done/s/^\([ ]*\)done$/\1End/
-
-# Trailing semicolons and continued lines are unneeded sh syntax.
-/; \\Option-d/s/; \\Option-d//
-
-# Change move-if-change to MoveIfChange.
-/move-if-change/s/\([^ ]*\)move-if-change/MoveIfChange/g
-
-# Change $(SHELL) to the script name by itself.
-/SHELL/s/^\([ ]*\){SHELL} /\1/
-
-# Change syntax of default rule dependency.
-/^\.c\.o/s/^\.c\.o \\Option-f$/.c.o \\Option-f .c/
-
-# Change default rule's action.
-/{CC} -c/s/{CC} -c \(.*\) \$<$/{CC} @DASH_C_FLAG@ {DepDir}{Default}.c \1 @SEGMENT_FLAG({Default})@ -o {TargDir}{Default}.c.o/
-
-# This is pretty disgusting, but I can't seem to detect empty rules.
-/Option-f$/s/Option-f$/Option-f _oldest/g
-
-# Remove -c from explicit compiler calls. (but should not if GCC)
-# Handle the case of a source file that is "{xxx}"file.c.
-/ -c /s/{\([A-Z_]*\)CC}\(.*\) -c \(.*\)"\([^"]*\)"\([-a-z_]*\)\.c/{\1CC}\2 @DASH_C_FLAG@ \3"\4"\5.c -o "{o}"\5.c.o/
-# Handle the case of a source file that is "{xxx}"dir:file.c.
-/ -c /s/{\([A-Z_]*\)CC}\(.*\) -c \(.*\)"\([^"]*\)"\([-a-z_]*\):\([-a-z_]*\)\.c/{\1CC}\2 @DASH_C_FLAG@ \3"\4"\5:\6.c -o "{o}"\6.c.o/
-
-# Change linking cc to linking sequence.
-/-o/s/^\([ ]*\){CC} \(.*\){\([A-Z_]*\)CFLAGS} \(.*\){LDFLAGS} \(.*\)-o \([^ ]*\) \(.*\)$/\1{CC_LD} \2 {\3CFLAGS} \4 {LDFLAGS} \5 -o \6{PROG_EXT} \7\
-\1{MAKEPEF} \6{PROG_EXT} -o \6 {MAKEPEF_TOOL_FLAGS} {MAKEPEF_FLAGS}\
-\1{REZ} "{s}"\6.r -o \6 -append -d PROG_NAME='"'\6'"' -d VERSION_STRING='"'{version}'"'/
-/-o/s/^\([ ]*\){CC} \(.*\){\([A-Z_]*\)CFLAGS} \(.*\)-o \([^ ]*\) \(.*\){LDFLAGS} \(.*\)$/\1{CC_LD} \2 {\3CFLAGS} \4 {LDFLAGS} \6 -o \5{PROG_EXT} \7\
-\1{MAKEPEF} \5{PROG_EXT} -o \5 {MAKEPEF_TOOL_FLAGS} {MAKEPEF_FLAGS}\
-\1{REZ} "{s}"\5.r -o \5 -append -d PROG_NAME='"'\5'"' -d VERSION_STRING='"'{version}'"'/
-/-o/s/^\([ ]*\){HOST_CC} \(.*\)-o \([^ ]*\) \(.*\)$/\1{HOST_CC_LD} \2 -o \3{PROG_EXT} \4\
-\1{MAKEPEF} \3{PROG_EXT} -o \3 {MAKEPEF_TOOL_FLAGS} {MAKEPEF_FLAGS}\
-\1{REZ} "{s}"\3.r -o \3 -append -d PROG_NAME='"'\3'"' -d VERSION_STRING='"'{version}'"'/
-
-# Comment out .NOEXPORT rules.
-/\.NOEXPORT/s/^\.NOEXPORT/#\.NOEXPORT/
-# Comment out .PHONY rules.
-/\.PHONY/s/^\.PHONY/#\.PHONY/
-# Comment out .PRECIOUS rules.
-/\.PRECIOUS/s/^\.PRECIOUS/#\.PRECIOUS/
-# Comment out .SUFFIXES rules.
-/\.SUFFIXES/s/^\.SUFFIXES/#\.SUFFIXES/
-
-# Set the install program appropriately.
-/INSTALL/s/^INSTALL *= *`.*`:install.sh -c/INSTALL = Duplicate -y/
-
-# Don't try to decide whether to use the tree's own tools.
-/bison/s/`.*bison:bison.*`/bison -y/
-/byacc/s/`.*byacc:byacc.*`/byacc/
-/flex/s/`.*flex:flex.*`/flex/
-
-# Turn transformed C comments in echo commands back into comments.
-/echo/s,echo '\(.*\):\\Option-x\(.*\)\\Option-x:\(.*\)',echo '\1/*\2*/\3',
-
-# Whack out various clever expressions that search for tools, since
-# the clever code is too /bin/sh specific.
-
-/^AR_FOR_TARGET = `/,/`$/c\
-AR_FOR_TARGET = ::binutils:ar\
-
-
-/^RANLIB_FOR_TARGET = `/,/`$/c\
-RANLIB_FOR_TARGET = ::binutils:ranlib\
-
-
-/^RANLIB_TEST_FOR_TARGET = /,/ranlib ] )$/c\
-RANLIB_TEST_FOR_TARGET = \
-
-
-/^EXPECT = `/,/`$/c\
-EXPECT = \
-
-
-/^RUNTEST = `/,/`$/c\
-RUNTEST = \
-
-
-/^CC_FOR_TARGET = `/,/`$/c\
-CC_FOR_TARGET = \
-
-
-/^CXX_FOR_TARGET = `/,/`$/c\
-CXX_FOR_TARGET = \
-
-
-/^CHILL_FOR_TARGET = `/,/`$/c\
-CHILL_FOR_TARGET = \
-
-
-/^CHILL_LIB = `/,/`$/c\
-CHILL_LIB = \
-
-/sanit/s/{start-sanit...-[a-z0-9]*}//
-/sanit/s/{end-sanit...-[a-z0-9]*}//
-
-# Add standard defines and default rules.
-/^# srcdir/a\
-\
-s = "{srcdir}"\
-\
-o = :\
-\
-"{o}" \\Option-f : "{s}"
-
diff --git a/config/mpw/mpw-touch b/config/mpw/mpw-touch
deleted file mode 100644
index c743a5122b5..00000000000
--- a/config/mpw/mpw-touch
+++ /dev/null
@@ -1,7 +0,0 @@
-# "Touch" command.
-
-If "`Exists "{1}"`" != ""
- SetFile -m . "{1}"
-Else
- Echo ' ' > "{1}"
-End If
diff --git a/config/mpw/mpw-true b/config/mpw/mpw-true
deleted file mode 100644
index 0506530d3c6..00000000000
--- a/config/mpw/mpw-true
+++ /dev/null
@@ -1 +0,0 @@
-Exit 0
diff --git a/config/mpw/null-command b/config/mpw/null-command
deleted file mode 100644
index 4844c8ec553..00000000000
--- a/config/mpw/null-command
+++ /dev/null
@@ -1 +0,0 @@
-# This command does nothing.
diff --git a/config/mpw/open-brace b/config/mpw/open-brace
deleted file mode 100644
index 58465dcc18c..00000000000
--- a/config/mpw/open-brace
+++ /dev/null
@@ -1,4 +0,0 @@
-# MPW makefiles seem not to have any way to get a literal open
-# brace into a rule anywhere, so this does the job.
-
-Echo '{'
diff --git a/config/mpw/tr-7to8-src b/config/mpw/tr-7to8-src
deleted file mode 100644
index b20b649c895..00000000000
--- a/config/mpw/tr-7to8-src
+++ /dev/null
@@ -1,9 +0,0 @@
-StreamEdit -e \Option-d
- '/\Option-x/ \Option-d
- Replace /\Option-d\SrcOption-d/ "\Option-d\Option-d" -c \Option-5 ; \Option-d
- Replace /\Option-d\SrcOption-f/ "\Option-d\Option-f" -c \Option-5 ; \Option-d
- Replace /\Option-d\SrcOption-8/ "\Option-d\Option-8" -c \Option-5 ; \Option-d
- Replace /\Option-d\SrcOption-5/ "\Option-d\Option-5" -c \Option-5 ; \Option-d
- Replace /\Option-d\SrcOption-x/ "\Option-d\Option-x" -c \Option-5 ; \Option-d
- Replace /\Option-d\SrcOption-r/ "\Option-d\Option-r" -c \Option-5' \Option-d
- "{1}"
diff --git a/config/mpw/true b/config/mpw/true
deleted file mode 100644
index 0506530d3c6..00000000000
--- a/config/mpw/true
+++ /dev/null
@@ -1 +0,0 @@
-Exit 0
diff --git a/configure.in b/configure.in
index 8988bef2782..21b86fde476 100644
--- a/configure.in
+++ b/configure.in
@@ -76,7 +76,7 @@ target_libs="target-libiberty \
# 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"
################################################################################
@@ -361,7 +361,7 @@ case "${target}" in
avr-*-*)
noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
;;
- c4x-*-*)
+ c4x-*-* | tic4x-*-*)
noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
;;
c54x*-*-* | tic54x-*-*)
@@ -422,6 +422,13 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
i[3456]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
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6a70cf425d6..624b01f2249 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,1319 @@
+2002-11-14 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.h: Move the most relevant interface functions to the start
+ of the file.
+
+2002-11-14 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.h (deprecated_registers): Rename registers.
+ * a68v-nat.c, alpha-nat.c, arch-utils.c, core-sol2.c: Update.
+ * hp300ux-nat.c, hppab-nat.c, hppah-nat.c: Update.
+ * hppam3-nat.c, hpux-thread.c, i386gnu-nat.c: Update.
+ * ia64-aix-nat.c, ia64-linux-nat.c, ia64-tdep.c: Update.
+ * irix4-nat.c, irix5-nat.c, lynx-nat.c, m68k-tdep.c: Update.
+ * m68knbsd-nat.c, mips-linux-tdep.c, mipsm3-nat.c: Update.
+ * mipsv4-nat.c, ns32knbsd-nat.c, ppc-bdm.c: Update.
+ * ppc-sysv-tdep.c, ptx4-nat.c, regcache.c, remote-es.c: Update.
+ * remote-sds.c, remote-vx68.c, remote-vxmips.c: Update.
+ * remote-vxsparc.c, rs6000-tdep.c, sol-thread.c: Update.
+ * sparc-nat.c, sparc-tdep.c, sun3-nat.c, symm-nat.c: Update.
+ * v850ice.c: Update.
+
+Wed Nov 13 19:51:05 2002 Andrew Cagney <cagney@redhat.com>
+
+ * utils.c (gdb_realpath): Add comment mentioning realpath with a
+ NULL buffer.
+
+2002-11-13 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.h (deprecated_read_register_bytes): Rename
+ read_register_bytes.
+ (deprecated_write_register_bytes): Rename write_register_bytes.
+ * alpha-tdep.c, arm-tdep.c, cris-tdep.c, d10v-tdep.c: Update.
+ * dwarf2cfi.c, frv-tdep.c, hppa-tdep.c, ia64-tdep.c: Update.
+ * m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10300-tdep.c: Update.
+ * ns32k-tdep.c, regcache.c, remote-sds.c, remote-vx.c: Update.
+ * remote.c, rs6000-tdep.c, s390-tdep.c, sh-tdep.c: Update.
+ * sparc-tdep.c, v850-tdep.c, vax-tdep.c, x86-64-tdep.c: Update.
+ * xstormy16-tdep.c, z8k-tdep.c, config/nm-gnu.h: Update.
+ * config/nm-m3.h, config/h8500/tm-h8500.h: Update.
+ * config/i386/nm-ptx4.h, config/i386/nm-symmetry.h: Update.
+ * config/m32r/tm-m32r.h, config/m68k/nm-sun3.h: Update.
+ * config/m68k/tm-delta68.h, config/m68k/tm-linux.h: Update.
+ * config/mn10200/tm-mn10200.h, config/pa/tm-hppa64.h: Update.
+ * config/sparc/nm-nbsd.h, config/sparc/nm-sun4os4.h: Update.
+ * config/sparc/nm-sun4sol2.h, config/sparc/tm-sparclet.h: Update.
+
+2002-11-13 Jim Blandy <jimb@redhat.com>
+
+ * findvar.c (read_var_value): Doc fix.
+
+2002-11-13 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.c (struct regcache): Replace passthough_p with
+ readonly_p.
+ (regcache_xmalloc): Initialize readonly_p.
+ (build_regcache): Initialize readonly_p.
+ (regcache_save): New function.
+ (regcache_restore): New function.
+ (regcache_cpy): Re-implement using regcache_save and
+ regcache_restore.
+ (regcache_raw_read): Update.
+ (regcache_cooked_read): When a read-only cache, checked for cached
+ pseudo register values.
+ (regcache_raw_write): Assert that the cache is not read-only.
+ Remove code handling a non-passthrough cache.
+ * regcache.h (regcache_save): Declare.
+ (regcache_restore): Declare.
+
+2002-11-13 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.c (struct regcache_descr): Add fields
+ sizeof_cooked_registers and sizeof_cooked_register_valid_p.
+ (init_legacy_regcache_descr): Compute the size of a cooked
+ register cache and then assign that to sizeof_raw_registers. Set
+ sizeof_raw_register_valid_p to sizeof_cooked_register_valid_p
+ (init_legacy_regcache_descr): Ditto.
+
+2002-11-13 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.c (register_buffer): Move to near start of file, update
+ description.
+ (regcache_raw_read): Use.
+ (regcache_raw_write): Use.
+ (struct regcache): Rename raw_registers to registers and
+ raw_register_valid_p to register_valid_p.
+ (regcache_xmalloc): Update.
+ (regcache_xfree): Update.
+ (register_buffer): Update.
+ (regcache_cpy): Update.
+ (regcache_cpy_no_passthrough): Update.
+ (regcache_valid_p): Update.
+ (deprecated_grub_regcache_for_registers): Update.
+ (deprecated_grub_regcache_for_register_valid): Update.
+ (set_register_cached): Update.
+ (regcache_raw_write): Update.
+
+2002-11-13 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * p-exp.y (name_not_typename): Use copy_name to
+ set current_type variable for fields of THIS.
+
+2002-11-12 Daniel Jacobowitz <drow@mvista.com>
+
+ * gnu-nat.c (init_gnu_ops): Remove NULL initializations.
+ * monitor.c (init_base_monitor_ops): Likewise.
+ * ppc-bdm.c (init_bdm_ppc_ops): Likewise.
+ * remote-array.c (init_array_ops): Likewise.
+ * remote-e7000.c (init_e7000_ops): Likewise.
+ * remote-es.c (init_es1800_ops): Likewise.
+ (init_es1800_child_ops): Likewise.
+ * remote-rdp.c (init_remote_rdp_ops): Likewise.
+ * remote-sim.c (init_gdbsim_ops): Likewise.
+ * remote-st.c (init_st2000_ops): Likewise.
+ * sol-thread.c (init_sol_core_ops): Likewise.
+ (init_sol_thread_ops): Likewise.
+ * v850ice.c (init_850ice_ops): Likewise.
+ * win32-nat.c (init_child_ops): Likewise.
+ * wince.c (init_child_ops): Likewise.
+
+2002-11-12 Andrew Cagney <ac131313@redhat.com>
+
+ * utils.c (gdb_realpath): Make rp a constant pointer.
+
+2002-11-12 Andrew Cagney <ac131313@redhat.com>
+
+ * utils.c (gdb_realpath): Rewrite. Try, in order: realpath() with
+ a constant buffer; cannonicalize_file_name(); realpath() with a
+ pathconf() defined buffer, xstrdup().
+
+2002-11-12 Andrew Cagney <ac131313@redhat.com>
+
+ * config/djgpp/fnchange.lst: Fix typo, hang1.c to hang1.C; hang2.c
+ to hang2.C; hang3.c to hang3.C.
+
+2002-11-11 Elena Zannoni <ezannoni@redhat.com>
+
+ * findvar.c (read_var_value): Reenable TLS code.
+
+2002-11-11 Elena Zannoni <ezannoni@redhat.com>
+ Jim Blandy <jimb@redhat.com>
+
+ * gdb_thread_db.h (enum): Add TD_NOTALLOC.
+ * target.c (update_current_target): Add
+ to_get_thread_local_address.
+ * target.h (to_get_thread_local_address): Export.
+ (target_get_thread_local_address): Define.
+ (target_get_thread_local_address_p): Define.
+ * thread-db.c: Include solib-svr4.h.
+ (td_thr_tls_get_addr_p): Define.
+ (thread_db_load): Get a pointer to td_thr_tls_get_addr.
+ (thread_db_get_thread_local_address): New function.
+ (init_thread_db_ops): Initialize to_get_thread_local_address.
+ * configure.in: Add test for TD_NOTALLOC in thread_db.h.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+
+2002-11-11 David Carlton <carlton@math.stanford.edu>
+
+ * linespec.c (set_flags): New function.
+ (decode_line_1): Move code into set_flags.
+
+2002-11-11 David Carlton <carlton@math.stanford.edu>
+
+ * linespec.c (decode_line_1): Move chunks of code to separate
+ functions.
+ (initialize_defaults): New function.
+ (decode_indirect): New function.
+
+2002-11-11 Andrew Cagney <ac131313@redhat.com>
+
+ * blockframe.c (sigtramp_saved_pc): Fix tipo. void_func_ptr
+ instead of void_code_ptr.
+ (sigtramp_saved_pc): Ditto.
+
+ * x86-64-tdep.c (i386_fp_regnum_p): Copy i386-tdep.c's
+ i386_fp_regnum_p.
+
+2002-11-10 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbtypes.h (struct main_type): Move artificial flag out of
+ loc. New member of ``struct field'' named static_kind. Reduce
+ overloaded meaning of bitsize.
+ (FIELD_ARTIFICIAL, SET_FIELD_PHYSNAME, SET_FIELD_PHYSADDR)
+ (TYPE_FIELD_STATIC, TYPE_FIELD_STATIC_HAS_ADDR): Likewise.
+ (FIELD_STATIC_KIND, TYPE_FIELD_STATIC_KIND): New macros.
+
+ * ada-lang.c (fill_in_ada_prototype): Initialize static_kind for
+ new fields.
+ (template_to_fixed_record_type, template_to_static_fixed_type)
+ (to_record_with_fixed_variant_part): Likewise.
+ * coffread.c (coff_read_struct_type, coff_read_enum_type): Likewise.
+ * dwarf2read.c (dwarf2_add_field, read_enumeration): Likewise.
+ * dwarfread.c (struct_type, enum_type): Likewise.
+ * hpread.c (hpread_read_enum_type)
+ (hpread_read_function_type, hpread_read_doc_function_type)
+ (hpread_read_struct_type): Likewise.
+ * mdebugread.c (parse_symbol): Likewise.
+
+2002-11-10 Andrew Cagney <ac131313@redhat.com>
+
+ * breakpoint.h (deprecated_frame_in_dummy): Rename frame_in_dummy.
+ * stack.c (print_frame_info_base): Update.
+ (print_frame_info_base, frame_info): Update.
+ * sparc-tdep.c (sparc_init_extra_frame_info): Update.
+ (sparc_frame_saved_pc): Update.
+ * ada-lang.c (find_printable_frame): Update.
+ * breakpoint.c (deprecated_frame_in_dummy): Update.
+
+2002-11-09 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-nat.c (ORIG_EAX): Define to -1 if not already
+ defined.
+ (regmap): Extend to cover all registers.
+ (PT_READ_U, PT_WRITE_U, PTRACE_XFER_TYPE,
+ OLD_CANNOT_FETCH_REGISTERS, OLD_CANNOT_STORE_REGISTERS): Remove
+ definitions.
+ (fetch_register, sore_register): Simplify.
+ (old_fetch_inferior_registers, old_store_inferior_registers):
+ Remove functions.
+ (cannot_fetch_register, cannot_store_register): Change
+ implementation to use regmap array to decide which registers
+ cannot be fetched/stored. This removes $orig_eax from the
+ registers that cannot be fetched/stored.
+ (fetch_inferior_registers): Call fetch_register directly instead
+ of calling old_fetch_inferior_registers.
+ (store_inferior_registers): Call store_register directly instead
+ of calling old_store_inferior_registers.
+ (i386_linux_dr_get): Replace PT_READ_U with PTRACE_PEEKUSER.
+ (i386_linux_dr_set): Replace PT_WRITE_U with PTRACE_POKEUSER.
+ * config/i386/nm-linux.h (U_REGS_OFFSET): Remove definition.
+
+2002-11-09 Klee Dienes <kdienes@apple.com>
+
+ * i387-tdep.c (i387_supply_register): When called with NULL as a
+ buffer, mark the register as not provided (to mirror the behavior
+ of supply_register).
+ (i387_supply_fxsave): Ditto.
+ (i387_supply_fsave): Ditto (inherits the behavior from
+ i387_supply_register).
+
+2002-11-09 Klee Dienes <kdienes@apple.com>
+
+ * blockframe.c (sigtramp_saved_pc): Use
+ builtin_type_void_code_ptr, not builtin_type_void_data_ptr (we are
+ extracting the PC). Use TYPE_LENGTH (builtin_type_void_code_ptr)
+ instead of (TARGET_PTR_BIT / TARGET_CHAR_BIT).
+
+2002-11-09 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.c (get_prev_frame): Test prev_p to identify a previously
+ unwound frame. Initialize prev_p.
+ * frame.h (struct frame_info): Add field prev_p. Expand prev/next
+ comment.
+
+2002-11-09 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.c (get_prev_frame): Cleanups. Eliminate redundant tests
+ for a NULL NEXT_FRAME. Simplify fromleaf initialization. Add
+ more comments. Zap dead code.
+
+2002-11-09 Mark Kettenis <kettenis@gnu.org>
+
+ * infcmd.c (print_vector_info, print_float_info): Move code that
+ checks whether the target has any registers and whether there is a
+ selected frame up, such that it is also used if a target provides
+ multi-arch definitions of these functions.
+
+2002-11-08 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (DESTDIR): Define.
+ (install-only, install-gdbtk, uninstall-gdbtk): Add $(DESTDIR)
+ prefix.
+
+ * config/djgpp/fnchange.lst: 8.3 proof i386obsd-nat.c and
+ i386obsd-tdep.c. Rename to "gdb.cxx", paths containing "gdb.c++".
+
+2002-11-08 Andrew Cagney <ac131313@redhat.com>
+
+ * i386-linux-tdep.c: Include "reggroups.h".
+ (i386_linux_register_reggroup_p): New function.
+ (i386_linux_init_abi): Set register_reggroup_p to
+ i386_linux_register_reggroup_p.
+ * i386-tdep.h (i386_register_reggroup_p): Declare.
+ * i386-tdep.c: Include "reggroups.h".
+ (i386_init_reggroups): New function.
+ (i386_add_reggroups): New function.
+ (i386_register_reggroup_p): New function.
+ (i386_sse_reggroup, i386_mmx_reggroup): New variables.
+ (_initialize_i386_tdep): Call i386_init_reggroups.
+ (i386_gdbarch_init): Set register_reggroup_p and add in the i386
+ specific reggroups.
+
+2002-11-09 Mark Kettenis <kettenis@gnu.org>
+
+ * infptrace.c (child_xfer_memory): Make use of the new PT_IO
+ request that's available in *BSD.
+
+ * i386-tdep.h (IS_FPU_CTRL_REGNUM): Remove.
+
+ * i387-tdep.c (i387_fill_fxsave): Use FOOFF_REGNUM instead of
+ FDOFF_REGNUM.
+
+2002-11-08 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.c (set_unwind_by_pc): Use dummy_frame_register_unwind.
+ * dummy-frame.c (find_dummy_frame): Rename
+ generic_find_dummy_frame, make static. Return the dummy frame
+ instead of the regcache.
+ (generic_find_dummy_frame): Re-implement using find_dummy_frame,
+ (cached_find_dummy_frame): New function. Use find_dummy_frame.
+ (dummy_frame_register_unwind): Rename
+ generic_call_dummy_register_unwind. Use cached_find_dummy_frame.
+ * dummy-frame.h (dummy_frame_register_unwind): Rename
+ generic_call_dummy_register_unwind.
+
+2002-11-08 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386v42mp.h: Remove file. Move its contents,
+ except the inclusion of "i386/tm-i386.h", to...
+ * config/i386/nm-i386v42mp.h: ...here.
+ * config/i386/i386v42mp.mt (TM_FILE): Set to tm-i386.h.
+
+2002-11-08 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (frame.o): Update dependencies.
+ * blockframe.c (current_frame, frame_obstack_alloc)
+ (frame_saved_regs_zalloc, get_current_frame)
+ (set_current_frame, create_new_frame)
+ (set_unwind_by_pc, get_next_frame)
+ (flush_cached_frames, reinit_frame_cache)
+ (frame_saved_regs_register_unwind)
+ (deprecated_generic_get_saved_register)
+ (get_prev_frame, get_frame_pc, get_frame_saved_regs)
+ (_initialize_blockframe): Move frame code from here...
+ * frame.c: ...to here. Include "gdb_obstack.h", "gdbcore.h",
+ "annotate.h" and "dummy-frame.h".
+ (_initialize_frame): New function.
+
+2002-11-08 Jim Blandy <jimb@redhat.com>
+
+ * dwarf2read.c (read_func_scope): Restore list_in_scope properly
+ when we finish a function a context.
+ * buildsym.h (outermost_context_p): New macro.
+ (Bug analyzed by David Edelsohn.)
+
+2002-11-08 Andrew Cagney <ac131313@redhat.com>
+
+ * blockframe.c: Include "dummy-frame.h".
+ (struct dummy_frame, dummy_frame_stack)
+ (generic_find_dummy_frame, deprecated_generic_find_dummy_frame)
+ (generic_pc_in_call_dummy, deprecated_read_register_dummy)
+ (generic_push_dummy_frame, generic_save_dummy_frame_tos)
+ (generic_save_call_dummy_addr, generic_pop_current_frame)
+ (generic_pop_dummy_frame, generic_fix_call_dummy)
+ (generic_fix_call_dummy, generic_call_dummy_register_unwind): Move
+ dummy frame code from here...
+ * dummy-frame.c: ...to here. New file.
+ * dummy-frame.h: New file.
+ (generic_call_dummy_register_unwind): Declare.
+ (generic_find_dummy_frame): Declare.
+ * Makefile.in (SFILES): Add dummy-frame.c.
+ (dummy-frame.o): Specify dependencies.
+ (dummy_frame_h): Define.
+ (COMMON_OBS): Add dummy-frame.o.
+ (blockframe.o): Update dependencies.
+
+2002-11-08 Jim Blandy <jimb@redhat.com>
+
+ * dwarf2read.c (read_func_scope): Restore local_symbols and
+ param_symbols after we finish the function context. (Based on a
+ patch from David Edelsohn.)
+
+2002-11-08 David Carlton <carlton@math.stanford.edu>
+
+ * linespec.c (symbol_found): New function.
+ (minsym_found): New function.
+ (decode_line_1): Separate out some code into separate functions.
+
+2002-11-08 Joel Brobecker <brobecker@gnat.com>
+
+ * i386-tdep.c (i386_frameless_signal_p): Make non static for
+ the benefit of the interix target.
+ * i386-tdep.h (i386_frameless_signal_p): Declare.
+
+2002-11-08 Andrew Cagney <ac131313@redhat.com>
+
+ * i386-tdep.h (i386_linux_orig_eax_regnum_p): Delete stray
+ declaration that snuck in from change below.
+
+2002-11-06 Andrew Cagney <cagney@redhat.com>
+
+ * i386-tdep.c (i386_mmx_regnum_p): Rename mmx_regnum_p. Update
+ all callers.
+ (i386_fp_regnum_p): New function. Use instead of FP_REGNUM_P.
+ (i386_fpc_regnum_p): New function. Use instead of FPC_REGNUM_P.
+ (i386_sse_regnum_p): New function. Use instead of SSE_REGNUM_P.
+ (i386_mxcsr_regnum_p): new function. Use instead of
+ MXCSR_REGNUM_P.
+ * i386-tdep.h (SSE_REGNUM_P): Delete macro.
+ (i386_sse_regnum_p): Declare.
+ (i386_mxcsr_regnum_p): Declare.
+ (FP_REGNUM_P, FPC_REGNUM_P): Delete macros.
+ (i386_fp_regnum_p, i386_fpc_regnum_p): Declare.
+ (IS_FP_REGNUM): Update definition.
+ (IS_FPU_CTRL_REGNUM): Update definition..
+ (IS_SSE_REGNUM): Update definition..
+ * i386v-nat.c (register_u_addr): Update.
+ * go32-nat.c (fetch_register): Update.
+ (store_register): Update.
+
+2002-11-07 Joel Brobecker <brobecker@gnat.com>
+
+ Preparation work to convert the hppa targets to multiarch partial.
+
+ * hppa-tdep.c: Add new functions replacing macro bodies from
+ config/pa/tm-hppa.h. These function will be used to initialize
+ the gdbarch structure. Import some comments from tm-hppa.h,
+ and place them where appropriate, to avoid loosing them when
+ we cleanup this file.
+ (hppa_reg_struct_has_addr): New function.
+ (hppa_inner_than): New function.
+ (hppa_stack_align): New function.
+ (hppa_pc_requires_run_before_use): New function.
+ (hppa_instruction_nullified): New function.
+ (hppa_register_byte): New function.
+ (hppa_register_virtual_type): New function.
+ (hppa_store_struct_return): New function.
+ (hppa_cannot_store_register): New function.
+ (hppa_frame_args_address): New function.
+ (hppa_frame_locals_address): New function.
+ (hppa_smash_text_address): New function.
+ (hppa_coerce_float_to_double): New function. Requires the inclusion
+ of "language.h".
+
+ * Makefile.in (hppa-tdep.o): Add dependency on language.h.
+
+ * tm-hppa.h (REG_STRUCT_HAS_ADDR): Change the definition of this
+ gdbarch-eligible macro to a call to the new associated function
+ created in hppa-tdep.c.
+ (INNER_THAN): Likewise.
+ (STACK_ALIGN): Likewise.
+ (PC_REQUIRES_RUN_BEFORE_USE): Likewise.
+ (INSTRUCTION_NULLIFIED): Likewise.
+ (REGISTER_BYTE): Likewise.
+ (REGISTER_VIRTUAL_TYPE): Likewise.
+ (STORE_STRUCT_RETURN): Likewise.
+ (CANNOT_STORE_REGISTER): Likewise.
+ (FRAME_ARGS_ADDRESS): Likewise.
+ (FRAME_LOCALS_ADDRESS): Likewise.
+ (SMASH_TEXT_ADDRESS): Likewise.
+ (COERCE_FLOAT_TO_DOUBLE): Likewise.
+ (ABOUT_TO_RETURN): Delete, as no longer used.
+
+2002-11-07 Fernando Nasser <fnasser@redhat.com>
+
+ * printcmd.c (disassemble_command): Remove obsolete function.
+ (_initialize_printcmd): Do not create disassemble command here.
+ * cli/cli-cmds.c (disassemble_command): New function. Implements
+ disassemble command.
+ (init_cli_cmds): Create disassemble command here instead.
+
+2002-11-07 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Add Daniel Jacobowitz to global maintainers list.
+
+2002-11-07 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.h (regcache_cooked_read_using_offset_hack)
+ (regcache_cooked_write_using_offset_hack): Delete declarations.
+ (register_changed): Delete declaration.
+ * regcache.c (regcache_cooked_read_using_offset_hack)
+ (regcache_cooked_write_using_offset_hack): Delete functions.
+ (cooked_xfer_using_offset_hack): Delete function.
+ (register_changed): Delete function.
+
+2002-11-07 Jim Blandy <jimb@redhat.com>
+
+ * macroscope.c: #include "complaints.h".
+ (sal_macro_scope): Cope with filenames that appear in the symtabs,
+ but not in the macro table.
+ * Makefile.in (macroscope.o): Record dependency.
+
+2002-11-07 Joel Brobecker <brobecker@gnat.com>
+
+ * PROBLEMS: Document gdb/816 (unable to read core file on alpha-osf).
+
+2002-11-07 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.c (deprecated_registers_fetched): Update.
+ * regcache.h (deprecated_registers_fetched): Rename
+ registers_fetched.
+ * remote-vxsparc.c (vx_read_register): Update.
+ * remote-vxmips.c (vx_read_register): Update.
+ * remote-vx68.c (vx_read_register): Update.
+ * irix5-nat.c (fetch_core_registers): Update.
+ * mipsm3-nat.c (fetch_inferior_registers): Update.
+ * sun3-nat.c (fetch_inferior_registers): Update.
+ * symm-nat.c (fetch_inferior_registers): Update.
+ * ns32knbsd-nat.c (fetch_inferior_registers): Update.
+ (fetch_core_registers): Update.
+ (fetch_kcore_registers): Update.
+ * mips-nat.c (fetch_inferior_registers): Update.
+ * corelow.c (get_core_registers): Update.
+ * a68v-nat.c (fetch_inferior_registers): Update.
+
+2002-11-06 Joel Brobecker <brobecker@gnat.com>
+
+ Put in place the framework necessary for multiarching the hppa targets.
+ * hppa-tdep.c (hppa_gdbarch_init): New function.
+ (hppa_dump_tdep): New function.
+ (_initialize_hppa_tdep): Register the hppa gdbarch init function and
+ tdep structure dumper.
+ * config/pa/tm-hppa.h (GDB_MULTI_ARCH): New macro, defined to 0
+ until the multi-arching conversion has partially been completed.
+
+2002-11-06 Andrew Cagney <ac131313@redhat.com>
+
+ * valops.c (value_assign): Merge lval_register case into
+ lval_reg_frame_relative. Use frame_register and
+ regcache_cooked_write instead of get_saved_register and
+ write_register_bytes. After flushing the register cache, try to
+ re-select the selected frame.
+
+2002-11-06 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.h (deprecated_register_valid): Rename register_valid.
+ * regcache.c: Update.
+ * ia64-aix-nat.c: Update.
+ * i386gnu-nat.c: Update.
+ * alpha-nat.c: Update.
+ * sparc-nat.c: Update.
+ * lynx-nat.c: Update.
+ * remote-mips.c: Update.
+
+2002-11-06 Joel Brobecker <brobecker@gnat.com>
+
+ * hppa-tdep.c (_initialize_hppa_tdep): Move function body
+ to end of file, to be more consistent with the pratice followed
+ by other targets.
+
+2002-11-06 Andrew Cagney <ac131313@redhat.com>
+
+ * infcmd.c: Include "reggroups.h" and <ctype.h>.
+ (print_float_info): Print registers in float_reggroup.
+ (print_vector_info): Print registers in vector_reggroup.
+ (default_print_registers_info): When all, print registers in
+ all_reggroup. Otherwize, print registers in general_reggroup.
+ (registers_info): Rewrite. Add support for register groups.
+ Eliminate a goto.
+
+2002-11-06 Elena Zannoni <ezannoni@redhat.com>
+
+ * symtab.c (methods_info): Delete. It has been ifdeffed out for
+ ages.
+ (symtab_symbol_info): Remove eons old ifdeffed out code.
+ (_initialize_symtab): Remove prehistoric disabled 'info methods'
+ command.
+
+2002-11-06 Theodore A. Roth <troth@openavr.org>
+
+ * c-exp.y: Add missing semi-colons.
+ * f-exp.y: Add missing semi-colons.
+ * m2-exp.y: Add missing semi-colons.
+ * p-exp.y: Add missing semi-colons.
+ Add empty action to start rule to avoid a type clash error when
+ building with bison >= 1.50.
+
+2002-11-06 Jim Blandy <jimb@redhat.com>
+
+ * macrotab.h (struct macro_source_file): Doc fix.
+
+2002-11-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * varobj.c (child_exists, cplus_number_of_children): Change
+ STREQ macro references to strcmp.
+ (cplus_name_of_child): Change code to handle the fact that
+ fields are not necessarily contiguous with regards to their
+ access control. This is a fix for PR gdb/792.
+
+2002-11-05 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (GET_SAVED_REGISTER): Change to a predicate function.
+ * gdbarch.h, gdbarch.c: Regnerate.
+ * frame.h (frame_register): Declare.
+ * frame.c (frame_register): New function.
+ (get_saved_register): Test GET_SAVED_REGISTER_P before calling
+ GET_SAVED_REGISTER, otherwize call
+ generic_unwind_get_saved_register.
+ (frame_register_read): Use frame_register instead of
+ get_saved_register.
+
+2002-11-05 Elena Zannoni <ezannoni@redhat.com>
+
+ From Jim Ingham <jingham@apple.com>:
+ * event-top.c (gdb_disable_readline): New function.
+ (_initialize_event_loop): Move comment.
+
+2002-11-05 Elena Zannoni <ezannoni@redhat.com>
+
+ * event-loop.c (start_event_loop): Add comment.
+ Update copyright.
+
+2002-11-05 Andrew Cagney <ac131313@redhat.com>
+
+ * infcmd.c (default_print_registers_info): Do not call
+ PRINT_REGISTER_HOOK.
+
+2002-11-05 Andrew Cagney <ac131313@redhat.com>
+
+ * sparc-tdep.c (sparc_print_register_hook): Make static.
+ (sparc_print_registers_info): New function.
+ (sparc_do_registers_info): New function.
+ (sparclet_print_registers_info): New function.
+ (sparclet_do_registers_info): New function.
+ (do_sparc_print_registers_info): New function.
+ (sparc_print_registers): New static function, clone of infcmd.c's
+ default_print_registers_info.
+ * config/sparc/tm-sparclet.h (PRINT_REGISTER_HOOK): Delete macro.
+ (sparclet_do_registers_info): Declare.
+ (DEPRECATED_DO_REGISTERS_INFO): Re-define.
+ * config/sparc/tm-sparc.h (DEPRECATED_DO_REGISTERS_INFO):
+ Re-define.
+ (sparc_do_registers_info): Declare.
+ (PRINT_REGISTER_HOOK): Delete macro.
+ (sparc_print_register_hook): Delete declaration.
+
+2002-11-05 David Carlton <carlton@math.stanford.edu>
+
+ * symtab.c (lookup_symbol_aux): Move chunks of code into separate
+ functions.
+ (lookup_symbol_aux_local): New function.
+ (lookup_symbol_aux_symtabs): New function.
+ (lookup_symbol_aux_psymtabs): New function.
+
+2002-11-05 David Carlton <carlton@math.stanford.edu>
+
+ * symtab.c (lookup_symbol_aux): In minsym sections, don't use the
+ previous values of 'objfile' and 'block'.
+
+2002-11-05 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * values.c (value_change_enclosing_type): Set
+ enclosing_type field correctly also for the case where
+ more memory needs to be allocated.
+
+2002-11-03 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-tdep.c (i387_print_float_info): Call fputs_filtered instead
+ of puts_filtered.
+
+ * i387-tdep.c (i387_print_float_info): Replace calls to
+ register_read and deprecated_read_register_gen with calls to
+ frame_register_read, and make the necessary adjustments to the
+ surrounding code.
+
+2002-11-02 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (register_reggroup_p): Allow default value.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+2002-11-02 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.h: Add coment indicating replacements for deprecated
+ functions.
+
+2002-11-02 Andrew Cagney <cagney@redhat.com>
+
+ * reggroups.h, reggroups.c: New files.
+ * regcache.c: Include "reggroups.h".
+ (enum regcache_dump_what): Add `regcache_dump_groups'.
+ (regcache_dump): Contract size of the "Type" column. When
+ specified, dump the register's groups.
+ (maintenance_print_register_groups): New function.
+ (_initialize_regcache): Add command `maint print register-groups'.
+ * Makefile.in (COMMON_OBS): Add reggroups.o
+ (SFILES): Add reggroups.c.
+ (reggroups_h): Define.
+ (regcache.o, gdbarch.o): Update dependencies.
+ (reggroups.o): Specify dependencies.
+ * gdbarch.sh (register_reggroup_p): Add pure multi-arch method.
+ Add opaque declaration for `struct reggroup' in generated .h file.
+ Include "reggroups.h" in generated .c file.
+ gdbarch.h, gdbarch.c: Re-generate.
+
+2002-11-02 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.h (deprecated_read_register_gen): Rename
+ read_register_gen.
+ (deprecated_write_register_gen): Rename write_register_gen.
+ * i387-tdep.c: Update.
+ * x86-64-linux-nat.c: Update
+ * wince.c: Update.
+ * thread-db.c: Update.
+ * win32-nat.c: Update.
+ * mips-tdep.c: Update.
+ * d10v-tdep.c: Update.
+ * cris-tdep.c: Update.
+ * remote-sim.c: Update.
+ * remote-rdi.c: Update.
+ * remote-rdp.c: Update.
+ * frame.c: Update.
+ * target.c: Update.
+ * blockframe.c: Update.
+ * x86-64-tdep.c: Update.
+ * xstormy16-tdep.c: Update.
+ * sh-tdep.c: Update.
+ * s390-tdep.c: Update.
+ * rs6000-tdep.c: Update.
+ * sparc-tdep.c: Update.
+ * i386-tdep.c: Update.
+ * dwarf2cfi.c: Update.
+ * regcache.c: Update.
+
+2002-11-01 Joel Brobecker <brobecker@gnat.com>
+
+ New interix-specific files:
+ * config/i386/nm-interix.h: New file.
+ * config/i386/interix.mh: New file.
+ * config/i386/interix.mt: New file.
+ * i386-interix-nat.c: New file.
+ * i386-interix-tdep.c: New file.
+
+2002-11-01 Andrew Cagney <cagney@redhat.com>
+
+ * frame.h (deprecated_generic_get_saved_register): Rename
+ generic_get_saved_register.
+ * blockframe.c (deprecated_generic_get_saved_register): Update.
+ * xstormy16-tdep.c (xstormy16_get_saved_register): Update.
+ (xstormy16_frame_saved_register): Update.
+ * sh-tdep.c (sh_gdbarch_init): Update.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Update.
+ * ia64-tdep.c (ia64_get_saved_register): Update.
+ * cris-tdep.c (cris_gdbarch_init): Update.
+ * config/m32r/tm-m32r.h (GET_SAVED_REGISTER): Update.
+ * arm-tdep.c (arm_gdbarch_init): Update.
+
+2002-10-31 Daniel Jacobowitz <drow@mvista.com>
+
+ * lin-lwp.c (lin_lwp_resume): Remove resume_all test for !step.
+
+2002-10-31 Daniel Jacobowitz <drow@mvista.com>
+
+ * i386-linux-tdep.c (i386_linux_pc_in_sigtramp): Check for
+ trampolines in sigaction.
+
+2002-10-31 Andrew Cagney <cagney@redhat.com>
+
+ * h8300-tdep.c: Include "gdb_assert.h".
+ (h8300_print_register): Add gdbarch, file and frame parameters.
+ Use frame_read_unsigned_register to read the register's value.
+ Use fprintf_filtered to display output.
+ (h8300_print_registers_info): Replace h8300_do_registers_info.
+ (h8300_gdbarch_init): Set print_registers_info.
+
+2002-10-31 Andrew Cagney <cagney@redhat.com>
+
+ * frame.c (frame_read_unsigned_register): New function.
+ (frame_read_signed_register): New function.
+ * frame.h (frame_read_unsigned_register): Declare.
+ (frame_read_signed_register): Declare.
+
+2002-10-31 Andrew Cagney <cagney@redhat.com>
+
+ * h8500-tdep.c (h8500_print_registers_info): New static function,
+ clone of infcmd.c's default_print_registers_info.
+ (h8500_do_registers_info): New funtion.
+ (h8500_print_register_hook): Rename print_register_hook, make
+ static.
+
+ * config/h8500/tm-h8500.h: Update copyright.
+ (DEPRECATED_DO_REGISTERS_INFO): Define.
+ (h8500_do_registers_info: Declare.
+ (PRINT_REGISTER_HOOK): Delete macro.
+ (print_register_hook): Delete function.
+
+2002-10-31 Andrew Cagney <cagney@redhat.com>
+
+ * z8k-tdep.c (z8k_print_register_hook): Make static.
+ (z8k_print_registers_info): New static function, clone of
+ infcmd.c's default_print_registers_info.
+ (z8k_do_registers_info): New function. Wrap
+ z8k_print_registers_info.
+ * config/z8k/tm-z8k.h: Update copyright.
+ (PRINT_REGISTER_HOOK): Delete macro.
+ (z8k_print_register_hook): Delete declaration.
+ (DEPRECATED_DO_REGISTERS_INFO): Define.
+ (z8k_do_registers_info): Declare.
+
+2002-10-30 Joel Brobecker <brobecker@gnat.com>
+
+ * hppa-tdep.c (find_function_in_inferior): Remove this extern,
+ as this is already provided by value.h, and was actually causing
+ a compilation error because of a conflict in parameter type
+ declaration due to a missing const keyword.
+ (low_text_segment_addres): Fix a compilation warning.
+
+2002-10-29 Daniel Jacobowitz <drow@mvista.com>
+
+ * mips-linux-nat.c (mips_linux_cannot_fetch_register): Don't fetch
+ registers without a name.
+ (mips_linux_cannot_store_register): Don't store registers without
+ a name.
+
+2002-10-28 David Carlton <carlton@math.stanford.edu>
+
+ * symtab.c (find_addr_symbol): Delete. (It was already commented
+ out.)
+ * symtab.h: Delete prototype for find_addr_symbol.
+
+2002-10-26 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_DO_REGISTERS_INFO): Rename
+ DO_REGISTERS_INFO.
+ gdbarch.h, gdbarch.c: Re-generate.
+ * infcmd.c (default_print_registers_info): Update reference.
+ * mips-tdep.c (mips_gdbarch_init): Set deprecated_do_registers_info.
+ (mips_dump_tdep): Do not print DO_REGISTERS_INFO.
+ * sh-tdep.c (sh_gdbarch_init): Ditto.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
+ * h8300-tdep.c (h8300_gdbarch_init): Ditto.
+
+2002-10-26 Mark Kettenis <kettenis@gnu.org>
+
+ * x86-64-tdep.c (x86_64_init_abi): Set init_extra_frame_info to
+ cfi_init_extra_frame_info.
+ * x86-64-tdep.h (x86_64_init_extra_frame_info): Remove prototype.
+ * x86-64-linux-tdep.c (x86_64_init_extra_frame_info): Remove function.
+
+ * x86-64-tdep.c (x86_64_init_abi): Add calls to override the i386
+ target where necessary. Add more comments and remove the ones
+ that don't provide any useful information.
+
+ * i386-tdep.c (i386_frame_saved_pc): Replace call to
+ deprecated_read_register_dummy with
+ frame_unwind_unsigned_register.
+
+ * i386-tdep.c (i386_extract_struct_value_address): Use
+ regcache_raw_read_unsigned instead of
+ regcache_cooked_read_unsigned since we know that the register
+ we're reading isn't a pseudo register. Rename variable 'val' into
+ the more descriptive 'addr'.
+
+ * x86-64-tdep.c: Fix some formatting problems, mostly in comments.
+ (x86_64_push_return_address): Add comment.
+ (x86_64_pop_frame): Make static.
+ (examine_argument): Clarify comment.
+ (x86_64_skip_prologue): Make prolog_expact variable static.
+
+ * dwarf2cfi.c: Fix some formatting problems.
+ (context_cpy, read_encoded_pointer): Clarify comments.
+
+ * x86-64-tdep.c (x86_64_breakpoint_from_pc): Constify.
+ (x86_64_init_abi): Move set_gdbarch_* calls that overlap with the
+ i386 target back into x86_64_gdbarch_init. Add some comments and
+ remove meaningless ones.
+
+2002-10-25 Andrew Cagney <cagney@redhat.com>
+
+ * complaints.h (struct deprecated_complaint): Rename `struct
+ complaint'.
+ * complaints.c (complain): Update.
+ * remote-vx68.c, remote-vxmips.c, remote-vxsparc.c: Delete
+ incorrect comment indicating that "symfile.h" was being included
+ for the `struct complaint' definition.
+ * remote-vx.c: Update.
+ * objc-lang.c: Update.
+ * xcoffread.c: Update.
+ * hpread.c: Update.
+ * mdebugread.c: Update.
+ * stabsread.c: Update.
+ * dwarf2read.c: Update.
+ * dwarfread.c: Update.
+ * elfread.c: Update.
+ * coffread.c: Update.
+ * stabsread.h: Update.
+ * dbxread.c: Update.
+ * buildsym.c: Update.
+ * gdbtypes.c: Update.
+ * macrotab.c: Update.
+
+2002-10-25 Mark Kettenis <kettenis@gnu.org>
+
+ * x86-64-tdep.c (x86_64_gdbarch_init): Make a bit more similar to
+ the version in i386-tdep.c. Move set_gdbarch_* calls out into...
+ (x86_64_init_abi): ...new function.
+
+ * Makefile.in (i386v-nat.o): Add $(i386_tdep_h).
+ * i386v-nat.c: Include "i386-tdep.h".
+
+2002-10-25 Andrew Cagney <cagney@redhat.com>
+
+ * gdbtypes.c (address_space_name_to_int): Update.
+ (address_space_int_to_name): Update.
+ * gdbarch.sh (address_class_type_flags_to_name): Change to a pure
+ multi-arch predicate.
+ (address_class_name_to_type_flags): Ditto.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+ * MAINTAINERS: Check all warnings when h8300hms and alpha-elf.
+
+2002-10-24 Martin M. Hunt <hunt@redhat.com>
+
+ * utils.c (string_to_core_addr): Revert patch from 11 Oct.
+
+2002-10-24 Elena Zannoni <ezannoni@redhat.com>
+
+ * symtab.h (INIT_SAL): Delete macro.
+ (init_sal): Export.
+ * symtab.c (init_sal): New function.
+
+ * ada-lang.c (ada_finish_decode_line_1): Change INIT_SAL macro
+ to init_sal function call.
+ (find_sal_from_funcs_and_line): Ditto.
+ (all_sals_for_line): Ditto.
+ * breakpoint.c (create_internal_breakpoint): Ditto.
+ (create_fork_vfork_event_catchpoint): Ditto.
+ (create_exec_event_catchpoint): Ditto.
+ (parse_breakpoint_sals): Ditto.
+ (watch_command_1): Ditto.
+ (handle_gnu_4_16_catch_command): Ditto.
+ (clear_command): Ditto.
+ * hppa-tdep.c (child_enable_exception_callback): Ditto.
+ * infcmd.c (run_stack_dummy): Ditto.
+ * infrun.c (process_event_stop_test): Ditto.
+ (check_sigtramp2): Ditto.
+ (step_over_function): Ditto.
+ * linespec.c (decode_line_2): Ditto.
+ (decode_line_1): Ditto.
+ * source.c (line_info): Ditto.
+ * symtab.c (find_pc_sect_line): Ditto.
+
+2002-10-24 Michal Ludvig <mludvig@suse.cz>
+
+ * dwarf2cfi.c (struct context)
+ (struct context_reg): Moved to dwarf2cfi.h
+ (context_alloc, frame_state_alloc, context_cpy):
+ Made extern instead of static, removed prototypes.
+ * dwarf2cfi.h (struct context)
+ (struct context_reg): New, moved from dwarf2cfi.c
+ (context_alloc, frame_state_alloc, context_cpy):
+ New prototypes.
+ * x86-64-linux-tdep.c (x86_64_linux_sigtramp_saved_pc):
+ Changed from static to extern.
+ (LINUX_SIGINFO_SIZE, LINUX_SIGCONTEXT_PC_OFFSET)
+ (LINUX_SIGCONTEXT_FP_OFFSET)
+ (LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Adjusted.
+ (x86_64_linux_in_sigtramp, x86_64_linux_frame_chain)
+ (x86_64_init_frame_pc, x86_64_init_extra_frame_info): New.
+ * x86-64-tdep.c (x86_64_gdbarch_init): Several
+ set_gdbarch_*() calls now use x86-64 specific functions
+ instead of DWARF2 CFI ones.
+ * x86-64-tdep.h (x86_64_linux_in_sigtramp)
+ (x86_64_linux_frame_chain, x86_64_init_frame_pc)
+ (x86_64_init_extra_frame_info): New prototypes.
+
+2002-10-23 David Carlton <carlton@math.stanford.edu>
+
+ * linespec.c: #include "parser-defs.h".
+ Delete prototype for find_template_name_end.
+ * Makefile.in (linespec.o): Depend on $(parser_defs_h).
+
+2002-10-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * NEWS: add recent mi fixes.
+ * varobj.c (struct varobj): Add new "updated" flag.
+ (new_variable): Default "updated" flag to 0.
+ (varobj_set_value): Set "updated" flag to 1 if value
+ changes.
+ (varobj_update): Check varobj "updated" flag before
+ comparing old and refreshed values. Fix for
+ PR gdb/702.
+
+2002-10-23 David Carlton <carlton@math.stanford.edu>
+
+ * parse.c (parse_exp_1): Use BLOCK_START.
+ * x86-64-tdep.c (x86_64_skip_prologue): Use BLOCK_END,
+ SYMBOL_BLOCK_VALUE.
+ * objc-lang.c (find_methods): Use BLOCK_START, BLOCK_END.
+
+2002-10-23 David Carlton <carlton@math.stanford.edu>
+
+ * symtab.c: Delete cplusplus_hint.
+ Delete prototype for find_template_name_end.
+
+2002-10-23 Elena Zannoni <ezannoni@redhat.com>
+
+ * symtab.h: Update comment.
+
+2002-10-23 Michael Snyder <msnyder@redhat.com>
+
+ * printcmd.c (address_info): Restore quotes in output.
+ * valops.c (value_of_local): Restore quotes in error message.
+
+2002-10-23 Elena Zannoni <ezannoni@redhat.com>
+
+ * symtab.c (symbol_demangled_name): New function.
+ * symtab.h (SYMBOL_DEMANGLED_NAME): Simplify macro, by
+ turning most of it into a function.
+ (symbol_demangled_name): Export.
+
+2002-10-23 Michael Snyder <msnyder@redhat.com>
+
+ * valops.c (value_of_local): Restore quotes in error message.
+
+2002-10-23 Elena Zannoni <ezannoni@redhat.com>
+
+ * symtab.c (symbol_init_language_specific): New function.
+ * symtab.h (SYMBOL_INIT_LANGUAGE_SPECIFIC): Simplify macro, by
+ turning most of it into a function.
+ (symbol_init_language_specific): Export.
+
+2002-10-23 David Carlton <carlton@math.stanford.edu>
+
+ * dwarf2read.c (dwarf_tag_name): Add DWARF 3 names.
+ (dwarf_attr_name): Ditto.
+ (dwarf_type_encoding_name): Ditto.
+ (scan_partial_symbols): Descend into DW_TAG_namespace entries.
+ (process_die): Handle DW_TAG_namespace,
+ DW_TAG_imported_declaration, DW_TAG_imported_module.
+ (read_namespace): New function.
+
+2002-10-22 Joel Brobecker <brobecker@gnat.com>
+
+ * configure.in: Define NEW_PROC_API on Interix too.
+ * configure: Regenerate.
+
+2002-10-21 Joel Brobecker <brobecker@gnat.com>
+
+ * configure: Regenerate using the proper version of autoconf.
+
+2002-10-21 Elena Zannoni <ezannoni@redhat.com>
+
+ * findvar.c (read_var_value): Temporarily disable TLS code, until
+ complete TLS support is added.
+
+2002-10-21 Jim Blandy <jimb@redhat.com>
+ Elena Zannoni <ezannoni@redhat.com>
+
+ * symtab.h (address_class): Re-add LOC_THREAD_LOCAL_STATIC
+ for thread local storage locations.
+ (struct symbol): Add objfile field.
+ (SYMBOL_OBJFILE): Define.
+ * dwarf2read.c (is_thread_local): New static variable.
+ (new_symbol): If variable is in thread local fill in address class
+ and objfile appropriately.
+ (decode_locdesc): Recognize and handle DW_OP_GNU_push_tls_address
+ stack operation.
+ * printcmd.c (address_info): Print the information for thread
+ local storage variable.
+ * findvar.c (read_var_value): In case of thread local variable,
+ defer to the target vector code to compute address.
+
+2002-10-21 Elena Zannoni <ezannoni@redhat.com>
+
+ * solib-svr4.c (svr4_fetch_objfile_link_map): New function.
+ * solib-svr4.h (svr4_fetch_objfile_link_map): Export.
+
+2002-10-21 Elena Zannoni <ezannoni@redhat.com>
+
+ * symtab.h (address_class): Rename
+ LOC_THREAD_LOCAL_STATIC to LOC_HP_THREAD_LOCAL_STATIC.
+ * hpread.c (hpread_process_one_debug_symbol): Ditto.
+ * printcmd.c (address_info): Ditto.
+ * findvar.c (symbol_read_needs_frame, read_var_value): Ditto.
+
+2002-10-20 Mark Kettenis <kettenis@gnu.org>
+
+ * i386bsd-nat.c (i386bsd_dr_set, i386bsd_dr_get_status): Use
+ DBREG_DRX macro to acces debug registers.
+
+ * Makefile.in (i386obsd-tdep.o): New target.
+
+ * solib-sunos.c: Include "bcache.h" and "regcache.h".
+ * Makefile.in (solib-sunos.o): Add $(bcache_h) and $(regcache_h).
+
+ * configure.tgt (i[3456]86-*-openbsd*): Set gdb_target to obds.
+ * config/i386/obsd.mt: New file.
+ * i386bsd-nat.c (_initialize_i386bsd_nat): Introduce
+ i386obsd_sc_pc_offset and i386obsd_sc_sp_offset;
+ * i386obsd-nat.c (_initialize_i386obsd_nat): Set
+ i386obsd_sigtramp_start and i386obsd_sigtramp_end instead of
+ i386nbsd_sigtramp_start and i386nbsd_sigtramp_end.
+ * i386obsd-tdep.c: New file.
+
+2002-10-19 Adam Fedor <fedor@gnu.org>
+
+ * objc-exp.y (name_not_typename): Fix invalid comment.
+
+2002-10-20 Mark Kettenis <kettenis@gnu.org>
+
+ * solib-sunos.c (allocate_rt_common_objfile): Use bcache_xmalloc
+ to allocate partial syms and macro byte caches.
+
+2002-10-18 David Carlton <carlton@math.stanford.edu>
+
+ * symtab.h: Delete 'struct source' and 'struct sourcevector'.
+
+2002-10-18 Adam Fedor <fedor@gnu.org>
+
+ * stabsread.c (find_name_end): New function.
+ (define_symbol): Use it.
+
+2002-10-18 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/alpha/nm-fbsd.h (CANNOT_STEP_BREAKPOINT): Define to 1.
+ * config/alpha/nm-linux.h (CANNOT_STEP_BREAKPOINT): Define to 1.
+ * config/alpha/nm-nbsd.h (CANNOT_STEP_BREAKPOINT): Define to 1.
+ * config/alpha/nm-osf.h (CANNOT_STEP_BREAKPOINT): Define to 1.
+
+2002-10-17 David Carlton <carlton@math.stanford.edu>
+
+ * symfile.h: Add opaque declaration for struct obstack.
+ Declare obsavestring to take a const char *.
+ * symfile.c (obsavestring): Make first argument a const char *.
+
+2002-10-16 Adam Fedor <fedor@gnu.org>
+
+ * breakpoint.c (parse_breakpoint_sals): Ignore ObjC method
+ names when matching breakpoints in current file.
+
+2002-10-16 Kevin Buettner <kevinb@redhat.com>
+
+ * dwarf2read.c (dwarf2_invalid_pointer_size): New complaint.
+ (read_tag_pointer_type): Add address class support.
+ * gdbarch.sh (ADDRESS_CLASS_TYPE_FLAGS)
+ (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME, ADDRESS_CLASS_NAME_TO_TYPE_FLAGS):
+ New methods.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * gdbtypes.c (address_space_name_to_int, address_space_int_to_name)
+ (make_type_with_address_space, recursive_type_dump): Add address
+ class support.
+ * gdbtypes.h (TYPE_FLAG_ADDRESS_CLASS_1, TYPE_FLAG_ADDRESS_CLASS_2)
+ (TYPE_FLAG_ADDRESS_CLASS_ALL, TYPE_ADDRESS_CLASS_1)
+ (TYPE_ADDRESS_CLASS_2, TYPE_ADDRESS_CLASS_ALL): New defines
+
+2002-10-16 Klee Dienes <kdienes@apple.com>
+
+ * stabsread.c (read_tilde_fields): Use name[sizeof(vptr_name)-2]
+ to get the last character of a char[] buffer, not
+ name[sizeof(vptr_name)-1].
+
+2002-10-14 Adam Fedor <fedor@gnu.org>
+
+ * symtab.h: New objc_specific struct.
+ (SYMBOL_INIT_LANGUAGE_SPECIFIC): Handle ObjC.
+ (SYMBOL_DEMANGLED_NAME): Likewise.
+
+2002-10-14 Adam Fedor <fedor@gnu.org>
+
+ * symfile.c (init_filename_language_table): Add ObjC file extension.
+
+2002-10-14 Adam Fedor <fedor@gnu.org>
+
+ * utils.c (puts_filtered_tabular): New function.
+ (fprintf_symbol_filtered): Get ObjC demangled name.
+ * defs.h (puts_filtered_tabular): Declared.
+
+2002-10-14 Kevin Buettner <kevinb@redhat.com>
+
+ * c-lang.h (c_type_print_varspec_prefix): Delete.
+ * c-typeprint.c (c_type_print_varspec_prefix): Make static. Add
+ ``need_post_space'' parameter. Adjust all callers.
+
+2002-10-14 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/mips/nm-irix4.h (HAVE_NONSTEPPABLE_WATCHPOINT): Define to 1.
+ * config/mips/nm-irix5.h (HAVE_NONSTEPPABLE_WATCHPOINT): Likewise.
+ * config/mips/tm-embed.h (HAVE_NONSTEPPABLE_WATCHPOINT): Likewise.
+ * config/pa/nm-hppah.h (HAVE_NONSTEPPABLE_WATCHPOINT): Likewise.
+
+2002-10-13 Adam Fedor <fedor@gnu.org>
+
+ * source.c (print_source_lines): Update comments.
+
+2002-10-13 Adam Fedor <fedor@gnu.org>
+
+ * valops.c (value_of_local): New function.
+ (value_of_this): Use it.
+ * value.h (value_of_local): Declared.
+
+2002-10-13 Adam Fedor <fedor@gnu.org>
+
+ * parse.c: (length_of_subexp, prefixify_subexp): Handle
+ OP_MSGCALL, OP_SELECTOR, OP_NSSTRING, and OP_SELF.
+
+2002-10-12 Adam Fedor <fedor@gnu.org>
+
+ * language.c (binop_result_type): Add language_objc to case.
+ (integral_type): Likewise.
+ (character_type): Likewise.
+ (string_type): Likewise.
+ (boolean_type): Likewise.
+ (structured_type): Likewise.
+ (binop_type_check): Likewise.
+
+2002-10-11 Adam Fedor <fedor@gnu.org>
+
+ * printcmd.c (address_info): Print 'self' for ObjC.
+
+2002-10-11 Adam Fedor <fedor@gnu.org>
+
+ * expression.h: New ops OP_NSSTRING, OP_SELECTOR, OP_MSGCALL, and
+ OP_SELF.
+
+2002-10-11 Adam Fedor <fedor@gnu.org>
+
+ * language.h (CAST_IS_CONVERSION): Add language_objc.
+
+2002-10-11 Adam Fedor <fedor@gnu.org>
+
+ * defs.h (enum language): Add language_objc.
+
+2002-10-11 Klee Dienes <kdienes@apple.com>
+
+ * corefile.c (read_memory_typed_address): New function.
+ * gdbcore.h (read_memory_typed_address): Add prototype.
+ * blockframe.c (sigtramp_saved_pc): Use read_memory_typed_address
+ to read a value destined for a CORE_ADDR, not read_memory_integer.
+ * f-valprint.c (f77_get_dynamic_upperbound): Ditto.
+ (f77_get_dynamic_lowerbound): Ditto.
+
+2002-10-11 Martin M. Hunt <hunt@redhat.com>
+
+ * utils.c (string_to_core_addr): After turning string into
+ a number, convert to a CORE_ADDR using INTEGER_TO_ADDRESS
+ which will do necessary sign-extension, etc.
+
+2002-10-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * c-exp.y (THIS): Delete token and grammar rule.
+ (yylex): Don't return THIS.
+ * cp-valprint.c (vtbl_ptr_name_old): Delete.
+ (cp_is_vtbl_ptr_type): Don't check vtbl_ptr_name_old.
+ * demangle.c (cplus_markers): Update comment. Put '$'
+ first. Remove CPLUS_MARKER.
+ (_initialize_demangler): Don't call set_cplus_marker_for_demangling.
+ * jv-exp.y (THIS): Delete token and grammar rule.
+ (yylex): Don't return THIS.
+ * mips-tdep.c (mips_dump_tdep): Don't dump CPLUS_MARKER.
+ * objc-exp.y (THIS): Delete token and grammar rule.
+ (yylex): Don't return THIS.
+ * p-exp.y (yylex): Remove reference to CPLUS_MARKER.
+ * stabsread.c (vptr_name, vb_name): Replace CPLUS_MARKER with '$'.
+ (read_member_functions): Likewise for opname.
+ (read_tilde_fields): Use is_cplus_marker.
+
+ * defs.h (CPLUS_MARKER): Don't define.
+ * config/tm-sysv4.h (CPLUS_MARKER): Likewise.
+ * config/i386/xm-i386sco.h (CPLUS_MARKER): Likewise.
+ * config/mips/tm-irix3.h (CPLUS_MARKER): Likewise.
+ * config/mips/tm-irix6.h (CPLUS_MARKER): Likewise.
+ * config/rs6000/tm-rs6000.h (CPLUS_MARKER): Likewise.
+
+ * config/i386/tm-i386v4.h: Delete file.
+ * config/djgpp/fnchange.lst: Delete tm-i386v4.h.
+ * config/i386/tm-i386sol2.h: Include "i386/tm-i386.h" instead.
+ * config/i386/tm-i386v42mp.h: Include "i386/tm-i386.h" instead.
+ * config/i386/tm-ptx.h: Include "i386/tm-i386.h" instead.
+ * config/i386/i386gnu.mt (TM_FILE): Use tm-i386.h.
+ * config/i386/i386sco5.mt (TM_FILE): Likewise.
+ * config/i386/i386v4.mt (TM_FILE): Likewise.
+ * config/i386/ncr3000.mt (TM_FILE): Likewise.
+
+2002-10-10 Marko Mlinar <markom@opencores.org>
+
+ * infrun.c (resume): Convert #ifdef HAVE_NONSTEPPABLE_WATCHPOINT into C,
+ accidentially not commited 2002-10-09
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2002-10-09 Marko Mlinar <markom@opencores.org>
+
+ * infrun.c (resume): Convert #ifdef HAVE_NONSTEPPABLE_WATCHPOINT into C.
+ * gdbarch.sh (HAVE_NONSTEPPABLE_WATCHPOINT): Add.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2002-10-08 Petr Sorfa <petrs@caldera.com>
+
+ Revised and re-submitted by John Wolfe <jlw@caldera.com>
+
+ Move the Dwarf 2 abbrev table to a per-compilation-unit structure,
+ so we can work on more than one compilation unit at a time. This
+ helps prepare GDB to handle inter-CU die references.
+ * dwarf2read.c (ABBREV_HASH_SIZE): moved definition forward in
+ the code to be defined before struct comp_unit_head.
+ (comp_unit_head): Added new members - offset, cu_head,
+ begin_die, next and dwarf2_abbrevs.
+ (dwarf2_abbrevs): Removed single static var; now member of
+ struct comp_unit_head.
+ dwarf2_build_psymtabs_hard): Complete new struct comp_unit_head
+ members.
+ (psymtab_to_symtab_1): Changed to work with the new
+ struct comp_unit_head.
+ (dwarf2_read_abbrevs): Now accepts a cu_header parameter and
+ constructs the dwarf2_abbrevs[] inside the cu_header.
+ (dwarf2_empty_abbrev_table): Now expects a ptr to a
+ dwarf2_abbrev table to clean up.
+ (dwarf2_lookup_abbrev): Now accepts a cu_header parameter and
+ handling of dwarf2_abbrevs inside the cu_header.
+ (read_partial_die): Now supports the call to the new
+ dwarf2_lookup_abbrev.
+ (read_full_die): Now supports the call to the new
+ dwarf2_lookup_abbrev.
+
+2002-10-06 Christopher Faylor <cgf@redhat.com>
+
+ * Makefile.in (install-gdbtk): Add missing continuation backslash to
+ insure that shell variables, such as "transformed_name" are propagated
+ to later shell statements in rule.
+
+2002-10-06 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/nm-i386sco.h: Add protection against
+ multiple-inclusion. Include "i386/nm-i386v.h".
+ (REGISTER_U_ADDR): Remove define.
+ (i386_register_u_addr): Remove prototype.
+
2002-10-04 Michael Snyder <msnyder@redhat.com>
* m32r-stub.c (handle_exception): Make sure exception is "trap"
diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS
index a392f5a8435..2947317f542 100644
--- a/gdb/MAINTAINERS
+++ b/gdb/MAINTAINERS
@@ -9,6 +9,7 @@ Kevin Buettner kevinb@redhat.com
Andrew Cagney ac131313@redhat.com
J.T. Conklin jtc@redback.com
Fred Fish fnf@ninemoons.com
+Daniel Jacobowitz dan@debian.org
Mark Kettenis kettenis@gnu.org
Peter Schauer Peter.Schauer@regent.e-technik.tu-muenchen.de
Stan Shebs shebs@apple.com
@@ -56,7 +57,7 @@ maintainer works with the native maintainer when resolving API issues.
a29k Deleted.
- alpha --target=alpha-elf -Werror
+ alpha --target=alpha-elf ,-Werror
Maintenance only
arc (--target=arc-elf OBSOLETE)
@@ -80,7 +81,7 @@ maintainer works with the native maintainer when resolving API issues.
fr30 (--target=fr30-elf OBSOLETE)
- h8300 --target=h8300hms -Werror
+ h8300 --target=h8300hms ,-Werror
Maintenance only
h8500 --target=h8500hms -Werror
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 95330c0950b..aa401e47f7e 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -55,6 +55,8 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
+DESTDIR =
+
AR = @AR@
AR_FLAGS = qv
RANLIB = @RANLIB@
@@ -535,7 +537,8 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
c-exp.y c-lang.c c-typeprint.c c-valprint.c \
charset.c cli-out.c coffread.c complaints.c completer.c corefile.c \
cp-abi.c cp-support.c cp-valprint.c \
- dbxread.c demangle.c disasm.c doublest.c dwarfread.c dwarf2read.c \
+ dbxread.c demangle.c disasm.c doublest.c \
+ dummy-frame.c dwarfread.c dwarf2read.c \
elfread.c environ.c eval.c event-loop.c event-top.c expprint.c \
f-exp.y f-lang.c f-typeprint.c f-valprint.c findvar.c frame.c \
gdbarch.c arch-utils.c gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \
@@ -550,7 +553,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
nlmread.c \
objfiles.c osabi.c \
p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c printcmd.c \
- regcache.c remote.c \
+ regcache.c reggroups.c remote.c \
scm-exp.c scm-lang.c scm-valprint.c serial.c ser-unix.c source.c \
stabsread.c stack.c std-regs.c symfile.c symmisc.c symtab.c \
target.c thread.c top.c tracepoint.c typeprint.c \
@@ -640,6 +643,7 @@ defs_h = defs.h $(config_h) $(gdb_locale_h) $(gdb_signals_h) $(ansidecl_h) \
disasm_h = disasm.h
doublest_h = doublest.h $(floatformat_h)
dst_h = dst.h
+dummy_frame_h = dummy-frame.h
dwarf2cfi_h = dwarf2cfi.h
environ_h = environ.h
event_loop_h = event-loop.h
@@ -698,6 +702,7 @@ ppc_tdep_h = ppc-tdep.h $(osabi_h)
ppcnbsd_tdep_h = ppcnbsd-tdep.h
proc_utils_h = proc-utils.h
regcache_h = regcache.h
+reggroups_h = reggroups.h
remote_utils_h = remote-utils.h $(target_h)
remote_h = remote.h
scm_lang_h = scm-lang.h $(scm_tags_h)
@@ -828,7 +833,7 @@ TAGFILES_NO_SRCDIR = $(SFILES) $(HFILES_NO_SRCDIR) $(ALLDEPFILES) \
TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR)
COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \
- charset.o disasm.o \
+ charset.o disasm.o dummy-frame.o \
source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \
symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o \
expprint.o environ.o stack.o thread.o \
@@ -854,7 +859,8 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \
nlmread.o serial.o mdebugread.o top.o utils.o \
ui-file.o \
frame.o doublest.o \
- gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o cp-support.o
+ gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o cp-support.o \
+ reggroups.o
OBS = $(COMMON_OBS) $(ANNOTATE_OBS)
@@ -918,9 +924,12 @@ install-only: $(CONFIG_INSTALL)
true ; \
fi ; \
$(srcdir)/../mkinstalldirs $(bindir) ; \
- $(INSTALL_PROGRAM) gdb$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \
- $(srcdir)/../mkinstalldirs $(man1dir) ; \
- $(INSTALL_DATA) $(srcdir)/gdb.1 $(man1dir)/$$transformed_name.1
+ $(INSTALL_PROGRAM) gdb$(EXEEXT) \
+ $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
+ $(srcdir)/../mkinstalldirs \
+ $(DESTDIR)$(man1dir) ; \
+ $(INSTALL_DATA) $(srcdir)/gdb.1 \
+ $(DESTDIR)$(man1dir)/$$transformed_name.1
@$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
uninstall: force $(CONFIG_UNINSTALL)
@@ -1530,7 +1539,8 @@ ax-general.o: ax-general.c $(defs_h) $(ax_h) $(value_h) $(gdb_string_h)
bcache.o: bcache.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(gdb_string_h)
blockframe.o: blockframe.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \
$(objfiles_h) $(frame_h) $(gdbcore_h) $(value_h) $(target_h) \
- $(inferior_h) $(annotate_h) $(regcache_h) $(gdb_assert_h)
+ $(inferior_h) $(annotate_h) $(regcache_h) $(gdb_assert_h) \
+ $(dummy_frame_h)
breakpoint.o: breakpoint.c $(defs_h) $(symtab_h) $(frame_h) $(breakpoint_h) \
$(gdbtypes_h) $(expression_h) $(gdbcore_h) $(gdbcmd_h) $(value_h) \
$(command_h) $(inferior_h) $(gdbthread_h) $(target_h) $(language_h) \
@@ -1625,6 +1635,8 @@ doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) \
dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h)
dsrec.o: dsrec.c $(defs_h) $(serial_h) $(srec_h)
# OBSOLETE dstread.o: dstread.c
+dummy-frame.o: dummy-frame.c $(defs_h) $(dummy_frame_h) $(regcache_h) \
+ $(frame_h) $(inferior_h) $(gdb_assert_h)
dve3900-rom.o: dve3900-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
$(serial_h) $(inferior_h) $(command_h) $(gdb_string_h) $(regcache_h)
dwarf2cfi.o: dwarf2cfi.c $(defs_h) $(gdbcore_h) $(symtab_h) $(symfile_h) \
@@ -1674,7 +1686,8 @@ fork-child.o: fork-child.c $(defs_h) $(gdb_string_h) $(frame_h) \
$(terminal_h) $(gdbthread_h) $(command_h)
# OBSOLETE fr30-tdep.o: fr30-tdep.c
frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \
- $(regcache_h) $(gdb_assert_h)
+ $(regcache_h) $(gdb_assert_h) $(gdb_obstack_h) $(dummy_frame_h) \
+ $(gdbcore_h) $(annotate_h)
frv-tdep.o: frv-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \
$(arch_utils_h) $(regcache_h)
gcore.o: gcore.c $(defs_h) $(cli_decode_h) $(inferior_h) $(gdbcore_h) \
@@ -1685,7 +1698,7 @@ gdbarch.o: gdbarch.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) $(inferior_h) \
$(gdb_string_h) $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) \
$(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(gdbthread_h) \
$(annotate_h) $(symfile_h) $(value_h) $(symcat_h) $(floatformat_h) \
- $(gdb_assert_h) $(gdb_string_h) $(gdb_events_h)
+ $(gdb_assert_h) $(gdb_string_h) $(gdb_events_h) $(reggroups_h)
gdbtypes.o: gdbtypes.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \
$(symfile_h) $(objfiles_h) $(gdbtypes_h) $(expression_h) \
$(language_h) $(target_h) $(value_h) $(demangle_h) $(complaints_h) \
@@ -1715,7 +1728,7 @@ hpacc-abi.o: hpacc-abi.c $(defs_h) $(value_h) $(gdb_regex_h) $(gdb_string_h) \
hppa-tdep.o: hppa-tdep.c $(defs_h) $(frame_h) $(bfd_h) $(inferior_h) \
$(value_h) $(regcache_h) $(completer_h) $(symtab_h) $(a_out_encap_h) \
$(gdb_stat_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) \
- $(symfile_h) $(objfiles_h)
+ $(symfile_h) $(objfiles_h) $(language_h)
hppab-nat.o: hppab-nat.c $(defs_h) $(inferior_h) $(target_h) $(regcache_h)
hppah-nat.o: hppah-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
$(gdb_wait_h) $(regcache_h)
@@ -1760,8 +1773,10 @@ i386nbsd-tdep.o: i386nbsd-tdep.c $(defs_h) $(gdbtypes_h) $(gdbcore_h) \
$(regcache_h) $(arch_utils_h) $(i386_tdep_h) $(i387_tdep_h) \
$(nbsd_tdep_h) $(solib_svr4_h)
i386obsd-nat.o: i386obsd-nat.c $(defs_h)
+i386obsd-tdep.o: i386obsd-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \
+ $(regcache_h) $(i386_tdep_h) $(i387_tdep_h)
i386v-nat.o: i386v-nat.c $(defs_h) $(frame_h) $(inferior_h) $(language_h) \
- $(gdbcore_h) $(gdb_stat_h) $(floatformat_h) $(target_h)
+ $(gdbcore_h) $(gdb_stat_h) $(floatformat_h) $(target_h) $(i386_tdep_h)
i386v4-nat.o: i386v4-nat.c $(defs_h) $(value_h) $(inferior_h) $(regcache_h) \
$(i386_tdep_h) $(i387_tdep_h) $(gregset_h)
i387-tdep.o: i387-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(language_h) \
@@ -1822,7 +1837,7 @@ lin-lwp.o: lin-lwp.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(gdb_wait_h) \
$(gdbthread_h) $(inferior_h) $(target_h) $(regcache_h) $(gdbcmd_h)
linespec.o: linespec.c $(defs_h) $(symtab_h) $(frame_h) $(command_h) \
$(symfile_h) $(objfiles_h) $(demangle_h) $(value_h) $(completer_h) \
- $(cp_abi_h) $(source_h)
+ $(cp_abi_h) $(source_h) $(parser_defs_h)
linux-proc.o: linux-proc.c $(defs_h) $(inferior_h) $(regcache_h) \
$(gregset_h) $(gdbcore_h) $(gdbthread_h) $(elf_bfd_h) \
$(cli_decode_h) $(gdb_string_h)
@@ -1867,7 +1882,7 @@ macrocmd.o: macrocmd.c $(defs_h) $(macrotab_h) $(macroexp_h) $(macroscope_h) \
macroexp.o: macroexp.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(macrotab_h) \
$(macroexp_h) $(gdb_assert_h)
macroscope.o: macroscope.c $(defs_h) $(macroscope_h) $(symtab_h) $(target_h) \
- $(frame_h) $(inferior_h) $(source_h)
+ $(frame_h) $(inferior_h) $(source_h) $(complaints_h)
macrotab.o: macrotab.c $(defs_h) $(gdb_obstack_h) $(splay_tree_h) \
$(symtab_h) $(symfile_h) $(objfiles_h) $(macrotab_h) $(gdb_assert_h) \
$(bcache_h) $(complaints_h)
@@ -2001,8 +2016,10 @@ procfs.o: procfs.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
ptx4-nat.o: ptx4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) \
$(gregset_h)
regcache.o: regcache.c $(defs_h) $(inferior_h) $(target_h) $(gdbarch_h) \
- $(gdbcmd_h) $(regcache_h) $(gdb_assert_h) $(gdb_string_h) \
- $(gdbcmd_h)
+ $(gdbcmd_h) $(regcache_h) $(reggroups_h) $(gdb_assert_h) \
+ $(gdb_string_h) $(gdbcmd_h)
+reggroups.o: reggroups.c $(defs_h) $(reggroups_h) $(gdbtypes_h) \
+ $(gdb_assert_h) $(regcache_h) $(command_h) $(gdbcmd_h)
remote-array.o: remote-array.c $(defs_h) $(gdbcore_h) $(target_h) \
$(gdb_string_h) $(command_h) $(serial_h) $(monitor_h) \
$(remote_utils_h) $(inferior_h) $(version_h) $(regcache_h)
@@ -2129,7 +2146,8 @@ solib-legacy.o: solib-legacy.c $(defs_h) $(gdbcore_h) $(solib_svr4_h)
solib-osf.o: solib-osf.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \
$(symfile_h) $(objfiles_h) $(target_h) $(inferior_h) $(solist_h)
solib-sunos.o: solib-sunos.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) \
- $(symfile_h) $(objfiles_h) $(gdbcore_h) $(inferior_h) $(solist_h)
+ $(symfile_h) $(objfiles_h) $(gdbcore_h) $(inferior_h) $(solist_h) \
+ $(bcache_h) $(regcache_h)
solib-svr4.o: solib-svr4.c $(defs_h) $(elf_external_h) $(elf_common_h) \
$(elf_mips_h) $(symtab_h) $(bfd_h) $(symfile_h) $(objfiles_h) \
$(gdbcore_h) $(target_h) $(inferior_h) $(solist_h) $(solib_svr4_h)
@@ -2341,21 +2359,26 @@ install-gdbtk:
else \
true ; \
fi ; \
- $(SHELL) $(srcdir)/../mkinstalldirs $(bindir)
- $(INSTALL_PROGRAM) insight$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \
- $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY) ; \
- $(SHELL) $(srcdir)/../mkinstalldirs $(libdir)/insight$(GDBTK_VERSION) ; \
- $(INSTALL_DATA) $(srcdir)/gdbtk/plugins/plugins.tcl $(libdir)/insight$(GDBTK_VERSION)/plugins.tcl ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs $(bindir); \
+ $(INSTALL_PROGRAM) insight$(EXEEXT) \
+ $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs \
+ $(DESTDIR)$(GDBTK_LIBRARY) ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs \
+ $(DESTDIR)$(libdir)/insight$(GDBTK_VERSION) ; \
+ $(INSTALL_DATA) $(srcdir)/gdbtk/plugins/plugins.tcl \
+ $(DESTDIR)$(libdir)/insight$(GDBTK_VERSION)/plugins.tcl ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs \
+ $(DESTDIR)$(GDBTK_LIBRARY)/images \
+ $(DESTDIR)$(GDBTK_LIBRARY)/images2 ; \
$(SHELL) $(srcdir)/../mkinstalldirs \
- $(GDBTK_LIBRARY)/images \
- $(GDBTK_LIBRARY)/images2 ; \
- $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY)/help \
- $(GDBTK_LIBRARY)/help/images \
- $(GDBTK_LIBRARY)/help/trace ; \
+ $(DESTDIR)$(GDBTK_LIBRARY)/help \
+ $(DESTDIR)$(GDBTK_LIBRARY)/help/images \
+ $(DESTDIR)$(GDBTK_LIBRARY)/help/trace ; \
cd $(srcdir)/gdbtk/library ; \
for i in *.tcl *.itcl *.ith *.itb images/*.gif images2/*.gif images/icons.txt images2/icons.txt tclIndex help/*.html help/trace/*.html help/trace/index.toc help/images/*.gif; \
do \
- $(INSTALL_DATA) $$i $(GDBTK_LIBRARY)/$$i ; \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(GDBTK_LIBRARY)/$$i ; \
done ;
uninstall-gdbtk:
@@ -2366,8 +2389,8 @@ uninstall-gdbtk:
else \
true ; \
fi ; \
- rm -f $(bindir)/$$transformed_name$(EXEEXT) ; \
- rm -rf $(GDBTK_LIBRARY)
+ rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
+ rm -rf $(DESTDIR)$(GDBTK_LIBRARY)
clean-gdbtk:
rm -f insight$(EXEEXT)
diff --git a/gdb/NEWS b/gdb/NEWS
index 4ce063e0794..0ba805d88d5 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -12,6 +12,11 @@ option "-i=mi", has been changed to "mi2". The previous MI syntax,
Support for the original "mi0" syntax (included in GDB 5.0) has been
removed.
+Fix for gdb/192: removed extraneous space when displaying frame level.
+Fix for gdb/672: update changelist is now output in mi list format.
+Fix for gdb/702: a -var-assign that updates the value now shows up
+ in a subsequent -var-update.
+
* REMOVED configurations and files
V850EA ISA
diff --git a/gdb/PROBLEMS b/gdb/PROBLEMS
index 4c460d6eb80..b2f45d8bff2 100644
--- a/gdb/PROBLEMS
+++ b/gdb/PROBLEMS
@@ -50,3 +50,18 @@ i386-*-freebsd4.4*
gdb/455: GDB doesn't build on a FreeBSD 4.4-STABLE system. The
problem is still being investigated.
+
+alpha*-*-osf*
+-------------
+
+gdb/816: When building GDB with GCC 3.0.1, GDB is unable to load a core
+file properly. It generates several errors and warnings regarding
+unhandled core file section types, incorrect endianness, the failure to
+load the registers. Are also incorrectly reported: The program name, the
+cause of the program death, and the call stack at the moment of the
+death. This problem has been reported on alpha-osf4.0f and alpha-osf5.1a.
+To work-around the problem, add -D__digital__ to the CFLAGS when
+building GDB vis:
+
+ $ make CFLAGS='-O2 -D__digital__'
+
diff --git a/gdb/a68v-nat.c b/gdb/a68v-nat.c
index 4cc25cedb54..0bfe8e2e608 100644
--- a/gdb/a68v-nat.c
+++ b/gdb/a68v-nat.c
@@ -41,7 +41,7 @@ fetch_inferior_registers (int ignored)
ptrace_$init_control (&inferior_control_registers);
inferior_fp_registers.size = sizeof (inferior_fp_registers);
- registers_fetched ();
+ deprecated_registers_fetched ();
ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_registers,
@@ -61,11 +61,14 @@ fetch_inferior_registers (int ignored)
(PTRACE_ARG3_TYPE) & inferior_control_registers,
ptrace_$control_set_m68k);
- bcopy (&inferior_registers, registers, 16 * 4);
- bcopy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
+ bcopy (&inferior_registers, &deprecated_registers[0], 16 * 4);
+ bcopy (&inferior_fp_registers,
+ &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
sizeof inferior_fp_registers.regs);
- *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = inferior_control_registers.sr;
- *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = inferior_control_registers.pc;
+ *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)]
+ = inferior_control_registers.sr;
+ *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)]
+ = inferior_control_registers.pc;
}
/* Store our register values back into the inferior.
@@ -94,13 +97,16 @@ store_inferior_registers (int regno)
(PTRACE_ARG3_TYPE) & inferior_control_registers,
ptrace_$control_set_m68k);
- bcopy (registers, &inferior_registers, sizeof (inferior_registers));
+ bcopy (&deprecated_registers[0], &inferior_registers,
+ sizeof (inferior_registers));
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)], inferior_fp_registers.regs,
- sizeof inferior_fp_registers.regs);
+ bcopy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ inferior_fp_registers.regs, sizeof inferior_fp_registers.regs);
- inferior_control_registers.sr = *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
- inferior_control_registers.pc = *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
+ inferior_control_registers.sr
+ = *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)];
+ inferior_control_registers.pc
+ = *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)];
ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_registers,
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 2838df7e68c..1e526eb9378 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -4189,6 +4189,7 @@ fill_in_ada_prototype (struct symbol *func)
case LOC_REGPARM_ADDR:
TYPE_FIELD_BITPOS (ftype, nargs) = nargs;
TYPE_FIELD_BITSIZE (ftype, nargs) = 0;
+ TYPE_FIELD_STATIC_KIND (ftype, nargs) = 0;
TYPE_FIELD_TYPE (ftype, nargs) =
lookup_pointer_type (check_typedef (SYMBOL_TYPE (sym)));
TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym);
@@ -4202,6 +4203,7 @@ fill_in_ada_prototype (struct symbol *func)
case LOC_BASEREG_ARG:
TYPE_FIELD_BITPOS (ftype, nargs) = nargs;
TYPE_FIELD_BITSIZE (ftype, nargs) = 0;
+ TYPE_FIELD_STATIC_KIND (ftype, nargs) = 0;
TYPE_FIELD_TYPE (ftype, nargs) = check_typedef (SYMBOL_TYPE (sym));
TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym);
nargs += 1;
@@ -4395,7 +4397,7 @@ ada_finish_decode_line_1 (char **spec, struct symtab *file_table,
#endif
struct minimal_symbol *msymbol;
- INIT_SAL (&val);
+ init_sal (&val);
msymbol = NULL;
if (lower_name != NULL)
@@ -4537,7 +4539,7 @@ done:
sals.nelts = 1;
sals.sals = (struct symtab_and_line *) xmalloc (sizeof (sals.sals[0]));
- INIT_SAL (&sals.sals[0]);
+ init_sal (&sals.sals[0]);
sals.sals[0].line = best_linetable->item[best_index].line;
sals.sals[0].pc = best_linetable->item[best_index].pc;
@@ -4856,7 +4858,7 @@ all_sals_for_line (const char *filename, int line_num, char ***canonical)
break;
GROW_VECT (result.sals, len, result.nelts + 1);
- INIT_SAL (&result.sals[result.nelts]);
+ init_sal (&result.sals[result.nelts]);
result.sals[result.nelts].line = LINETABLE (s)->item[ind].line;
result.sals[result.nelts].pc = LINETABLE (s)->item[ind].pc;
result.sals[result.nelts].symtab = s;
@@ -5040,7 +5042,7 @@ find_printable_frame (struct frame_info *fi, int level)
find_pc_line (fi->pc,
fi->next != NULL
&& !fi->next->signal_handler_caller
- && !frame_in_dummy (fi->next));
+ && !deprecated_frame_in_dummy (fi->next));
if (sal.symtab && !is_ada_runtime_file (sal.symtab->filename))
{
#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)
@@ -6046,6 +6048,7 @@ template_to_fixed_record_type (struct type *type, char *valaddr,
* rediscover why we needed field_offset and fix it properly. */
TYPE_FIELD_BITPOS (rtype, f) = off;
TYPE_FIELD_BITSIZE (rtype, f) = 0;
+ TYPE_FIELD_STATIC_KIND (rtype, f) = 0;
if (ada_is_variant_part (type, f))
{
@@ -6149,6 +6152,7 @@ template_to_static_fixed_type (struct type *templ_type)
{
TYPE_FIELD_BITPOS (type, f) = 0;
TYPE_FIELD_BITSIZE (type, f) = 0;
+ TYPE_FIELD_STATIC_KIND (type, f) = 0;
if (is_dynamic_field (templ_type, f))
{
@@ -6218,6 +6222,7 @@ to_record_with_fixed_variant_part (struct type *type, char *valaddr,
TYPE_FIELD_TYPE (rtype, nfields - 1) = branch_type;
TYPE_FIELD_NAME (rtype, nfields - 1) = "S";
TYPE_FIELD_BITSIZE (rtype, nfields - 1) = 0;
+ TYPE_FIELD_STATIC_KIND (rtype, nfields - 1) = 0;
TYPE_LENGTH (rtype) += TYPE_LENGTH (branch_type);
-TYPE_LENGTH (TYPE_FIELD_TYPE (type, nfields - 1));
}
diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c
index 580dcc0e809..6d7a3d67c17 100644
--- a/gdb/alpha-nat.c
+++ b/gdb/alpha-nat.c
@@ -133,19 +133,21 @@ fetch_elf_core_registers (char *core_reg_sect, unsigned core_reg_size,
if (which == 2)
{
/* The FPU Registers. */
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], core_reg_sect, 31 * 8);
- memset (&registers[REGISTER_BYTE (FP0_REGNUM + 31)], 0, 8);
- memset (&register_valid[FP0_REGNUM], 1, 32);
+ memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ core_reg_sect, 31 * 8);
+ memset (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM + 31)], 0, 8);
+ memset (&deprecated_register_valid[FP0_REGNUM], 1, 32);
}
else
{
/* The General Registers. */
- memcpy (&registers[REGISTER_BYTE (ALPHA_V0_REGNUM)], core_reg_sect,
- 31 * 8);
- memcpy (&registers[REGISTER_BYTE (PC_REGNUM)], core_reg_sect + 31 * 8, 8);
- memset (&registers[REGISTER_BYTE (ALPHA_ZERO_REGNUM)], 0, 8);
- memset (&register_valid[ALPHA_V0_REGNUM], 1, 32);
- register_valid[PC_REGNUM] = 1;
+ memcpy (&deprecated_registers[REGISTER_BYTE (ALPHA_V0_REGNUM)],
+ core_reg_sect, 31 * 8);
+ memcpy (&deprecated_registers[REGISTER_BYTE (PC_REGNUM)],
+ core_reg_sect + 31 * 8, 8);
+ memset (&deprecated_registers[REGISTER_BYTE (ALPHA_ZERO_REGNUM)], 0, 8);
+ memset (&deprecated_register_valid[ALPHA_V0_REGNUM], 1, 32);
+ deprecated_register_valid[PC_REGNUM] = 1;
}
}
@@ -209,10 +211,10 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
for (regi = 0; regi < 31; regi++)
if ((regno == -1) || (regno == regi))
- *(regp + regi) = *(long *) &registers[REGISTER_BYTE (regi)];
+ *(regp + regi) = *(long *) &deprecated_registers[REGISTER_BYTE (regi)];
if ((regno == -1) || (regno == PC_REGNUM))
- *(regp + 31) = *(long *) &registers[REGISTER_BYTE (PC_REGNUM)];
+ *(regp + 31) = *(long *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)];
}
/*
@@ -241,7 +243,7 @@ fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
if ((regno == -1) || (regno == regi))
{
*(regp + regi - FP0_REGNUM) =
- *(long *) &registers[REGISTER_BYTE (regi)];
+ *(long *) &deprecated_registers[REGISTER_BYTE (regi)];
}
}
}
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 7018d39773e..02eca3d314a 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -1545,7 +1545,7 @@ alpha_store_return_value (struct type *valtype, char *valbuf)
else
memcpy (raw_buffer, valbuf, length);
- write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, length);
+ deprecated_write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, length);
}
/* Just like reinit_frame_cache, but with the right arguments to be
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index a056177553e..732c40bda6a 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -99,7 +99,7 @@ legacy_extract_return_value (struct type *type, struct regcache *regcache,
{
char *registers = deprecated_grub_regcache_for_registers (regcache);
bfd_byte *buf = valbuf;
- DEPRECATED_EXTRACT_RETURN_VALUE (type, registers, buf);
+ DEPRECATED_EXTRACT_RETURN_VALUE (type, registers, buf); /* OK */
}
/* Implementation of store return value that grubs the register cache.
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 82444d1c594..2adce63d8eb 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -2401,13 +2401,14 @@ arm_store_return_value (struct type *type, char *valbuf)
case ARM_FLOAT_FPA:
convert_to_extended (valbuf, buf);
- write_register_bytes (REGISTER_BYTE (ARM_F0_REGNUM), buf,
- FP_REGISTER_RAW_SIZE);
+ deprecated_write_register_bytes (REGISTER_BYTE (ARM_F0_REGNUM), buf,
+ FP_REGISTER_RAW_SIZE);
break;
case ARM_FLOAT_SOFT:
case ARM_FLOAT_SOFT_VFP:
- write_register_bytes (ARM_A1_REGNUM, valbuf, TYPE_LENGTH (type));
+ deprecated_write_register_bytes (ARM_A1_REGNUM, valbuf,
+ TYPE_LENGTH (type));
break;
default:
@@ -2418,7 +2419,8 @@ arm_store_return_value (struct type *type, char *valbuf)
}
}
else
- write_register_bytes (ARM_A1_REGNUM, valbuf, TYPE_LENGTH (type));
+ deprecated_write_register_bytes (ARM_A1_REGNUM, valbuf,
+ TYPE_LENGTH (type));
}
/* Store the address of the place in which to copy the structure the
@@ -2858,7 +2860,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_push_return_address (gdbarch, arm_push_return_address);
#endif
- set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
+ set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
set_gdbarch_push_arguments (gdbarch, arm_push_arguments);
set_gdbarch_coerce_float_to_double (gdbarch,
standard_coerce_float_to_double);
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index eba45a377d9..1a2a5684e6c 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -35,27 +35,10 @@
#include "annotate.h"
#include "regcache.h"
#include "gdb_assert.h"
+#include "dummy-frame.h"
/* Prototypes for exported functions. */
-static void generic_call_dummy_register_unwind (struct frame_info *frame,
- void **cache,
- int regnum,
- int *optimized,
- enum lval_type *lval,
- CORE_ADDR *addrp,
- int *realnum,
- void *raw_buffer);
-static void frame_saved_regs_register_unwind (struct frame_info *frame,
- void **cache,
- int regnum,
- int *optimized,
- enum lval_type *lval,
- CORE_ADDR *addrp,
- int *realnum,
- void *buffer);
-
-
void _initialize_blockframe (void);
/* A default FRAME_CHAIN_VALID, in the form that is suitable for most
@@ -181,140 +164,6 @@ inside_entry_func (CORE_ADDR pc)
symfile_objfile->ei.entry_func_highpc > pc);
}
-/* Info about the innermost stack frame (contents of FP register) */
-
-static struct frame_info *current_frame;
-
-/* Cache for frame addresses already read by gdb. Valid only while
- inferior is stopped. Control variables for the frame cache should
- be local to this module. */
-
-static struct obstack frame_cache_obstack;
-
-void *
-frame_obstack_alloc (unsigned long size)
-{
- return obstack_alloc (&frame_cache_obstack, size);
-}
-
-void
-frame_saved_regs_zalloc (struct frame_info *fi)
-{
- fi->saved_regs = (CORE_ADDR *)
- frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
- memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
-}
-
-
-/* Return the innermost (currently executing) stack frame. */
-
-struct frame_info *
-get_current_frame (void)
-{
- if (current_frame == NULL)
- {
- if (target_has_stack)
- current_frame = create_new_frame (read_fp (), read_pc ());
- else
- error ("No stack.");
- }
- return current_frame;
-}
-
-void
-set_current_frame (struct frame_info *frame)
-{
- current_frame = frame;
-}
-
-
-/* Using the PC, select a mechanism for unwinding a frame returning
- the previous frame. The register unwind function should, on
- demand, initialize the ->context object. */
-
-static void
-set_unwind_by_pc (CORE_ADDR pc, CORE_ADDR fp,
- frame_register_unwind_ftype **unwind)
-{
- if (!USE_GENERIC_DUMMY_FRAMES)
- /* Still need to set this to something. The ``info frame'' code
- calls this function to find out where the saved registers are.
- Hopefully this is robust enough to stop any core dumps and
- return vaguely correct values.. */
- *unwind = frame_saved_regs_register_unwind;
- else if (PC_IN_CALL_DUMMY (pc, fp, fp))
- *unwind = generic_call_dummy_register_unwind;
- else
- *unwind = frame_saved_regs_register_unwind;
-}
-
-/* Create an arbitrary (i.e. address specified by user) or innermost frame.
- Always returns a non-NULL value. */
-
-struct frame_info *
-create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
-{
- struct frame_info *fi;
- char *name;
-
- fi = (struct frame_info *)
- obstack_alloc (&frame_cache_obstack,
- sizeof (struct frame_info));
-
- /* Zero all fields by default. */
- memset (fi, 0, sizeof (struct frame_info));
-
- fi->frame = addr;
- fi->pc = pc;
- find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
- fi->signal_handler_caller = PC_IN_SIGTRAMP (fi->pc, name);
-
- if (INIT_EXTRA_FRAME_INFO_P ())
- INIT_EXTRA_FRAME_INFO (0, fi);
-
- /* Select/initialize an unwind function. */
- set_unwind_by_pc (fi->pc, fi->frame, &fi->register_unwind);
-
- return fi;
-}
-
-/* Return the frame that FRAME calls (NULL if FRAME is the innermost
- frame). */
-
-struct frame_info *
-get_next_frame (struct frame_info *frame)
-{
- return frame->next;
-}
-
-/* Flush the entire frame cache. */
-
-void
-flush_cached_frames (void)
-{
- /* Since we can't really be sure what the first object allocated was */
- obstack_free (&frame_cache_obstack, 0);
- obstack_init (&frame_cache_obstack);
-
- current_frame = NULL; /* Invalidate cache */
- select_frame (NULL);
- annotate_frames_invalid ();
-}
-
-/* Flush the frame cache, and start a new one if necessary. */
-
-void
-reinit_frame_cache (void)
-{
- flush_cached_frames ();
-
- /* FIXME: The inferior_ptid test is wrong if there is a corefile. */
- if (PIDGET (inferior_ptid) != 0)
- {
- select_frame (get_current_frame ());
- }
-}
-
/* Return nonzero if the function for this frame lacks a prologue. Many
machines can define FRAMELESS_FUNCTION_INVOCATION to just call this
function. */
@@ -346,188 +195,6 @@ frameless_look_for_prologue (struct frame_info *frame)
return 0;
}
-/* Return a structure containing various interesting information
- about the frame that called NEXT_FRAME. Returns NULL
- if there is no such frame. */
-
-struct frame_info *
-get_prev_frame (struct frame_info *next_frame)
-{
- CORE_ADDR address = 0;
- struct frame_info *prev;
- int fromleaf = 0;
- char *name;
-
- /* If the requested entry is in the cache, return it.
- Otherwise, figure out what the address should be for the entry
- we're about to add to the cache. */
-
- if (!next_frame)
- {
-#if 0
- /* This screws value_of_variable, which just wants a nice clean
- NULL return from block_innermost_frame if there are no frames.
- I don't think I've ever seen this message happen otherwise.
- And returning NULL here is a perfectly legitimate thing to do. */
- if (!current_frame)
- {
- error ("You haven't set up a process's stack to examine.");
- }
-#endif
-
- return current_frame;
- }
-
- /* If we have the prev one, return it */
- if (next_frame->prev)
- return next_frame->prev;
-
- /* On some machines it is possible to call a function without
- setting up a stack frame for it. On these machines, we
- define this macro to take two args; a frameinfo pointer
- identifying a frame and a variable to set or clear if it is
- or isn't leafless. */
-
- /* Still don't want to worry about this except on the innermost
- frame. This macro will set FROMLEAF if NEXT_FRAME is a
- frameless function invocation. */
- if (!(next_frame->next))
- {
- fromleaf = FRAMELESS_FUNCTION_INVOCATION (next_frame);
- if (fromleaf)
- address = FRAME_FP (next_frame);
- }
-
- if (!fromleaf)
- {
- /* Two macros defined in tm.h specify the machine-dependent
- actions to be performed here.
- First, get the frame's chain-pointer.
- If that is zero, the frame is the outermost frame or a leaf
- called by the outermost frame. This means that if start
- calls main without a frame, we'll return 0 (which is fine
- anyway).
-
- Nope; there's a problem. This also returns when the current
- routine is a leaf of main. This is unacceptable. We move
- this to after the ffi test; I'd rather have backtraces from
- start go curfluy than have an abort called from main not show
- main. */
- address = FRAME_CHAIN (next_frame);
-
- /* FIXME: cagney/2002-06-08: There should be two tests here.
- The first would check for a valid frame chain based on a user
- selectable policy. The default being ``stop at main'' (as
- implemented by generic_func_frame_chain_valid()). Other
- policies would be available - stop at NULL, .... The second
- test, if provided by the target architecture, would check for
- more exotic cases - most target architectures wouldn't bother
- with this second case. */
- if (!FRAME_CHAIN_VALID (address, next_frame))
- return 0;
- }
- if (address == 0)
- return 0;
-
- prev = (struct frame_info *)
- obstack_alloc (&frame_cache_obstack,
- sizeof (struct frame_info));
-
- /* Zero all fields by default. */
- memset (prev, 0, sizeof (struct frame_info));
-
- if (next_frame)
- next_frame->prev = prev;
- prev->next = next_frame;
- prev->frame = address;
- prev->level = next_frame->level + 1;
-
-/* This change should not be needed, FIXME! We should
- determine whether any targets *need* INIT_FRAME_PC to happen
- after INIT_EXTRA_FRAME_INFO and come up with a simple way to
- express what goes on here.
-
- INIT_EXTRA_FRAME_INFO is called from two places: create_new_frame
- (where the PC is already set up) and here (where it isn't).
- INIT_FRAME_PC is only called from here, always after
- INIT_EXTRA_FRAME_INFO.
-
- The catch is the MIPS, where INIT_EXTRA_FRAME_INFO requires the PC
- value (which hasn't been set yet). Some other machines appear to
- require INIT_EXTRA_FRAME_INFO before they can do INIT_FRAME_PC. Phoo.
-
- We shouldn't need INIT_FRAME_PC_FIRST to add more complication to
- an already overcomplicated part of GDB. gnu@cygnus.com, 15Sep92.
-
- Assuming that some machines need INIT_FRAME_PC after
- INIT_EXTRA_FRAME_INFO, one possible scheme:
-
- SETUP_INNERMOST_FRAME()
- Default version is just create_new_frame (read_fp ()),
- read_pc ()). Machines with extra frame info would do that (or the
- local equivalent) and then set the extra fields.
- SETUP_ARBITRARY_FRAME(argc, argv)
- Only change here is that create_new_frame would no longer init extra
- frame info; SETUP_ARBITRARY_FRAME would have to do that.
- INIT_PREV_FRAME(fromleaf, prev)
- Replace INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC. This should
- also return a flag saying whether to keep the new frame, or
- whether to discard it, because on some machines (e.g. mips) it
- is really awkward to have FRAME_CHAIN_VALID called *before*
- INIT_EXTRA_FRAME_INFO (there is no good way to get information
- deduced in FRAME_CHAIN_VALID into the extra fields of the new frame).
- std_frame_pc(fromleaf, prev)
- This is the default setting for INIT_PREV_FRAME. It just does what
- the default INIT_FRAME_PC does. Some machines will call it from
- INIT_PREV_FRAME (either at the beginning, the end, or in the middle).
- Some machines won't use it.
- kingdon@cygnus.com, 13Apr93, 31Jan94, 14Dec94. */
-
- INIT_FRAME_PC_FIRST (fromleaf, prev);
-
- if (INIT_EXTRA_FRAME_INFO_P ())
- INIT_EXTRA_FRAME_INFO (fromleaf, prev);
-
- /* This entry is in the frame queue now, which is good since
- FRAME_SAVED_PC may use that queue to figure out its value
- (see tm-sparc.h). We want the pc saved in the inferior frame. */
- INIT_FRAME_PC (fromleaf, prev);
-
- /* If ->frame and ->pc are unchanged, we are in the process of getting
- ourselves into an infinite backtrace. Some architectures check this
- in FRAME_CHAIN or thereabouts, but it seems like there is no reason
- this can't be an architecture-independent check. */
- if (next_frame != NULL)
- {
- if (prev->frame == next_frame->frame
- && prev->pc == next_frame->pc)
- {
- next_frame->prev = NULL;
- obstack_free (&frame_cache_obstack, prev);
- return NULL;
- }
- }
-
- /* Initialize the code used to unwind the frame PREV based on the PC
- (and probably other architectural information). The PC lets you
- check things like the debug info at that point (dwarf2cfi?) and
- use that to decide how the frame should be unwound. */
- set_unwind_by_pc (prev->pc, prev->frame, &prev->register_unwind);
-
- find_pc_partial_function (prev->pc, &name,
- (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
- if (PC_IN_SIGTRAMP (prev->pc, name))
- prev->signal_handler_caller = 1;
-
- return prev;
-}
-
-CORE_ADDR
-get_frame_pc (struct frame_info *frame)
-{
- return frame->pc;
-}
-
/* return the address of the PC for the given FRAME, ie the current PC value
if FRAME is the innermost frame, or the address adjusted to point to the
call instruction if not. */
@@ -549,34 +216,6 @@ frame_address_in_block (struct frame_info *frame)
return pc;
}
-#ifdef FRAME_FIND_SAVED_REGS
-/* XXX - deprecated. This is a compatibility function for targets
- that do not yet implement FRAME_INIT_SAVED_REGS. */
-/* Find the addresses in which registers are saved in FRAME. */
-
-void
-get_frame_saved_regs (struct frame_info *frame,
- struct frame_saved_regs *saved_regs_addr)
-{
- if (frame->saved_regs == NULL)
- {
- frame->saved_regs = (CORE_ADDR *)
- frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
- }
- if (saved_regs_addr == NULL)
- {
- struct frame_saved_regs saved_regs;
- FRAME_FIND_SAVED_REGS (frame, saved_regs);
- memcpy (frame->saved_regs, &saved_regs, SIZEOF_FRAME_SAVED_REGS);
- }
- else
- {
- FRAME_FIND_SAVED_REGS (frame, *saved_regs_addr);
- memcpy (frame->saved_regs, saved_regs_addr, SIZEOF_FRAME_SAVED_REGS);
- }
-}
-#endif
-
/* Return the innermost lexical block in execution
in a specified stack frame. The frame address is assumed valid.
@@ -1029,25 +668,23 @@ sigtramp_saved_pc (struct frame_info *frame)
{
CORE_ADDR sigcontext_addr;
char *buf;
- int ptrbytes = TARGET_PTR_BIT / TARGET_CHAR_BIT;
+ int ptrbytes = TYPE_LENGTH (builtin_type_void_func_ptr);
int sigcontext_offs = (2 * TARGET_INT_BIT) / TARGET_CHAR_BIT;
buf = alloca (ptrbytes);
/* Get sigcontext address, it is the third parameter on the stack. */
if (frame->next)
- sigcontext_addr = read_memory_integer (FRAME_ARGS_ADDRESS (frame->next)
- + FRAME_ARGS_SKIP
- + sigcontext_offs,
- ptrbytes);
+ sigcontext_addr = read_memory_typed_address
+ (FRAME_ARGS_ADDRESS (frame->next) + FRAME_ARGS_SKIP + sigcontext_offs,
+ builtin_type_void_data_ptr);
else
- sigcontext_addr = read_memory_integer (read_register (SP_REGNUM)
- + sigcontext_offs,
- ptrbytes);
+ sigcontext_addr = read_memory_typed_address
+ (read_register (SP_REGNUM) + sigcontext_offs, builtin_type_void_data_ptr);
/* Don't cause a memory_error when accessing sigcontext in case the stack
layout has changed or the stack is corrupt. */
target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, ptrbytes);
- return extract_unsigned_integer (buf, ptrbytes);
+ return extract_typed_address (buf, builtin_type_void_func_ptr);
}
#endif /* SIGCONTEXT_PC_OFFSET */
@@ -1109,244 +746,6 @@ pc_in_call_dummy_at_entry_point (CORE_ADDR pc, CORE_ADDR sp,
}
-/*
- * GENERIC DUMMY FRAMES
- *
- * The following code serves to maintain the dummy stack frames for
- * inferior function calls (ie. when gdb calls into the inferior via
- * call_function_by_hand). This code saves the machine state before
- * the call in host memory, so we must maintain an independent stack
- * and keep it consistant etc. I am attempting to make this code
- * generic enough to be used by many targets.
- *
- * The cheapest and most generic way to do CALL_DUMMY on a new target
- * is probably to define CALL_DUMMY to be empty, CALL_DUMMY_LENGTH to
- * zero, and CALL_DUMMY_LOCATION to AT_ENTRY. Then you must remember
- * to define PUSH_RETURN_ADDRESS, because no call instruction will be
- * being executed by the target. Also FRAME_CHAIN_VALID as
- * generic_{file,func}_frame_chain_valid and FIX_CALL_DUMMY as
- * generic_fix_call_dummy. */
-
-/* Dummy frame. This saves the processor state just prior to setting
- up the inferior function call. Older targets save the registers
- on the target stack (but that really slows down function calls). */
-
-struct dummy_frame
-{
- struct dummy_frame *next;
-
- CORE_ADDR pc;
- CORE_ADDR fp;
- CORE_ADDR sp;
- CORE_ADDR top;
- struct regcache *regcache;
-
- /* Address range of the call dummy code. Look for PC in the range
- [LO..HI) (after allowing for DECR_PC_AFTER_BREAK). */
- CORE_ADDR call_lo;
- CORE_ADDR call_hi;
-};
-
-static struct dummy_frame *dummy_frame_stack = NULL;
-
-/* Function: find_dummy_frame(pc, fp, sp)
-
- Search the stack of dummy frames for one matching the given PC and
- FP/SP. Unlike PC_IN_CALL_DUMMY, this function doesn't need to
- adjust for DECR_PC_AFTER_BREAK. This is because it is only legal
- to call this function after the PC has been adjusted. */
-
-static struct regcache *
-generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
-{
- struct dummy_frame *dummyframe;
-
- for (dummyframe = dummy_frame_stack; dummyframe != NULL;
- dummyframe = dummyframe->next)
- {
- /* Does the PC fall within the dummy frame's breakpoint
- instruction. If not, discard this one. */
- if (!(pc >= dummyframe->call_lo && pc < dummyframe->call_hi))
- continue;
- /* Does the FP match? */
- if (dummyframe->top != 0)
- {
- /* If the target architecture explicitly saved the
- top-of-stack before the inferior function call, assume
- that that same architecture will always pass in an FP
- (frame base) value that eactly matches that saved TOS.
- Don't check the saved SP and SP as they can lead to false
- hits. */
- if (fp != dummyframe->top)
- continue;
- }
- else
- {
- /* An older target that hasn't explicitly or implicitly
- saved the dummy frame's top-of-stack. Try matching the
- FP against the saved SP and FP. NOTE: If you're trying
- to fix a problem with GDB not correctly finding a dummy
- frame, check the comments that go with FRAME_ALIGN() and
- SAVE_DUMMY_FRAME_TOS(). */
- if (fp != dummyframe->fp && fp != dummyframe->sp)
- continue;
- }
- /* The FP matches this dummy frame. */
- return dummyframe->regcache;
- }
-
- return 0;
-}
-
-char *
-deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
-{
- struct regcache *regcache = generic_find_dummy_frame (pc, fp);
- if (regcache == NULL)
- return NULL;
- return deprecated_grub_regcache_for_registers (regcache);
-}
-
-/* Function: pc_in_call_dummy (pc, sp, fp)
-
- Return true if the PC falls in a dummy frame created by gdb for an
- inferior call. The code below which allows DECR_PC_AFTER_BREAK is
- for infrun.c, which may give the function a PC without that
- subtracted out. */
-
-int
-generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
-{
- struct dummy_frame *dummyframe;
- for (dummyframe = dummy_frame_stack;
- dummyframe != NULL;
- dummyframe = dummyframe->next)
- {
- if ((pc >= dummyframe->call_lo)
- && (pc < dummyframe->call_hi + DECR_PC_AFTER_BREAK))
- return 1;
- }
- return 0;
-}
-
-/* Function: read_register_dummy
- Find a saved register from before GDB calls a function in the inferior */
-
-CORE_ADDR
-deprecated_read_register_dummy (CORE_ADDR pc, CORE_ADDR fp, int regno)
-{
- struct regcache *dummy_regs = generic_find_dummy_frame (pc, fp);
-
- if (dummy_regs)
- {
- /* NOTE: cagney/2002-08-12: Replaced a call to
- regcache_raw_read_as_address() with a call to
- regcache_cooked_read_unsigned(). The old, ...as_address
- function was eventually calling extract_unsigned_integer (via
- extract_address) to unpack the registers value. The below is
- doing an unsigned extract so that it is functionally
- equivalent. The read needs to be cooked as, otherwise, it
- will never correctly return the value of a register in the
- [NUM_REGS .. NUM_REGS+NUM_PSEUDO_REGS) range. */
- ULONGEST val;
- regcache_cooked_read_unsigned (dummy_regs, regno, &val);
- return val;
- }
- else
- return 0;
-}
-
-/* Save all the registers on the dummy frame stack. Most ports save the
- registers on the target stack. This results in lots of unnecessary memory
- references, which are slow when debugging via a serial line. Instead, we
- save all the registers internally, and never write them to the stack. The
- registers get restored when the called function returns to the entry point,
- where a breakpoint is laying in wait. */
-
-void
-generic_push_dummy_frame (void)
-{
- struct dummy_frame *dummy_frame;
- CORE_ADDR fp = (get_current_frame ())->frame;
-
- /* check to see if there are stale dummy frames,
- perhaps left over from when a longjump took us out of a
- function that was called by the debugger */
-
- dummy_frame = dummy_frame_stack;
- while (dummy_frame)
- if (INNER_THAN (dummy_frame->fp, fp)) /* stale -- destroy! */
- {
- dummy_frame_stack = dummy_frame->next;
- regcache_xfree (dummy_frame->regcache);
- xfree (dummy_frame);
- dummy_frame = dummy_frame_stack;
- }
- else
- dummy_frame = dummy_frame->next;
-
- dummy_frame = xmalloc (sizeof (struct dummy_frame));
- dummy_frame->regcache = regcache_xmalloc (current_gdbarch);
-
- dummy_frame->pc = read_pc ();
- dummy_frame->sp = read_sp ();
- dummy_frame->top = 0;
- dummy_frame->fp = fp;
- regcache_cpy (dummy_frame->regcache, current_regcache);
- dummy_frame->next = dummy_frame_stack;
- dummy_frame_stack = dummy_frame;
-}
-
-void
-generic_save_dummy_frame_tos (CORE_ADDR sp)
-{
- dummy_frame_stack->top = sp;
-}
-
-/* Record the upper/lower bounds on the address of the call dummy. */
-
-void
-generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi)
-{
- dummy_frame_stack->call_lo = lo;
- dummy_frame_stack->call_hi = hi;
-}
-
-/* Restore the machine state from either the saved dummy stack or a
- real stack frame. */
-
-void
-generic_pop_current_frame (void (*popper) (struct frame_info * frame))
-{
- struct frame_info *frame = get_current_frame ();
-
- if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
- generic_pop_dummy_frame ();
- else
- (*popper) (frame);
-}
-
-/* Function: pop_dummy_frame
- Restore the machine state from a saved dummy stack frame. */
-
-void
-generic_pop_dummy_frame (void)
-{
- struct dummy_frame *dummy_frame = dummy_frame_stack;
-
- /* FIXME: what if the first frame isn't the right one, eg..
- because one call-by-hand function has done a longjmp into another one? */
-
- if (!dummy_frame)
- error ("Can't pop dummy frame!");
- dummy_frame_stack = dummy_frame->next;
- regcache_cpy (current_regcache, dummy_frame->regcache);
- flush_cached_frames ();
-
- regcache_xfree (dummy_frame->regcache);
- xfree (dummy_frame);
-}
-
/* Function: frame_chain_valid
Returns true for a user frame or a call_function_by_hand dummy frame,
and false for the CRT0 start-up frame. Purpose is to terminate backtrace */
@@ -1375,256 +774,3 @@ generic_func_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi)
&& !inside_entry_func ((fi)->pc));
}
-/* Function: fix_call_dummy
- Stub function. Generic dummy frames typically do not need to fix
- the frame being created */
-
-void
-generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
- struct value **args, struct type *type, int gcc_p)
-{
- return;
-}
-
-/* Given a call-dummy dummy-frame, return the registers. Here the
- register value is taken from the local copy of the register buffer. */
-
-static void
-generic_call_dummy_register_unwind (struct frame_info *frame, void **cache,
- int regnum, int *optimized,
- enum lval_type *lvalp, CORE_ADDR *addrp,
- int *realnum, void *bufferp)
-{
- gdb_assert (frame != NULL);
- gdb_assert (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame));
-
- /* Describe the register's location. Generic dummy frames always
- have the register value in an ``expression''. */
- *optimized = 0;
- *lvalp = not_lval;
- *addrp = 0;
- *realnum = -1;
-
- /* If needed, find and return the value of the register. */
- if (bufferp != NULL)
- {
- struct regcache *registers;
-#if 1
- /* Get the address of the register buffer that contains all the
- saved registers for this dummy frame. Cache that address. */
- registers = (*cache);
- if (registers == NULL)
- {
- registers = generic_find_dummy_frame (frame->pc, frame->frame);
- (*cache) = registers;
- }
-#else
- /* Get the address of the register buffer that contains the
- saved registers and then extract the value from that. */
- registers = generic_find_dummy_frame (frame->pc, frame->frame);
-#endif
- gdb_assert (registers != NULL);
- /* Return the actual value. */
- /* Use the regcache_cooked_read() method so that it, on the fly,
- constructs either a raw or pseudo register from the raw
- register cache. */
- regcache_cooked_read (registers, regnum, bufferp);
- }
-}
-
-/* Return the register saved in the simplistic ``saved_regs'' cache.
- If the value isn't here AND a value is needed, try the next inner
- most frame. */
-
-static void
-frame_saved_regs_register_unwind (struct frame_info *frame, void **cache,
- int regnum, int *optimizedp,
- enum lval_type *lvalp, CORE_ADDR *addrp,
- int *realnump, void *bufferp)
-{
- /* There is always a frame at this point. And THIS is the frame
- we're interested in. */
- gdb_assert (frame != NULL);
- /* If we're using generic dummy frames, we'd better not be in a call
- dummy. (generic_call_dummy_register_unwind ought to have been called
- instead.) */
- gdb_assert (!(USE_GENERIC_DUMMY_FRAMES
- && PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)));
-
- /* Load the saved_regs register cache. */
- if (frame->saved_regs == NULL)
- FRAME_INIT_SAVED_REGS (frame);
-
- if (frame->saved_regs != NULL
- && frame->saved_regs[regnum] != 0)
- {
- if (regnum == SP_REGNUM)
- {
- /* SP register treated specially. */
- *optimizedp = 0;
- *lvalp = not_lval;
- *addrp = 0;
- *realnump = -1;
- if (bufferp != NULL)
- store_address (bufferp, REGISTER_RAW_SIZE (regnum),
- frame->saved_regs[regnum]);
- }
- else
- {
- /* Any other register is saved in memory, fetch it but cache
- a local copy of its value. */
- *optimizedp = 0;
- *lvalp = lval_memory;
- *addrp = frame->saved_regs[regnum];
- *realnump = -1;
- if (bufferp != NULL)
- {
-#if 1
- /* Save each register value, as it is read in, in a
- frame based cache. */
- void **regs = (*cache);
- if (regs == NULL)
- {
- int sizeof_cache = ((NUM_REGS + NUM_PSEUDO_REGS)
- * sizeof (void *));
- regs = frame_obstack_alloc (sizeof_cache);
- memset (regs, 0, sizeof_cache);
- (*cache) = regs;
- }
- if (regs[regnum] == NULL)
- {
- regs[regnum]
- = frame_obstack_alloc (REGISTER_RAW_SIZE (regnum));
- read_memory (frame->saved_regs[regnum], regs[regnum],
- REGISTER_RAW_SIZE (regnum));
- }
- memcpy (bufferp, regs[regnum], REGISTER_RAW_SIZE (regnum));
-#else
- /* Read the value in from memory. */
- read_memory (frame->saved_regs[regnum], bufferp,
- REGISTER_RAW_SIZE (regnum));
-#endif
- }
- }
- return;
- }
-
- /* No luck, assume this and the next frame have the same register
- value. If a value is needed, pass the request on down the chain;
- otherwise just return an indication that the value is in the same
- register as the next frame. */
- if (bufferp == NULL)
- {
- *optimizedp = 0;
- *lvalp = lval_register;
- *addrp = 0;
- *realnump = regnum;
- }
- else
- {
- frame_register_unwind (frame->next, regnum, optimizedp, lvalp, addrp,
- realnump, bufferp);
- }
-}
-
-/* Function: get_saved_register
- Find register number REGNUM relative to FRAME and put its (raw,
- target format) contents in *RAW_BUFFER.
-
- Set *OPTIMIZED if the variable was optimized out (and thus can't be
- fetched). Note that this is never set to anything other than zero
- in this implementation.
-
- Set *LVAL to lval_memory, lval_register, or not_lval, depending on
- whether the value was fetched from memory, from a register, or in a
- strange and non-modifiable way (e.g. a frame pointer which was
- calculated rather than fetched). We will use not_lval for values
- fetched from generic dummy frames.
-
- Set *ADDRP to the address, either in memory or as a REGISTER_BYTE
- offset into the registers array. If the value is stored in a dummy
- frame, set *ADDRP to zero.
-
- To use this implementation, define a function called
- "get_saved_register" in your target code, which simply passes all
- of its arguments to this function.
-
- The argument RAW_BUFFER must point to aligned memory. */
-
-void
-generic_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
- struct frame_info *frame, int regnum,
- enum lval_type *lval)
-{
- if (!target_has_registers)
- error ("No registers.");
-
- /* Normal systems don't optimize out things with register numbers. */
- if (optimized != NULL)
- *optimized = 0;
-
- if (addrp) /* default assumption: not found in memory */
- *addrp = 0;
-
- /* Note: since the current frame's registers could only have been
- saved by frames INTERIOR TO the current frame, we skip examining
- the current frame itself: otherwise, we would be getting the
- previous frame's registers which were saved by the current frame. */
-
- while (frame && ((frame = frame->next) != NULL))
- {
- if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
- {
- if (lval) /* found it in a CALL_DUMMY frame */
- *lval = not_lval;
- if (raw_buffer)
- /* FIXME: cagney/2002-06-26: This should be via the
- gdbarch_register_read() method so that it, on the fly,
- constructs either a raw or pseudo register from the raw
- register cache. */
- regcache_raw_read (generic_find_dummy_frame (frame->pc,
- frame->frame),
- regnum, raw_buffer);
- return;
- }
-
- FRAME_INIT_SAVED_REGS (frame);
- if (frame->saved_regs != NULL
- && frame->saved_regs[regnum] != 0)
- {
- if (lval) /* found it saved on the stack */
- *lval = lval_memory;
- if (regnum == SP_REGNUM)
- {
- if (raw_buffer) /* SP register treated specially */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
- frame->saved_regs[regnum]);
- }
- else
- {
- if (addrp) /* any other register */
- *addrp = frame->saved_regs[regnum];
- if (raw_buffer)
- read_memory (frame->saved_regs[regnum], raw_buffer,
- REGISTER_RAW_SIZE (regnum));
- }
- return;
- }
- }
-
- /* If we get thru the loop to this point, it means the register was
- not saved in any frame. Return the actual live-register value. */
-
- if (lval) /* found it in a live register */
- *lval = lval_register;
- if (addrp)
- *addrp = REGISTER_BYTE (regnum);
- if (raw_buffer)
- read_register_gen (regnum, raw_buffer);
-}
-
-void
-_initialize_blockframe (void)
-{
- obstack_init (&frame_cache_obstack);
-}
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index a77bff405a9..183d8a4b795 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1688,7 +1688,7 @@ breakpoint_inserted_here_p (CORE_ADDR pc)
bp_call_dummy breakpoint. */
int
-frame_in_dummy (struct frame_info *frame)
+deprecated_frame_in_dummy (struct frame_info *frame)
{
struct breakpoint *b;
@@ -3884,7 +3884,7 @@ create_internal_breakpoint (CORE_ADDR address, enum bptype type)
struct symtab_and_line sal;
struct breakpoint *b;
- INIT_SAL (&sal); /* initialize to zeroes */
+ init_sal (&sal); /* initialize to zeroes */
sal.pc = address;
sal.section = find_pc_overlay (sal.pc);
@@ -4204,7 +4204,7 @@ create_fork_vfork_event_catchpoint (int tempflag, char *cond_string,
struct breakpoint *b;
int thread = -1; /* All threads. */
- INIT_SAL (&sal);
+ init_sal (&sal);
sal.pc = 0;
sal.symtab = NULL;
sal.line = 0;
@@ -4243,7 +4243,7 @@ create_exec_event_catchpoint (int tempflag, char *cond_string)
struct breakpoint *b;
int thread = -1; /* All threads. */
- INIT_SAL (&sal);
+ init_sal (&sal);
sal.pc = 0;
sal.symtab = NULL;
sal.line = 0;
@@ -4600,7 +4600,7 @@ parse_breakpoint_sals (char **address,
if (default_breakpoint_valid)
{
struct symtab_and_line sal;
- INIT_SAL (&sal); /* initialize to zeroes */
+ init_sal (&sal); /* initialize to zeroes */
sals->sals = (struct symtab_and_line *)
xmalloc (sizeof (struct symtab_and_line));
sal.pc = default_breakpoint_address;
@@ -4618,13 +4618,16 @@ parse_breakpoint_sals (char **address,
/* Force almost all breakpoints to be in terms of the
current_source_symtab (which is decode_line_1's default). This
should produce the results we want almost all of the time while
- leaving default_breakpoint_* alone. */
+ leaving default_breakpoint_* alone.
+ ObjC: However, don't match an Objective-C method name which
+ may have a '+' or '-' succeeded by a '[' */
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
if (default_breakpoint_valid
&& (!cursal.symtab
- || (strchr ("+-", (*address)[0]) != NULL)))
+ || ((strchr ("+-", (*address)[0]) != NULL)
+ && ((*address)[1] != '['))))
*sals = decode_line_1 (address, 1, default_breakpoint_symtab,
default_breakpoint_line, addr_string);
else
@@ -5293,7 +5296,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
enum bptype bp_type;
int mem_cnt = 0;
- INIT_SAL (&sal); /* initialize to zeroes */
+ init_sal (&sal); /* initialize to zeroes */
/* Parse arguments. */
innermost_block = NULL;
@@ -6259,7 +6262,7 @@ handle_gnu_4_16_catch_command (char *arg, int tempflag, int from_tty)
char *save_arg;
int i;
- INIT_SAL (&sal); /* initialize to zeroes */
+ init_sal (&sal); /* initialize to zeroes */
/* If no arg given, or if first arg is 'if ', all active catch clauses
are breakpointed. */
@@ -6530,7 +6533,7 @@ clear_command (char *arg, int from_tty)
sals.sals = (struct symtab_and_line *)
xmalloc (sizeof (struct symtab_and_line));
make_cleanup (xfree, sals.sals);
- INIT_SAL (&sal); /* initialize to zeroes */
+ init_sal (&sal); /* initialize to zeroes */
sal.line = default_breakpoint_line;
sal.symtab = default_breakpoint_symtab;
sal.pc = default_breakpoint_address;
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 226703b5938..3abdca74690 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -528,7 +528,16 @@ extern enum breakpoint_here breakpoint_here_p (CORE_ADDR);
extern int breakpoint_inserted_here_p (CORE_ADDR);
-extern int frame_in_dummy (struct frame_info *);
+/* FIXME: cagney/2002-11-10: The current [generic] dummy-frame code
+ implements a functional superset of this function. The only reason
+ it hasn't been removed is because some architectures still don't
+ use the new framework. Once they have been fixed, this can go. */
+/* FIXME: cagney/2002-11-10: There should be a function (hmm,
+ something like, enum { NORMAL_FRAME, DUMMY_FRAME, SIGTRAMP_FRAME }
+ get_frame_type() ...) that the caller can use to determine the
+ frame's type. This could replace this function, PC_IN_CALL_DUMMY,
+ and fi->signal_handler_caller. */
+extern int deprecated_frame_in_dummy (struct frame_info *);
extern int breakpoint_thread_match (CORE_ADDR, ptid_t);
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 9d9b4f74482..09e81228aea 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -30,7 +30,7 @@
#include "bfd.h"
#include "gdb_obstack.h"
#include "symtab.h"
-#include "symfile.h" /* Needed for "struct complaint" */
+#include "symfile.h"
#include "objfiles.h"
#include "gdbtypes.h"
#include "complaints.h"
@@ -74,19 +74,19 @@ static int compare_line_numbers (const void *ln1p, const void *ln2p);
/* Complaints about the symbols we have encountered. */
-struct complaint block_end_complaint =
+struct deprecated_complaint block_end_complaint =
{"block end address less than block start address in %s (patched it)", 0, 0};
-struct complaint anon_block_end_complaint =
+struct deprecated_complaint anon_block_end_complaint =
{"block end address 0x%lx less than block start address 0x%lx (patched it)", 0, 0};
-struct complaint innerblock_complaint =
+struct deprecated_complaint innerblock_complaint =
{"inner block not inside outer block in %s", 0, 0};
-struct complaint innerblock_anon_complaint =
+struct deprecated_complaint innerblock_anon_complaint =
{"inner block (0x%lx-0x%lx) not inside outer block (0x%lx-0x%lx)", 0, 0};
-struct complaint blockvector_complaint =
+struct deprecated_complaint blockvector_complaint =
{"block at %s out of order", 0, 0};
/* maintain the lists of symbols and blocks */
@@ -869,7 +869,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
same. FIXME: Find out why it is happening. This is not
believed to happen in most cases (even for coffread.c);
it used to be an abort(). */
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"Context stack not empty in end_symtab", 0, 0};
complain (&msg);
context_stack_depth = 0;
diff --git a/gdb/buildsym.h b/gdb/buildsym.h
index 8a252cb2b4c..968a5793845 100644
--- a/gdb/buildsym.h
+++ b/gdb/buildsym.h
@@ -179,6 +179,9 @@ EXTERN int context_stack_size;
#define pop_context() (&context_stack[--context_stack_depth]);
+/* Non-zero if the context stack is empty. */
+#define outermost_context_p() (context_stack_depth == 0)
+
/* Nonzero if within a function (so symbols should be local, if
nothing says specifically). */
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 376f6d56370..9df0aee428f 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -199,7 +199,6 @@ static int parse_number (char *, int, int, YYSTYPE *);
%token <opcode> ASSIGN_MODIFY
/* C++ */
-%token THIS
%token TRUEKEYWORD
%token FALSEKEYWORD
@@ -248,9 +247,11 @@ exp1 : exp
/* Expressions, not including the comma operator. */
exp : '*' exp %prec UNARY
{ write_exp_elt_opcode (UNOP_IND); }
+ ;
exp : '&' exp %prec UNARY
{ write_exp_elt_opcode (UNOP_ADDR); }
+ ;
exp : '-' exp %prec UNARY
{ write_exp_elt_opcode (UNOP_NEG); }
@@ -532,11 +533,6 @@ exp : STRING
;
/* C++. */
-exp : THIS
- { write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (OP_THIS); }
- ;
-
exp : TRUEKEYWORD
{ write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (builtin_type_bool);
@@ -1615,17 +1611,6 @@ yylex ()
{
if (STREQN (tokstart, "true", 4))
return TRUEKEYWORD;
-
- if (STREQN (tokstart, "this", 4))
- {
- static const char this_name[] =
- { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' };
-
- if (lookup_symbol (this_name, expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
- (struct symtab **) NULL))
- return THIS;
- }
}
break;
case 3:
diff --git a/gdb/c-lang.h b/gdb/c-lang.h
index e64d4c69e90..7d7cd03a557 100644
--- a/gdb/c-lang.h
+++ b/gdb/c-lang.h
@@ -65,9 +65,6 @@ extern struct type **const (c_builtin_types[]);
extern void c_type_print_base (struct type *, struct ui_file *, int, int);
-extern void c_type_print_varspec_prefix (struct type *, struct ui_file *,
- int, int);
-
/* These are in cp-valprint.c */
extern int vtblprint; /* Controls printing of vtbl's */
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index bede1948211..6c5e815e2af 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -49,8 +49,8 @@ static void c_type_print_args (struct type *, struct ui_file *);
static void cp_type_print_derivation_info (struct ui_file *, struct type *);
-void c_type_print_varspec_prefix (struct type *, struct ui_file *, int,
- int);
+static void c_type_print_varspec_prefix (struct type *, struct ui_file *, int,
+ int, int);
/* Print "const", "volatile", or address space modifiers. */
static void c_type_print_modifier (struct type *, struct ui_file *,
@@ -67,6 +67,7 @@ c_print_type (struct type *type, char *varstring, struct ui_file *stream,
{
register enum type_code code;
int demangled_args;
+ int need_post_space;
if (show > 0)
CHECK_TYPEDEF (type);
@@ -85,7 +86,8 @@ c_print_type (struct type *type, char *varstring, struct ui_file *stream,
|| code == TYPE_CODE_MEMBER
|| code == TYPE_CODE_REF)))
fputs_filtered (" ", stream);
- c_type_print_varspec_prefix (type, stream, show, 0);
+ need_post_space = (varstring != NULL && strcmp (varstring, "") != 0);
+ c_type_print_varspec_prefix (type, stream, show, 0, need_post_space);
if (varstring != NULL)
{
@@ -192,11 +194,15 @@ cp_type_print_method_args (struct type *mtype, char *prefix, char *varstring,
On outermost call, pass 0 for PASSED_A_PTR.
On outermost call, SHOW > 0 means should ignore
any typename for TYPE and show its details.
- SHOW is always zero on recursive calls. */
+ SHOW is always zero on recursive calls.
+
+ NEED_POST_SPACE is non-zero when a space will be be needed
+ between a trailing qualifier and a field, variable, or function
+ name. */
void
c_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
- int show, int passed_a_ptr)
+ int show, int passed_a_ptr, int need_post_space)
{
char *name;
if (type == 0)
@@ -210,15 +216,15 @@ c_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
switch (TYPE_CODE (type))
{
case TYPE_CODE_PTR:
- c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
+ c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1, 1);
fprintf_filtered (stream, "*");
- c_type_print_modifier (type, stream, 1, 0);
+ c_type_print_modifier (type, stream, 1, need_post_space);
break;
case TYPE_CODE_MEMBER:
if (passed_a_ptr)
fprintf_filtered (stream, "(");
- c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
+ c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
fprintf_filtered (stream, " ");
name = type_name_no_tag (TYPE_DOMAIN_TYPE (type));
if (name)
@@ -231,7 +237,7 @@ c_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
case TYPE_CODE_METHOD:
if (passed_a_ptr)
fprintf_filtered (stream, "(");
- c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
+ c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
if (passed_a_ptr)
{
fprintf_filtered (stream, " ");
@@ -241,19 +247,19 @@ c_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
break;
case TYPE_CODE_REF:
- c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
+ c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0);
fprintf_filtered (stream, "&");
- c_type_print_modifier (type, stream, 1, 0);
+ c_type_print_modifier (type, stream, 1, need_post_space);
break;
case TYPE_CODE_FUNC:
- c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
+ c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
if (passed_a_ptr)
fprintf_filtered (stream, "(");
break;
case TYPE_CODE_ARRAY:
- c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
+ c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
if (passed_a_ptr)
fprintf_filtered (stream, "(");
break;
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index c44975adebf..9d582917709 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -27,10 +27,13 @@
#include "gdb_string.h"
#include "linespec.h"
#include "expression.h"
+#include "frame.h"
+#include "value.h"
#include "language.h"
#include "filenames.h" /* for DOSish file names */
#include "objfiles.h"
#include "source.h"
+#include "disasm.h"
#include "ui-out.h"
@@ -819,6 +822,92 @@ list_command (char *arg, int from_tty)
0);
}
+/* Dump a specified section of assembly code. With no command line
+ arguments, this command will dump the assembly code for the
+ function surrounding the pc value in the selected frame. With one
+ argument, it will dump the assembly code surrounding that pc value.
+ Two arguments are interpeted as bounds within which to dump
+ assembly. */
+
+/* ARGSUSED */
+static void
+disassemble_command (char *arg, int from_tty)
+{
+ CORE_ADDR low, high;
+ char *name;
+ CORE_ADDR pc, pc_masked;
+ char *space_index;
+#if 0
+ asection *section;
+#endif
+
+ name = NULL;
+ if (!arg)
+ {
+ if (!selected_frame)
+ error ("No frame selected.\n");
+
+ pc = get_frame_pc (selected_frame);
+ if (find_pc_partial_function (pc, &name, &low, &high) == 0)
+ error ("No function contains program counter for selected frame.\n");
+#if defined(TUI)
+ else if (tui_version)
+ low = tuiGetLowDisassemblyAddress (low, pc);
+#endif
+ low += FUNCTION_START_OFFSET;
+ }
+ else if (!(space_index = (char *) strchr (arg, ' ')))
+ {
+ /* One argument. */
+ pc = parse_and_eval_address (arg);
+ if (find_pc_partial_function (pc, &name, &low, &high) == 0)
+ error ("No function contains specified address.\n");
+#if defined(TUI)
+ else if (tui_version)
+ low = tuiGetLowDisassemblyAddress (low, pc);
+#endif
+ low += FUNCTION_START_OFFSET;
+ }
+ else
+ {
+ /* Two arguments. */
+ *space_index = '\0';
+ low = parse_and_eval_address (arg);
+ high = parse_and_eval_address (space_index + 1);
+ }
+
+#if defined(TUI)
+ if (!tui_is_window_visible (DISASSEM_WIN))
+#endif
+ {
+ printf_filtered ("Dump of assembler code ");
+ if (name != NULL)
+ {
+ printf_filtered ("for function %s:\n", name);
+ }
+ else
+ {
+ printf_filtered ("from ");
+ print_address_numeric (low, 1, gdb_stdout);
+ printf_filtered (" to ");
+ print_address_numeric (high, 1, gdb_stdout);
+ printf_filtered (":\n");
+ }
+
+ /* Dump the specified range. */
+ gdb_disassembly (uiout, 0, 0, 0, -1, low, high);
+
+ printf_filtered ("End of assembler dump.\n");
+ gdb_flush (gdb_stdout);
+ }
+#if defined(TUI)
+ else
+ {
+ tui_show_assembly (low);
+ }
+#endif
+}
+
static void
make_command (char *arg, int from_tty)
{
@@ -1157,6 +1246,14 @@ With two args if one is empty it stands for ten lines away from the other arg.",
if (dbx_commands)
add_com_alias ("file", "list", class_files, 1);
+ c = add_com ("disassemble", class_vars, disassemble_command,
+ "Disassemble a specified section of memory.\n\
+Default is the function surrounding the pc of the selected frame.\n\
+With a single argument, the function surrounding that address is dumped.\n\
+Two arguments are taken as a range of memory to dump.");
+ set_cmd_completer (c, location_completer);
+ if (xdb_commands)
+ add_com_alias ("va", "disassemble", class_xdb, 0);
/* NOTE: cagney/2000-03-20: Being able to enter ``(gdb) !ls'' would
be a really useful feature. Unfortunately, the below wont do
diff --git a/gdb/coffread.c b/gdb/coffread.c
index d794a7d382a..7872624b682 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -124,37 +124,37 @@ static struct symbol *opaque_type_chain[HASHSIZE];
/* Complaints about various problems in the file being read */
-struct complaint ef_complaint =
+struct deprecated_complaint ef_complaint =
{"Unmatched .ef symbol(s) ignored starting at symnum %d", 0, 0};
-struct complaint ef_stack_complaint =
+struct deprecated_complaint ef_stack_complaint =
{"`.ef' symbol without matching `.bf' symbol ignored starting at symnum %d", 0, 0};
-struct complaint eb_stack_complaint =
+struct deprecated_complaint eb_stack_complaint =
{"`.eb' symbol without matching `.bb' symbol ignored starting at symnum %d", 0, 0};
-struct complaint bf_no_aux_complaint =
+struct deprecated_complaint bf_no_aux_complaint =
{"`.bf' symbol %d has no aux entry", 0, 0};
-struct complaint ef_no_aux_complaint =
+struct deprecated_complaint ef_no_aux_complaint =
{"`.ef' symbol %d has no aux entry", 0, 0};
-struct complaint lineno_complaint =
+struct deprecated_complaint lineno_complaint =
{"Line number pointer %d lower than start of line numbers", 0, 0};
-struct complaint unexpected_type_complaint =
+struct deprecated_complaint unexpected_type_complaint =
{"Unexpected type for symbol %s", 0, 0};
-struct complaint bad_sclass_complaint =
+struct deprecated_complaint bad_sclass_complaint =
{"Bad n_sclass for symbol %s", 0, 0};
-struct complaint misordered_blocks_complaint =
+struct deprecated_complaint misordered_blocks_complaint =
{"Blocks out of order at address %x", 0, 0};
-struct complaint tagndx_bad_complaint =
+struct deprecated_complaint tagndx_bad_complaint =
{"Symbol table entry for %s has bad tagndx value", 0, 0};
-struct complaint eb_complaint =
+struct deprecated_complaint eb_complaint =
{"Mismatched .eb symbol ignored starting at symnum %d", 0, 0};
/* Simplified internal version of coff symbol table information */
@@ -1997,6 +1997,7 @@ coff_read_struct_type (int index, int length, int lastsym)
FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux);
FIELD_BITPOS (list->field) = 8 * ms->c_value;
FIELD_BITSIZE (list->field) = 0;
+ FIELD_STATIC_KIND (list->field) = 0;
nfields++;
break;
@@ -2015,6 +2016,7 @@ coff_read_struct_type (int index, int length, int lastsym)
FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux);
FIELD_BITPOS (list->field) = ms->c_value;
FIELD_BITSIZE (list->field) = sub_aux.x_sym.x_misc.x_lnsz.x_size;
+ FIELD_STATIC_KIND (list->field) = 0;
nfields++;
break;
@@ -2135,6 +2137,7 @@ coff_read_enum_type (int index, int length, int lastsym)
if (SYMBOL_VALUE (xsym) < 0)
unsigned_enum = 0;
TYPE_FIELD_BITSIZE (type, n) = 0;
+ TYPE_FIELD_STATIC_KIND (type, n) = 0;
}
if (syms == osyms)
break;
diff --git a/gdb/complaints.c b/gdb/complaints.c
index 84cf6a2e303..b4c55dab7df 100644
--- a/gdb/complaints.c
+++ b/gdb/complaints.c
@@ -250,7 +250,7 @@ internal_complaint (struct complaints **complaints, const char *file,
}
void
-complain (struct complaint *complaint, ...)
+complain (struct deprecated_complaint *complaint, ...)
{
va_list args;
va_start (args, complaint);
diff --git a/gdb/complaints.h b/gdb/complaints.h
index c176b190588..159dcd13bce 100644
--- a/gdb/complaints.h
+++ b/gdb/complaints.h
@@ -50,9 +50,15 @@ extern void clear_complaints (struct complaints **complaints,
int less_verbose, int noisy);
-/* Legacy interfaces to keep the old code working (until it is all
- converted to the above). While the structure below contains a
- number of fields, all but .message are ignored.
+/* Deprecated interfaces to keep the old code working (until it is all
+ converted to the above). Existing code such as:
+
+ struct deprecated_complaint msg = { "msg", 0, 0 };
+ complaint (&msg);
+
+ should be replaced by:
+
+ complaint (&symtab_complaints, __FILE__, __LINE__, "msg");
Support for complaining about things in the symbol file that aren't
catastrophic.
@@ -61,13 +67,13 @@ extern void clear_complaints (struct complaints **complaints,
during a symbol read, we report it. At the end of symbol reading,
if verbose, we report how many of each problem we had. */
-struct complaint
+struct deprecated_complaint
{
const char *message;
unsigned counter_ignored;
- struct complaint *next_ignored;
+ struct deprecated_complaint *next_ignored;
};
-extern void complain (struct complaint *, ...);
+extern void complain (struct deprecated_complaint *, ...);
#endif /* !defined (COMPLAINTS_H) */
diff --git a/gdb/config.in b/gdb/config.in
index 8c1c7bf356e..fa1ab9aef70 100644
--- a/gdb/config.in
+++ b/gdb/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 on AIX 3.
System headers sometimes define this.
@@ -514,3 +514,6 @@
/* Define if <sys/procfs.h> has pr_siginfo64_t. */
#undef HAVE_PR_SIGINFO64_T
+/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
+#undef THREAD_DB_HAS_TD_NOTALLOC
+
diff --git a/gdb/config/alpha/nm-fbsd.h b/gdb/config/alpha/nm-fbsd.h
index f3fb129997c..9e727091869 100644
--- a/gdb/config/alpha/nm-fbsd.h
+++ b/gdb/config/alpha/nm-fbsd.h
@@ -32,7 +32,7 @@
#define ATTACH_DETACH
/* The Alpha does not step over a breakpoint. */
-#define CANNOT_STEP_BREAKPOINT
+#define CANNOT_STEP_BREAKPOINT 1
/* Shared library support. */
diff --git a/gdb/config/alpha/nm-linux.h b/gdb/config/alpha/nm-linux.h
index 990ccb45d97..fed32e7930b 100644
--- a/gdb/config/alpha/nm-linux.h
+++ b/gdb/config/alpha/nm-linux.h
@@ -39,7 +39,7 @@
/* The alpha does not step over a breakpoint, the manpage is lying again. */
-#define CANNOT_STEP_BREAKPOINT
+#define CANNOT_STEP_BREAKPOINT 1
/* Given a pointer to either a gregset_t or fpregset_t, return a
pointer to the first register. */
diff --git a/gdb/config/alpha/nm-nbsd.h b/gdb/config/alpha/nm-nbsd.h
index caf1c237cfb..10fab6ec3b0 100644
--- a/gdb/config/alpha/nm-nbsd.h
+++ b/gdb/config/alpha/nm-nbsd.h
@@ -26,6 +26,6 @@
#include "config/nm-nbsd.h"
/* The Alpha does not step over a breakpoint. */
-#define CANNOT_STEP_BREAKPOINT
+#define CANNOT_STEP_BREAKPOINT 1
#endif /* NM_NBSD_H */
diff --git a/gdb/config/alpha/nm-osf.h b/gdb/config/alpha/nm-osf.h
index 20b5ae4a39a..73006fe5bdd 100644
--- a/gdb/config/alpha/nm-osf.h
+++ b/gdb/config/alpha/nm-osf.h
@@ -32,7 +32,7 @@
/* The alpha does not step over a breakpoint, the manpage is lying again. */
-#define CANNOT_STEP_BREAKPOINT
+#define CANNOT_STEP_BREAKPOINT 1
/* Support for shared libraries. */
diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst
index 0cb63a5d9af..046b0651cad 100644
--- a/gdb/config/djgpp/fnchange.lst
+++ b/gdb/config/djgpp/fnchange.lst
@@ -88,7 +88,6 @@
@V@/gdb/config/i386/nm-i386v42mp.h @V@/gdb/config/i386/nm-v42mp.h
@V@/gdb/config/i386/tm-i386mk.h @V@/gdb/config/i386/tm-mk.h
@V@/gdb/config/i386/tm-i386sol2.h @V@/gdb/config/i386/tm-sol2.h
-@V@/gdb/config/i386/tm-i386v4.h @V@/gdb/config/i386/tm-v4.h
@V@/gdb/config/i386/tm-i386v42mp.h @V@/gdb/config/i386/tm-v42mp.h
@V@/gdb/config/i386/xm-i386mach.h @V@/gdb/config/i386/xm-mach.h
@V@/gdb/config/i386/xm-i386mk.h @V@/gdb/config/i386/xm-mk.h
@@ -137,6 +136,8 @@
@V@/gdb/i386gnu-tdep.c @V@/gdb/i3gnu-tdep.c
@V@/gdb/i386nbsd-nat.c @V@/gdb/i3nbsd-nat.c
@V@/gdb/i386nbsd-tdep.c @V@/gdb/i3nbsd-tdep.c
+@V@/gdb/i386obsd-nat.c @V@/gdb/i3obsd-nat.c
+@V@/gdb/i386obsd-tdep.c @V@/gdb/i3obsd-tdep.c
@V@/gdb/ia64-aix-nat.c @V@/gdb/ia64aix-nat.c
@V@/gdb/ia64-linux-nat.c @V@/gdb/ia64linux-nat.c
@V@/gdb/jv-exp.tab.c @V@/gdb/jv-exp_tab.c
@@ -210,6 +211,11 @@
@V@/gdb/testsuite/gdb.c++/demangle.exp @V@/gdb/testsuite/gdb.cxx/demangle.exp
@V@/gdb/testsuite/gdb.c++/derivation.cc @V@/gdb/testsuite/gdb.cxx/derivation.cc
@V@/gdb/testsuite/gdb.c++/derivation.exp @V@/gdb/testsuite/gdb.cxx/derivation.exp
+@V@/gdb/testsuite/gdb.c++/hang.H @V@/gdb/testsuite/gdb.cxx/hang.h
+@V@/gdb/testsuite/gdb.c++/hang.exp @V@/gdb/testsuite/gdb.cxx/hang.exp
+@V@/gdb/testsuite/gdb.c++/hang1.C @V@/gdb/testsuite/gdb.cxx/hang1.c
+@V@/gdb/testsuite/gdb.c++/hang2.C @V@/gdb/testsuite/gdb.cxx/hang2.c
+@V@/gdb/testsuite/gdb.c++/hang3.C @V@/gdb/testsuite/gdb.cxx/hang3.c
@V@/gdb/testsuite/gdb.c++/inherit.exp @V@/gdb/testsuite/gdb.cxx/inherit.exp
@V@/gdb/testsuite/gdb.c++/local.cc @V@/gdb/testsuite/gdb.cxx/local.cc
@V@/gdb/testsuite/gdb.c++/local.exp @V@/gdb/testsuite/gdb.cxx/local.exp
@@ -221,6 +227,10 @@
@V@/gdb/testsuite/gdb.c++/member-ptr.exp @V@/gdb/testsuite/gdb.cxx/member-ptr.exp
@V@/gdb/testsuite/gdb.c++/method.cc @V@/gdb/testsuite/gdb.cxx/method.cc
@V@/gdb/testsuite/gdb.c++/method.exp @V@/gdb/testsuite/gdb.cxx/method.exp
+@V@/gdb/testsuite/gdb.c++/m-data.cc @V@/gdb/testsuite/gdb.cxx/m-data.cc
+@V@/gdb/testsuite/gdb.c++/m-data.exp @V@/gdb/testsuite/gdb.cxx/m-data.exp
+@V@/gdb/testsuite/gdb.c++/m-static.cc @V@/gdb/testsuite/gdb.cxx/m-static.cc
+@V@/gdb/testsuite/gdb.c++/m-static.exp @V@/gdb/testsuite/gdb.cxx/m-static.exp
@V@/gdb/testsuite/gdb.c++/misc.cc @V@/gdb/testsuite/gdb.cxx/misc.cc
@V@/gdb/testsuite/gdb.c++/misc.exp @V@/gdb/testsuite/gdb.cxx/misc.exp
@V@/gdb/testsuite/gdb.c++/namespace.cc @V@/gdb/testsuite/gdb.cxx/namespace.cc
@@ -233,6 +243,8 @@
@V@/gdb/testsuite/gdb.c++/ref-types.exp @V@/gdb/testsuite/gdb.cxx/ref-types.exp
@V@/gdb/testsuite/gdb.c++/templates.cc @V@/gdb/testsuite/gdb.cxx/templates.cc
@V@/gdb/testsuite/gdb.c++/templates.exp @V@/gdb/testsuite/gdb.cxx/templates.exp
+@V@/gdb/testsuite/gdb.c++/try_catch.cc @V@/gdb/testsuite/gdb.cxx/try_catch.cc
+@V@/gdb/testsuite/gdb.c++/try_catch.exp @V@/gdb/testsuite/gdb.cxx/try_catch.exp
@V@/gdb/testsuite/gdb.c++/userdef.cc @V@/gdb/testsuite/gdb.cxx/userdef.cc
@V@/gdb/testsuite/gdb.c++/userdef.exp @V@/gdb/testsuite/gdb.cxx/userdef.exp
@V@/gdb/testsuite/gdb.c++/virtfunc.cc @V@/gdb/testsuite/gdb.cxx/virtfunc.cc
diff --git a/gdb/config/h8500/tm-h8500.h b/gdb/config/h8500/tm-h8500.h
index 30acdbe05bf..8c4ae455efc 100644
--- a/gdb/config/h8500/tm-h8500.h
+++ b/gdb/config/h8500/tm-h8500.h
@@ -1,6 +1,7 @@
/* Parameters for execution on a H8/500 series machine.
- Copyright 1993, 1994, 1995, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002 Free
+ Software Foundation, Inc.
This file is part of GDB.
@@ -169,7 +170,7 @@ extern struct type *h8500_register_virtual_type (int regno);
of type TYPE, given in virtual format. */
#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
+ deprecated_write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
/* Extract from an array REGBUF containing the (raw) register state
the address in which a function should return its structure value,
@@ -253,8 +254,9 @@ extern CORE_ADDR h8500_addr_bits_remove (CORE_ADDR);
#define read_memory_short(x) (read_memory_integer(x,2) & 0xffff)
-#define PRINT_REGISTER_HOOK(regno) print_register_hook(regno)
-extern void print_register_hook (int);
+extern void h8500_do_registers_info (int regnum, int all);
+#define DEPRECATED_DO_REGISTERS_INFO(REGNUM,ALL) \
+ h8500_do_registers_info (REGNUM, ALL)
extern int minimum_mode;
diff --git a/gdb/config/i386/i386gnu.mt b/gdb/config/i386/i386gnu.mt
index dc3edd2dbb2..2029e99bbfc 100644
--- a/gdb/config/i386/i386gnu.mt
+++ b/gdb/config/i386/i386gnu.mt
@@ -1,3 +1,3 @@
# Target: Intel 386 running the GNU Hurd
TDEPFILES= i386-tdep.o i387-tdep.o i386gnu-tdep.o
-TM_FILE= tm-i386v4.h
+TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/i386sco5.mt b/gdb/config/i386/i386sco5.mt
index ace2258a91f..11ab55f2c2f 100644
--- a/gdb/config/i386/i386sco5.mt
+++ b/gdb/config/i386/i386sco5.mt
@@ -1,3 +1,3 @@
# Target: Intel 386 running SCO Open Server 5
TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386v4.h
+TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/i386v4.mt b/gdb/config/i386/i386v4.mt
index c22b6755985..d1b8c26726c 100644
--- a/gdb/config/i386/i386v4.mt
+++ b/gdb/config/i386/i386v4.mt
@@ -1,3 +1,3 @@
# Target: Intel 386 running SVR4
TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386v4.h
+TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/i386v42mp.mt b/gdb/config/i386/i386v42mp.mt
index 0b2dea8af04..1a0ac88d81c 100644
--- a/gdb/config/i386/i386v42mp.mt
+++ b/gdb/config/i386/i386v42mp.mt
@@ -1,3 +1,3 @@
# Target: Intel 386 running SVR4.2MP
TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386v42mp.h
+TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/interix.mh b/gdb/config/i386/interix.mh
new file mode 100644
index 00000000000..23311d615fa
--- /dev/null
+++ b/gdb/config/i386/interix.mh
@@ -0,0 +1,9 @@
+# Host: Intel 386 running Interix
+XDEPFILES=
+NATDEPFILES= corelow.o core-regset.o fork-child.o i386-interix-nat.o \
+ procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
+NAT_FILE= nm-interix.h
+XM_FILE= xm-interix.h
+# The below may be temporary; mmalloc relies on sbrk() at the moment
+MMALLOC=
+MMALLOC_CFLAGS=-DNO_MMALLOC
diff --git a/gdb/config/i386/interix.mt b/gdb/config/i386/interix.mt
new file mode 100644
index 00000000000..8d609624757
--- /dev/null
+++ b/gdb/config/i386/interix.mt
@@ -0,0 +1,3 @@
+# Target: Intel 386 running Interix
+TDEPFILES= i386-tdep.o i387-tdep.o i386-interix-tdep.o solib.o solib-pei.o
+TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/ncr3000.mt b/gdb/config/i386/ncr3000.mt
index 11bc47426e6..4773daec1b6 100644
--- a/gdb/config/i386/ncr3000.mt
+++ b/gdb/config/i386/ncr3000.mt
@@ -1,3 +1,3 @@
# Target: Intel 386 running SVR4
TDEPFILES= i386-tdep.o i387-tdep.o solib.o solib-svr4.o solib-legacy.o
-TM_FILE= tm-i386v4.h
+TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/nm-i386sco.h b/gdb/config/i386/nm-i386sco.h
index e3bdc2df97c..ec7a3bd97d9 100644
--- a/gdb/config/i386/nm-i386sco.h
+++ b/gdb/config/i386/nm-i386sco.h
@@ -20,12 +20,14 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define REGISTER_U_ADDR(addr, blockend, regno) \
- (addr) = i386_register_u_addr ((blockend),(regno));
+#ifndef NM_I386SCO_H
+#define NM_I386SCO_H
-extern int i386_register_u_addr (int, int);
+#include "i386/nm-i386v.h"
/* When calling functions on SCO, sometimes we get an error writing some
of the segment registers. This would appear to be a kernel
bug/non-feature. */
#define CANNOT_STORE_REGISTER(regno) ((regno) == 14 || (regno) == 15)
+
+#endif /* nm-i386sco.h */
diff --git a/gdb/config/i386/nm-i386v42mp.h b/gdb/config/i386/nm-i386v42mp.h
index 7ded36148f2..f6fced506e8 100644
--- a/gdb/config/i386/nm-i386v42mp.h
+++ b/gdb/config/i386/nm-i386v42mp.h
@@ -20,4 +20,73 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#ifndef NM_I386V42MP_H
+#define NM_I386V42MP_H
+
#include "config/nm-sysv4.h"
+
+/* define to select for other sysv4.2mp weirdness (see procfs.c) */
+
+#define UNIXWARE
+
+#if 0
+/* The following macros extract process and lwp/thread ids from a
+ composite id.
+
+ For consistency with UnixWare core files, allocate bits 0-15 for
+ process ids and bits 16 and up for lwp ids. Reserve bit 31 for
+ negative return values to indicate exceptions, and use bit 30 as a
+ flag to indicate a user-mode thread, leaving 14 bits for lwp
+ ids. */
+
+/* Number of bits in composite id allocated to process number. */
+#define PIDBITS 16
+
+/* Return the process id stored in composite PID. */
+#define PIDGET(PID) (((PID) & ((1 << PIDBITS) - 1)))
+
+/* Return the thread or lwp id stored in composite PID. */
+#define TIDGET(PID) (((PID) & 0x3fffffff) >> PIDBITS)
+#define LIDGET(PID) TIDGET(PID)
+
+/* Construct a composite id from lwp LID and the process portion of
+ composite PID. */
+#define MERGEPID(PID, LID) (PIDGET(PID) | ((LID) << PIDBITS))
+#define MKLID(PID, LID) MERGEPID(PID, LID)
+
+/* Construct a composite id from thread TID and the process portion of
+ composite PID. */
+#define MKTID(PID, TID) (MERGEPID(PID, TID) | 0x40000000)
+
+/* Return whether PID contains a user-space thread id. */
+#define ISTID(PID) ((PID) & 0x40000000)
+#endif
+
+/* New definitions of the ptid stuff. Due to the way the
+ code is structured in uw-thread.c, I'm overloading the thread id
+ and lwp id onto the lwp field. The tid field is used to indicate
+ whether the lwp is a tid or not.
+
+ FIXME: Check that core file support is not broken. (See original
+ #if 0'd comments above.)
+ FIXME: Restructure uw-thread.c so that the struct ptid fields
+ can be used as intended. */
+
+/* Return the process id stored in composite PID. */
+#define PIDGET(PID) (ptid_get_pid (PID))
+
+/* Return the thread or lwp id stored in composite PID. */
+#define TIDGET(PID) (ptid_get_lwp (PID))
+#define LIDGET(PID) TIDGET(PID)
+
+#define MERGEPID(PID, LID) (ptid_build ((PID), (LID), 0))
+#define MKLID(PID, LID) (ptid_build ((PID), (LID), 0))
+
+/* Construct a composite id from thread TID and the process portion of
+ composite PID. */
+#define MKTID(PID, TID) (ptid_build ((PID), (TID), 1))
+
+/* Return whether PID contains a user-space thread id. */
+#define ISTID(PID) (ptid_get_tid (PID))
+
+#endif /* NM_I386V42MP_H */
diff --git a/bfd/elf32-sh64-nbsd.c b/gdb/config/i386/nm-interix.h
index 2d3e3d99dbd..b8b003a58d7 100644
--- a/bfd/elf32-sh64-nbsd.c
+++ b/gdb/config/i386/nm-interix.h
@@ -1,7 +1,7 @@
-/* SuperH SH64 specific support for 32-bit NetBSD
- Copyright 2002 Free Software Foundation, Inc.
+/* Native-dependent definitions for Intel 386 running Interix, for GDB.
+ Copyright 1986, 1987, 1989, 1992, 1996 Free Software Foundation, Inc.
-This file is part of BFD, the Binary File Descriptor library.
+This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,13 +17,19 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#define TARGET_BIG_SYM bfd_elf32_sh64nbsd_vec
-#define TARGET_BIG_NAME "elf32-sh64-nbsd"
-#define TARGET_LITTLE_SYM bfd_elf32_sh64lnbsd_vec
-#define TARGET_LITTLE_NAME "elf32-sh64l-nbsd"
-#define ELF_ARCH bfd_arch_sh
-#define ELF_MACHINE_CODE EM_SH
-#define ELF_MAXPAGESIZE 0x10000
-#define elf_symbol_leading_char 0
+#ifndef NM_INTERIX_H
+#define NM_INTERIX_H
-#include "elf32-sh64.c"
+/* Be shared lib aware. */
+#include "solib.h"
+
+/* submodes of USE_PROC_FS. */
+#define UNIXWARE
+
+/* It's ALMOST coff; bfd does the same thing. Mostly used in coffread.c. */
+#define COFF_IMAGE_WITH_PE
+
+/* Turn on our own child_pid_to_exec_file. */
+#define CHILD_PID_TO_EXEC_FILE
+
+#endif /* NM_INTERIX_H */
diff --git a/gdb/config/i386/nm-linux.h b/gdb/config/i386/nm-linux.h
index 073c3a3986e..ad57124e88c 100644
--- a/gdb/config/i386/nm-linux.h
+++ b/gdb/config/i386/nm-linux.h
@@ -39,9 +39,6 @@ extern int kernel_u_size (void);
the core file of the register values. */
#define KERNEL_U_ADDR 0
-/* Offset of the registers within the user area. */
-#define U_REGS_OFFSET 0
-
extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regnum);
#define REGISTER_U_ADDR(addr, blockend, regnum) \
(addr) = register_u_addr (blockend, regnum)
diff --git a/gdb/config/i386/nm-ptx4.h b/gdb/config/i386/nm-ptx4.h
index 253b1944e9c..9c8f41c2b82 100644
--- a/gdb/config/i386/nm-ptx4.h
+++ b/gdb/config/i386/nm-ptx4.h
@@ -38,7 +38,7 @@
/* We must fetch all the regs before storing, since we store all at once. */
-#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
#define CHILD_WAIT
struct target_waitstatus;
diff --git a/gdb/config/i386/nm-symmetry.h b/gdb/config/i386/nm-symmetry.h
index a589a3de0d5..d3f57e692b8 100644
--- a/gdb/config/i386/nm-symmetry.h
+++ b/gdb/config/i386/nm-symmetry.h
@@ -28,7 +28,7 @@
/* We must fetch all the regs before storing, since we store all at once. */
-#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
#ifdef _SEQUENT_
#define CHILD_WAIT
diff --git a/gdb/config/i386/obsd.mt b/gdb/config/i386/obsd.mt
new file mode 100644
index 00000000000..72ec51311cc
--- /dev/null
+++ b/gdb/config/i386/obsd.mt
@@ -0,0 +1,3 @@
+# Target: Intel 386 running OpenBSD
+TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386obsd-tdep.o corelow.o
+TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/tm-i386sol2.h b/gdb/config/i386/tm-i386sol2.h
index 35d63d16865..5a79f67dabc 100644
--- a/gdb/config/i386/tm-i386sol2.h
+++ b/gdb/config/i386/tm-i386sol2.h
@@ -21,7 +21,7 @@
#ifndef TM_I386SOL2_H
#define TM_I386SOL2_H 1
-#include "i386/tm-i386v4.h"
+#include "i386/tm-i386.h"
/* The SunPRO compiler puts out 0 instead of the address in N_SO symbols,
and for SunPRO 3.0, N_FUN symbols too. */
diff --git a/gdb/config/i386/tm-i386v4.h b/gdb/config/i386/tm-i386v4.h
deleted file mode 100644
index 9363327fdb7..00000000000
--- a/gdb/config/i386/tm-i386v4.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Macro definitions for GDB on an Intel i386 running SVR4.
- Copyright 1991, 1994, 1995, 1998, 1999, 2000, 2002
- Free Software Foundation, Inc.
- Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TM_I386V4_H
-#define TM_I386V4_H 1
-
-/* Pick up most of what we need from the generic i386 target include file. */
-#include "i386/tm-i386.h"
-
-/* It is unknown which, if any, SVR4 assemblers do not accept dollar signs
- in identifiers. The default in G++ is to use dots instead, for all SVR4
- systems, so we make that our default also. FIXME: There should be some
- way to get G++ to tell us what CPLUS_MARKER it is using, perhaps by
- stashing it in the debugging information as part of the name of an
- invented symbol ("gcc_cplus_marker$" for example). */
-
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
-
-#endif /* ifndef TM_I386V4_H */
diff --git a/gdb/config/i386/tm-i386v42mp.h b/gdb/config/i386/tm-i386v42mp.h
deleted file mode 100644
index 5671e42944c..00000000000
--- a/gdb/config/i386/tm-i386v42mp.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Macro definitions for GDB on an Intel i386 running SVR4.2MP
- Copyright 1991, 1994, 1997, 1999, 2000 Free Software Foundation, Inc.
- Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TM_I386V42MP_H
-#define TM_I386V42MP_H 1
-
-/* pick up more generic x86 sysv4 stuff */
-
-#include "i386/tm-i386v4.h"
-
-/* define to select for other sysv4.2mp weirdness (see procfs.c) */
-
-#define UNIXWARE
-
-#if 0
-/* The following macros extract process and lwp/thread ids from a
- composite id.
-
- For consistency with UnixWare core files, allocate bits 0-15 for
- process ids and bits 16 and up for lwp ids. Reserve bit 31 for
- negative return values to indicate exceptions, and use bit 30 as a
- flag to indicate a user-mode thread, leaving 14 bits for lwp
- ids. */
-
-/* Number of bits in composite id allocated to process number. */
-#define PIDBITS 16
-
-/* Return the process id stored in composite PID. */
-#define PIDGET(PID) (((PID) & ((1 << PIDBITS) - 1)))
-
-/* Return the thread or lwp id stored in composite PID. */
-#define TIDGET(PID) (((PID) & 0x3fffffff) >> PIDBITS)
-#define LIDGET(PID) TIDGET(PID)
-
-/* Construct a composite id from lwp LID and the process portion of
- composite PID. */
-#define MERGEPID(PID, LID) (PIDGET(PID) | ((LID) << PIDBITS))
-#define MKLID(PID, LID) MERGEPID(PID, LID)
-
-/* Construct a composite id from thread TID and the process portion of
- composite PID. */
-#define MKTID(PID, TID) (MERGEPID(PID, TID) | 0x40000000)
-
-/* Return whether PID contains a user-space thread id. */
-#define ISTID(PID) ((PID) & 0x40000000)
-#endif
-
-/* New definitions of the ptid stuff. Due to the way the
- code is structured in uw-thread.c, I'm overloading the thread id
- and lwp id onto the lwp field. The tid field is used to indicate
- whether the lwp is a tid or not.
-
- FIXME: Check that core file support is not broken. (See original
- #if 0'd comments above.)
- FIXME: Restructure uw-thread.c so that the struct ptid fields
- can be used as intended. */
-
-/* Return the process id stored in composite PID. */
-#define PIDGET(PID) (ptid_get_pid (PID))
-
-/* Return the thread or lwp id stored in composite PID. */
-#define TIDGET(PID) (ptid_get_lwp (PID))
-#define LIDGET(PID) TIDGET(PID)
-
-#define MERGEPID(PID, LID) (ptid_build ((PID), (LID), 0))
-#define MKLID(PID, LID) (ptid_build ((PID), (LID), 0))
-
-/* Construct a composite id from thread TID and the process portion of
- composite PID. */
-#define MKTID(PID, TID) (ptid_build ((PID), (TID), 1))
-
-/* Return whether PID contains a user-space thread id. */
-#define ISTID(PID) (ptid_get_tid (PID))
-
-#endif /* ifndef TM_I386V42MP_H */
diff --git a/gdb/config/i386/tm-ptx.h b/gdb/config/i386/tm-ptx.h
index 8d773c8c292..2b7a86c74c3 100644
--- a/gdb/config/i386/tm-ptx.h
+++ b/gdb/config/i386/tm-ptx.h
@@ -30,7 +30,7 @@
#include <sys/reg.h>
#ifdef SEQUENT_PTX4
-#include "i386/tm-i386v4.h"
+#include "i386/tm-i386.h"
#else /* !SEQUENT_PTX4 */
#include "i386/tm-i386.h"
#endif
diff --git a/gdb/config/i386/xm-i386sco.h b/gdb/config/i386/xm-i386sco.h
index 920ebbb3c4d..72552c93341 100644
--- a/gdb/config/i386/xm-i386sco.h
+++ b/gdb/config/i386/xm-i386sco.h
@@ -33,8 +33,3 @@
GDB does not currently support the termio/job control combination. */
#undef HAVE_TERMIO
#define HAVE_TERMIOS
-
-/* SCO's assembler doesn't grok dollar signs in identifiers.
- So we use dots instead. This item must be coordinated with G++. */
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
diff --git a/gdb/config/m32r/tm-m32r.h b/gdb/config/m32r/tm-m32r.h
index 648ff01c1c8..f38a760deb8 100644
--- a/gdb/config/m32r/tm-m32r.h
+++ b/gdb/config/m32r/tm-m32r.h
@@ -146,7 +146,7 @@ extern CORE_ADDR m32r_frame_saved_pc (struct frame_info *);
/* mvs_check DEPRECATED_STORE_RETURN_VALUE */
#define DEPRECATED_STORE_RETURN_VALUE(TYPE, VALBUF) \
- write_register_bytes(REGISTER_BYTE (V0_REGNUM) + \
+ deprecated_write_register_bytes(REGISTER_BYTE (V0_REGNUM) + \
((TYPE_LENGTH (TYPE) > 4 ? 8:4) - TYPE_LENGTH (TYPE)),\
(VALBUF), TYPE_LENGTH (TYPE));
@@ -221,7 +221,7 @@ extern CORE_ADDR m32r_push_arguments (int nargs,
/* override the standard get_saved_register function with
one that takes account of generic CALL_DUMMY frames */
#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
- generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
+ deprecated_generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
#define USE_GENERIC_DUMMY_FRAMES 1
diff --git a/gdb/config/m68k/nm-sun3.h b/gdb/config/m68k/nm-sun3.h
index ba40db74b0b..b2fecb29e97 100644
--- a/gdb/config/m68k/nm-sun3.h
+++ b/gdb/config/m68k/nm-sun3.h
@@ -31,4 +31,4 @@
/* We have to grab the regs since we store all regs at once. */
-#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
diff --git a/gdb/config/m68k/tm-delta68.h b/gdb/config/m68k/tm-delta68.h
index 269d1346e8e..a1abc0e8d3f 100644
--- a/gdb/config/m68k/tm-delta68.h
+++ b/gdb/config/m68k/tm-delta68.h
@@ -68,11 +68,11 @@
{ \
char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buf); \
- write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \
+ deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \
raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \
} \
else \
- write_register_bytes ((TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : 0), \
+ deprecated_write_register_bytes ((TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : 0), \
VALBUF, TYPE_LENGTH (TYPE))
/* Return number of args passed to a frame.
diff --git a/gdb/config/m68k/tm-linux.h b/gdb/config/m68k/tm-linux.h
index e2889ecff7b..0bae116537e 100644
--- a/gdb/config/m68k/tm-linux.h
+++ b/gdb/config/m68k/tm-linux.h
@@ -64,15 +64,15 @@
{ \
char raw_buffer[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buffer); \
- write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \
+ deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \
raw_buffer, TYPE_LENGTH (TYPE)); \
} \
else \
{ \
if (TYPE_CODE (TYPE) == TYPE_CODE_PTR) \
- write_register_bytes (REGISTER_BYTE (A0_REGNUM), VALBUF, \
+ deprecated_write_register_bytes (REGISTER_BYTE (A0_REGNUM), VALBUF, \
TYPE_LENGTH (TYPE)); \
- write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); \
+ deprecated_write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); \
} \
}
diff --git a/gdb/config/mips/nm-irix4.h b/gdb/config/mips/nm-irix4.h
index 9c02eb3573b..bf4a02c2fc4 100644
--- a/gdb/config/mips/nm-irix4.h
+++ b/gdb/config/mips/nm-irix4.h
@@ -54,7 +54,7 @@
procfs_stopped_by_watchpoint(inferior_ptid)
extern int procfs_stopped_by_watchpoint (ptid_t);
-#define HAVE_NONSTEPPABLE_WATCHPOINT
+#define HAVE_NONSTEPPABLE_WATCHPOINT 1
/* Use these macros for watchpoint insertion/deletion. */
/* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */
diff --git a/gdb/config/mips/nm-irix5.h b/gdb/config/mips/nm-irix5.h
index 59749f66335..4507ad1d7fb 100644
--- a/gdb/config/mips/nm-irix5.h
+++ b/gdb/config/mips/nm-irix5.h
@@ -36,7 +36,7 @@
procfs_stopped_by_watchpoint(inferior_ptid)
extern int procfs_stopped_by_watchpoint (ptid_t);
-#define HAVE_NONSTEPPABLE_WATCHPOINT
+#define HAVE_NONSTEPPABLE_WATCHPOINT 1
/* Use these macros for watchpoint insertion/deletion. */
/* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */
diff --git a/gdb/config/mips/tm-embed.h b/gdb/config/mips/tm-embed.h
index 7482a779482..44072f4cb38 100644
--- a/gdb/config/mips/tm-embed.h
+++ b/gdb/config/mips/tm-embed.h
@@ -36,7 +36,7 @@ int remote_mips_remove_watchpoint (CORE_ADDR addr, int len, int type);
/* We need to remove watchpoints when stepping, else we hit them again! */
-#define HAVE_NONSTEPPABLE_WATCHPOINT
+#define HAVE_NONSTEPPABLE_WATCHPOINT 1
int remote_mips_stopped_by_watchpoint (void);
#define STOPPED_BY_WATCHPOINT(w) remote_mips_stopped_by_watchpoint ()
diff --git a/gdb/config/mips/tm-irix3.h b/gdb/config/mips/tm-irix3.h
index 11859e59a5d..c298a391f80 100644
--- a/gdb/config/mips/tm-irix3.h
+++ b/gdb/config/mips/tm-irix3.h
@@ -21,11 +21,6 @@
#include "mips/tm-bigmips.h"
-/* SGI's assembler doesn't grok dollar signs in identifiers.
- So we use dots instead. This item must be coordinated with G++. */
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
-
/* Redefine register numbers for SGI. */
#undef NUM_REGS
diff --git a/gdb/config/mips/tm-irix6.h b/gdb/config/mips/tm-irix6.h
index 58b97e178b2..ce9c2261854 100644
--- a/gdb/config/mips/tm-irix6.h
+++ b/gdb/config/mips/tm-irix6.h
@@ -22,11 +22,6 @@
#include "mips/tm-bigmips64.h"
#include "solib.h"
-/* SGI's assembler doesn't grok dollar signs in identifiers.
- So we use dots instead. This item must be coordinated with G++. */
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
-
/* Redefine register numbers for SGI. */
#undef NUM_REGS
diff --git a/gdb/config/mn10200/tm-mn10200.h b/gdb/config/mn10200/tm-mn10200.h
index bd2e66c411b..47bd7a04c52 100644
--- a/gdb/config/mn10200/tm-mn10200.h
+++ b/gdb/config/mn10200/tm-mn10200.h
@@ -154,16 +154,16 @@ extern CORE_ADDR mn10200_frame_saved_pc (struct frame_info *);
internal_error (__FILE__, __LINE__, "failed internal consistency check"); \
else if (TYPE_LENGTH (TYPE) > 2 && TYPE_CODE (TYPE) != TYPE_CODE_PTR) \
{ \
- write_register_bytes (REGISTER_BYTE (0), VALBUF, 2); \
- write_register_bytes (REGISTER_BYTE (1), VALBUF + 2, 2); \
+ deprecated_write_register_bytes (REGISTER_BYTE (0), VALBUF, 2); \
+ deprecated_write_register_bytes (REGISTER_BYTE (1), VALBUF + 2, 2); \
} \
else if (TYPE_CODE (TYPE) == TYPE_CODE_PTR)\
{ \
- write_register_bytes (REGISTER_BYTE (4), VALBUF, TYPE_LENGTH (TYPE)); \
+ deprecated_write_register_bytes (REGISTER_BYTE (4), VALBUF, TYPE_LENGTH (TYPE)); \
} \
else \
{ \
- write_register_bytes (REGISTER_BYTE (0), VALBUF, TYPE_LENGTH (TYPE)); \
+ deprecated_write_register_bytes (REGISTER_BYTE (0), VALBUF, TYPE_LENGTH (TYPE)); \
} \
}
diff --git a/gdb/config/nm-gnu.h b/gdb/config/nm-gnu.h
index 8f17406abc2..1dedb57f0a7 100644
--- a/gdb/config/nm-gnu.h
+++ b/gdb/config/nm-gnu.h
@@ -30,7 +30,7 @@
extern char *gnu_target_pid_to_str (int pid);
/* Before storing, we need to read all the registers. */
-#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
/* Don't do wait_for_inferior on attach. */
#define ATTACH_NO_WAIT
diff --git a/gdb/config/nm-m3.h b/gdb/config/nm-m3.h
index f89838ed967..07bc26aa0c4 100644
--- a/gdb/config/nm-m3.h
+++ b/gdb/config/nm-m3.h
@@ -77,7 +77,7 @@ extern int must_suspend_thread;
/* Before storing, we need to read all the registers. */
-#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
/* Check if the inferior exists */
#define MACH_ERROR_NO_INFERIOR \
diff --git a/gdb/config/pa/nm-hppah.h b/gdb/config/pa/nm-hppah.h
index 4894a049a08..7609d67804a 100644
--- a/gdb/config/pa/nm-hppah.h
+++ b/gdb/config/pa/nm-hppah.h
@@ -196,7 +196,7 @@ extern int hppa_require_detach (int, int);
by removing all eventpoints; stepping past the instruction that caused
the trigger; reinserting eventpoints; and checking whether any watched
location changed. */
-#define HAVE_NONSTEPPABLE_WATCHPOINT
+#define HAVE_NONSTEPPABLE_WATCHPOINT 1
/* Our implementation of "hardware" watchpoints uses memory page-protection
faults. However, HP-UX has unfortunate interactions between these and
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index 6fd8c033652..319576d25e1 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -24,6 +24,8 @@
#include "regcache.h"
+#define GDB_MULTI_ARCH 0
+
/* Forward declarations of some types we use in prototypes */
struct frame_info;
@@ -50,12 +52,8 @@ struct inferior_status;
((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1))
#endif
-/* On the PA, any pass-by-value structure > 8 bytes is actually
- passed via a pointer regardless of its type or the compiler
- used. */
-
-#define REG_STRUCT_HAS_ADDR(gcc_p,type) \
- (TYPE_LENGTH (type) > 8)
+extern int hppa_reg_struct_has_addr (int gcc_p, struct type *type);
+#define REG_STRUCT_HAS_ADDR(gcc_p,type) hppa_reg_struct_has_addr (gcc_p,type)
/* Offset from address of function to start of its code.
Zero on most machines. */
@@ -84,23 +82,16 @@ extern int in_solib_call_trampoline (CORE_ADDR, char *);
in_solib_return_trampoline (pc, name)
extern int in_solib_return_trampoline (CORE_ADDR, char *);
-/* Immediately after a function call, return the saved pc.
- Can't go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
#undef SAVED_PC_AFTER_CALL
#define SAVED_PC_AFTER_CALL(frame) saved_pc_after_call (frame)
extern CORE_ADDR saved_pc_after_call (struct frame_info *);
-/* Stack grows upward */
-#define INNER_THAN(lhs,rhs) ((lhs) > (rhs))
+extern int hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs);
+#define INNER_THAN(lhs,rhs) hppa_inner_than(lhs,rhs)
-/* elz: adjust the quantity to the next highest value which is 64-bit aligned.
- This is used in valops.c, when the sp is adjusted.
- On hppa the sp must always be kept 64-bit aligned */
+extern CORE_ADDR hppa_stack_align (CORE_ADDR sp);
+#define STACK_ALIGN(sp) hppa_stack_align (sp)
-#define STACK_ALIGN(arg) ( ((arg)%8) ? (((arg)+7)&-8) : (arg))
#define EXTRA_STACK_ALIGNMENT_NEEDED 0
/* Sequence of bytes for breakpoint instruction. */
@@ -116,35 +107,8 @@ extern CORE_ADDR saved_pc_after_call (struct frame_info *);
#define DECR_PC_AFTER_BREAK 0
-/* Sometimes we may pluck out a minimal symbol that has a negative
- address.
-
- An example of this occurs when an a.out is linked against a foo.sl.
- The foo.sl defines a global bar(), and the a.out declares a signature
- for bar(). However, the a.out doesn't directly call bar(), but passes
- its address in another call.
-
- If you have this scenario and attempt to "break bar" before running,
- gdb will find a minimal symbol for bar() in the a.out. But that
- symbol's address will be negative. What this appears to denote is
- an index backwards from the base of the procedure linkage table (PLT)
- into the data linkage table (DLT), the end of which is contiguous
- with the start of the PLT. This is clearly not a valid address for
- us to set a breakpoint on.
-
- Note that one must be careful in how one checks for a negative address.
- 0xc0000000 is a legitimate address of something in a shared text
- segment, for example. Since I don't know what the possible range
- is of these "really, truly negative" addresses that come from the
- minimal symbols, I'm resorting to the gross hack of checking the
- top byte of the address for all 1's. Sigh.
- */
-#define PC_REQUIRES_RUN_BEFORE_USE(pc) \
- (! target_has_stack && (pc & 0xFF000000))
-
-/* return instruction is bv r0(rp) or bv,n r0(rp) */
-
-#define ABOUT_TO_RETURN(pc) ((read_memory_integer (pc, 4) | 0x2) == 0xE840C002)
+extern int hppa_pc_requires_run_before_use (CORE_ADDR pc);
+#define PC_REQUIRES_RUN_BEFORE_USE(pc) hppa_pc_requires_run_before_use (pc)
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
@@ -249,10 +213,10 @@ extern CORE_ADDR saved_pc_after_call (struct frame_info *);
(buf)[sizeof(CORE_ADDR) -1] &= ~0x3; \
} while (0)
-/* Define DO_REGISTERS_INFO() to do machine-specific formatting
+/* Define DEPRECATED_REGISTERS_INFO() to do machine-specific formatting
of register dumps. */
-#define DO_REGISTERS_INFO(_regnum, fp) pa_do_registers_info (_regnum, fp)
+#define DEPRECATED_REGISTERS_INFO(_regnum, fp) pa_do_registers_info (_regnum, fp)
extern void pa_do_registers_info (int, int);
#if 0
@@ -262,9 +226,8 @@ extern void pa_do_strcat_registers_info (int, int, struct ui_file *, enum precis
/* PA specific macro to see if the current instruction is nullified. */
#ifndef INSTRUCTION_NULLIFIED
-#define INSTRUCTION_NULLIFIED \
- (((int)read_register (IPSW_REGNUM) & 0x00200000) && \
- !((int)read_register (FLAGS_REGNUM) & 0x2))
+extern int hppa_instruction_nullified (void);
+#define INSTRUCTION_NULLIFIED hppa_instruction_nullified ()
#endif
/* Number of bytes of storage in the actual machine representation
@@ -277,10 +240,8 @@ extern void pa_do_strcat_registers_info (int, int, struct ui_file *, enum precis
register state, the array `registers'. */
#define REGISTER_BYTES (NUM_REGS * 4)
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) (N) * 4
+extern int hppa_register_byte (int reg_nr);
+#define REGISTER_BYTE(N) hppa_register_byte (N)
/* Number of bytes of storage in the program's representation
for register N. */
@@ -295,16 +256,11 @@ extern void pa_do_strcat_registers_info (int, int, struct ui_file *, enum precis
#define MAX_REGISTER_VIRTUAL_SIZE 8
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
+extern struct type * hppa_register_virtual_type (int reg_nr);
+#define REGISTER_VIRTUAL_TYPE(N) hppa_register_virtual_type (N)
-#define REGISTER_VIRTUAL_TYPE(N) \
- ((N) < FP4_REGNUM ? builtin_type_int : builtin_type_float)
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) {write_register (28, (ADDR)); }
+extern void hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
+#define STORE_STRUCT_RETURN(ADDR, SP) hppa_store_struct_return (ADDR, SP)
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
@@ -358,21 +314,8 @@ struct value *hppa_value_returned_from_stack (register struct type *valtype,
#define VALUE_RETURNED_FROM_STACK(valtype,addr) \
hppa_value_returned_from_stack (valtype, addr)
-/*
- * This macro defines the register numbers (from REGISTER_NAMES) that
- * are effectively unavailable to the user through ptrace(). It allows
- * us to include the whole register set in REGISTER_NAMES (inorder to
- * better support remote debugging). If it is used in
- * fetch/store_inferior_registers() gdb will not complain about I/O errors
- * on fetching these registers. If all registers in REGISTER_NAMES
- * are available, then return false (0).
- */
-
-#define CANNOT_STORE_REGISTER(regno) \
- ((regno) == 0) || \
- ((regno) == PCSQ_HEAD_REGNUM) || \
- ((regno) >= PCSQ_TAIL_REGNUM && (regno) < IPSW_REGNUM) || \
- ((regno) > IPSW_REGNUM && (regno) < FP4_REGNUM)
+extern int hppa_cannot_store_register (int regnum);
+#define CANNOT_STORE_REGISTER(regno) hppa_cannot_store_register (regno)
#define INIT_EXTRA_FRAME_INFO(fromleaf, frame) init_extra_frame_info (fromleaf, frame)
extern void init_extra_frame_info (int, struct frame_info *);
@@ -405,9 +348,12 @@ extern int frameless_function_invocation (struct frame_info *);
extern CORE_ADDR hppa_frame_saved_pc (struct frame_info *frame);
#define FRAME_SAVED_PC(FRAME) hppa_frame_saved_pc (FRAME)
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
+extern CORE_ADDR hppa_frame_args_address (struct frame_info *fi);
+#define FRAME_ARGS_ADDRESS(fi) hppa_frame_args_address (fi)
+
+extern CORE_ADDR hppa_frame_locals_address (struct frame_info *fi);
+#define FRAME_LOCALS_ADDRESS(fi) hppa_frame_locals_address (fi)
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
/* Set VAL to the number of args passed to frame described by FI.
Can set VAL to -1, meaning no way to tell. */
@@ -589,13 +535,8 @@ hppa_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, int,
extern CORE_ADDR
hppa_push_arguments (int, struct value **, CORE_ADDR, int, CORE_ADDR);
-/* The low two bits of the PC on the PA contain the privilege level. Some
- genius implementing a (non-GCC) compiler apparently decided this means
- that "addresses" in a text section therefore include a privilege level,
- and thus symbol tables should contain these bits. This seems like a
- bonehead thing to do--anyway, it seems to work for our purposes to just
- ignore those bits. */
-#define SMASH_TEXT_ADDRESS(addr) ((addr) &= ~0x3)
+extern CORE_ADDR hppa_smash_text_address (CORE_ADDR addr);
+#define SMASH_TEXT_ADDRESS(addr) hppa_smash_text_address (addr)
#define GDB_TARGET_IS_HPPA
@@ -744,16 +685,12 @@ extern int hpread_adjust_stack_address (CORE_ADDR);
/* If the current gcc for for this target does not produce correct debugging
information for float parameters, both prototyped and unprototyped, then
define this macro. This forces gdb to always assume that floats are
- passed as doubles and then converted in the callee.
-
- For the pa, it appears that the debug info marks the parameters as
- floats regardless of whether the function is prototyped, but the actual
- values are passed as doubles for the non-prototyped case and floats for
- the prototyped case. Thus we choose to make the non-prototyped case work
- for C and break the prototyped case, since the non-prototyped case is
- probably much more common. (FIXME). */
+ passed as doubles and then converted in the callee. */
-#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (current_language -> la_language == language_c)
+extern int hppa_coerce_float_to_double (struct type *formal,
+ struct type *actual);
+#define COERCE_FLOAT_TO_DOUBLE(formal, actual) \
+ hppa_coerce_float_to_double (formal, actual)
/* Here's how to step off a permanent breakpoint. */
#define SKIP_PERMANENT_BREAKPOINT (hppa_skip_permanent_breakpoint)
diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h
index 7e6e45a2bfb..9a1ceb0a83a 100644
--- a/gdb/config/pa/tm-hppa64.h
+++ b/gdb/config/pa/tm-hppa64.h
@@ -264,29 +264,29 @@ call_dummy
#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
{ \
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT && !SOFT_FLOAT) \
- write_register_bytes \
+ deprecated_write_register_bytes \
(REGISTER_BYTE (FP4_REGNUM) + \
(REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
(VALBUF), \
TYPE_LENGTH (TYPE)); \
else if (is_integral_type(TYPE) || SOFT_FLOAT) \
- write_register_bytes \
+ deprecated_write_register_bytes \
(REGISTER_BYTE (28) + \
(REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
(VALBUF), \
TYPE_LENGTH (TYPE)); \
else if (TYPE_LENGTH (TYPE) <= 8) \
- write_register_bytes \
+ deprecated_write_register_bytes \
( REGISTER_BYTE (28), \
(VALBUF), \
TYPE_LENGTH (TYPE)); \
else if (TYPE_LENGTH (TYPE) <= 16) \
{ \
- write_register_bytes \
+ deprecated_write_register_bytes \
(REGISTER_BYTE (28), \
(VALBUF), \
8); \
- write_register_bytes \
+ deprecated_write_register_bytes \
(REGISTER_BYTE (29), \
((char *) VALBUF + 8), \
TYPE_LENGTH (TYPE) - 8); \
diff --git a/gdb/config/rs6000/tm-rs6000.h b/gdb/config/rs6000/tm-rs6000.h
index ea0c0734f30..478e9bd164b 100644
--- a/gdb/config/rs6000/tm-rs6000.h
+++ b/gdb/config/rs6000/tm-rs6000.h
@@ -27,11 +27,6 @@
#define TEXT_SEGMENT_BASE 0x10000000
-/* AIX's assembler doesn't grok dollar signs in identifiers.
- So we use dots instead. This item must be coordinated with G++. */
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
-
/* Return whether PC in function NAME is in code that should be skipped when
single-stepping. */
diff --git a/gdb/config/sparc/nm-nbsd.h b/gdb/config/sparc/nm-nbsd.h
index 957a34ed141..41341c635d2 100644
--- a/gdb/config/sparc/nm-nbsd.h
+++ b/gdb/config/sparc/nm-nbsd.h
@@ -30,6 +30,6 @@
/* Before storing, we need to read all the registers. */
-#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
#endif /* NM_NBSD_H */
diff --git a/gdb/config/sparc/nm-sun4os4.h b/gdb/config/sparc/nm-sun4os4.h
index d874d582418..cee2a3d242d 100644
--- a/gdb/config/sparc/nm-sun4os4.h
+++ b/gdb/config/sparc/nm-sun4os4.h
@@ -30,7 +30,7 @@
/* Before storing, we need to read all the registers. */
-#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
/* Return sizeof user struct to callers in less machine dependent routines */
diff --git a/gdb/config/sparc/nm-sun4sol2.h b/gdb/config/sparc/nm-sun4sol2.h
index f8aeda07ccc..3cad417de2a 100644
--- a/gdb/config/sparc/nm-sun4sol2.h
+++ b/gdb/config/sparc/nm-sun4sol2.h
@@ -26,7 +26,7 @@
/* Before storing, we need to read all the registers. */
-#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, REGISTER_BYTES)
/* Solaris PSRVADDR support does not seem to include a place for nPC. */
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index 8cac2586571..6042ac6cecb 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -736,14 +736,9 @@ extern void sparc_software_single_step (enum target_signal, int);
#define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)
extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *);
-/* To print every pair of float registers as a double, we use this hook.
- We also print the condition code registers in a readable format
- (FIXME: can expand this to all control regs). */
-
-#undef PRINT_REGISTER_HOOK
-#define PRINT_REGISTER_HOOK(regno) \
- sparc_print_register_hook (regno)
-extern void sparc_print_register_hook (int regno);
+extern void sparc_do_registers_info (int regnum, int all);
+#undef DEPRECATED_DO_REGISTERS_INFO
+#define DEPRECATED_DO_REGISTERS_INFO(REGNUM,ALL) sparc_do_registers_info (REGNUM, ALL)
/* Optimization for storing registers to the inferior. The hook
DO_DEFERRED_STORES
diff --git a/gdb/config/sparc/tm-sparclet.h b/gdb/config/sparc/tm-sparclet.h
index fd25f5ba1fd..6aad71da999 100644
--- a/gdb/config/sparc/tm-sparclet.h
+++ b/gdb/config/sparc/tm-sparclet.h
@@ -121,14 +121,16 @@ enum {
#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
{ \
/* Other values are returned in register %o0. */ \
- write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \
+ deprecated_write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \
TYPE_LENGTH (TYPE)); \
}
#endif /* GDB_MULTI_ARCH */
-#undef PRINT_REGISTER_HOOK
-#define PRINT_REGISTER_HOOK(regno)
+extern void sparclet_do_registers_info (int regnum, int all);
+#undef DEPRECATED_DO_REGISTERS_INFO
+#define DEPRECATED_DO_REGISTERS_INFO(REGNUM,ALL) sparclet_do_registers_info (REGNUM, ALL)
+
/* Offsets into jmp_buf. Not defined by Sun, but at least documented in a
comment in <machine/setjmp.h>! */
diff --git a/gdb/config/tm-sysv4.h b/gdb/config/tm-sysv4.h
index 35b95eb71f8..9a39af20d83 100644
--- a/gdb/config/tm-sysv4.h
+++ b/gdb/config/tm-sysv4.h
@@ -35,13 +35,3 @@ extern int in_plt_section (CORE_ADDR, char *);
where the function itself actually starts. If not, return 0. */
#define SKIP_TRAMPOLINE_CODE(pc) find_solib_trampoline_target (pc)
-
-/* It is unknown which, if any, SVR4 assemblers do not accept dollar signs
- in identifiers. The default in G++ is to use dots instead, for all SVR4
- systems, so we make that our default also. FIXME: There should be some
- way to get G++ to tell us what CPLUS_MARKER it is using, perhaps by
- stashing it in the debugging information as part of the name of an
- invented symbol ("gcc_cplus_marker$" for example). */
-
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
diff --git a/gdb/config/z8k/tm-z8k.h b/gdb/config/z8k/tm-z8k.h
index eb96eda68a0..edc5664e7a1 100644
--- a/gdb/config/z8k/tm-z8k.h
+++ b/gdb/config/z8k/tm-z8k.h
@@ -1,6 +1,7 @@
/* Parameters for execution on a z8000 series machine.
- Copyright 1992, 1993, 1994, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1992, 1993, 1994, 1998, 1999, 2000, 2001, 2002 Free
+ Software Foundation, Inc.
This file is part of GDB.
@@ -276,9 +277,9 @@ int sim_z8001_mode;
#define NO_STD_REGS
-extern void z8k_print_register_hook (int regno);
-#define PRINT_REGISTER_HOOK(regno) z8k_print_register_hook(regno)
-
+extern void z8k_do_registers_info (int regnum, int all);
+#define DEPRECATED_DO_REGISTERS_INFO(REGNUM,ALL) \
+ z8k_do_registers_info (REGNUM, ALL)
extern void z8k_set_pointer_size (int newsize);
#define INIT_EXTRA_SYMTAB_INFO \
diff --git a/gdb/configure b/gdb/configure
index e8a83ab0547..f96b8f90680 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -81,6 +81,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -195,6 +196,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
@@ -365,6 +367,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=*)
@@ -530,12 +537,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
@@ -576,7 +587,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:580: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:591: 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"
@@ -602,7 +613,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:606: checking for $ac_word" >&5
+echo "configure:617: 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
@@ -632,7 +643,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:636: checking for $ac_word" >&5
+echo "configure:647: 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
@@ -683,7 +694,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:687: checking for $ac_word" >&5
+echo "configure:698: 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
@@ -715,7 +726,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:719: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:730: 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.
@@ -726,12 +737,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 730 "configure"
+#line 741 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:746: \"$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
@@ -757,12 +768,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:761: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:772: 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:766: checking whether we are using GNU C" >&5
+echo "configure:777: 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
@@ -771,7 +782,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:775: \"$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:786: \"$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
@@ -790,7 +801,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:794: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:805: 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
@@ -822,7 +833,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:826: checking how to run the C preprocessor" >&5
+echo "configure:837: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -837,13 +848,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 841 "configure"
+#line 852 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:858: \"$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
:
@@ -854,13 +865,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 858 "configure"
+#line 869 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:864: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:875: \"$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
:
@@ -871,13 +882,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 875 "configure"
+#line 886 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:881: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:892: \"$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
:
@@ -902,9 +913,9 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:906: checking for AIX" >&5
+echo "configure:917: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
-#line 908 "configure"
+#line 919 "configure"
#include "confdefs.h"
#ifdef _AIX
yes
@@ -926,7 +937,7 @@ rm -f conftest*
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:930: checking for POSIXized ISC" >&5
+echo "configure:941: 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
@@ -950,7 +961,7 @@ fi
echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:954: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:965: checking for ${CC-cc} option to accept ANSI C" >&5
if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -967,7 +978,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIO
do
CC="$ac_save_CC $ac_arg"
cat > conftest.$ac_ext <<EOF
-#line 971 "configure"
+#line 982 "configure"
#include "confdefs.h"
#include <stdarg.h>
#include <stdio.h>
@@ -1004,7 +1015,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
; return 0; }
EOF
-if { (eval echo configure:1008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_prog_cc_stdc="$ac_arg"; break
else
@@ -1075,7 +1086,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:1079: checking host system type" >&5
+echo "configure:1090: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -1096,7 +1107,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:1100: checking target system type" >&5
+echo "configure:1111: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -1114,7 +1125,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:1118: checking build system type" >&5
+echo "configure:1129: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1139,7 +1150,7 @@ test "$host_alias" != "$target_alias" &&
ALL_LINGUAS=
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1143: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1154: 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
@@ -1168,7 +1179,7 @@ fi
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1172: checking for $ac_word" >&5
+echo "configure:1183: 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
@@ -1196,12 +1207,12 @@ else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1200: checking for ANSI C header files" >&5
+echo "configure:1211: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1205 "configure"
+#line 1216 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1209,7 +1220,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1224: \"$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*
@@ -1226,7 +1237,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
-#line 1230 "configure"
+#line 1241 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1244,7 +1255,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
-#line 1248 "configure"
+#line 1259 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1265,7 +1276,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1269 "configure"
+#line 1280 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1276,7 +1287,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1300,12 +1311,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1304: checking for working const" >&5
+echo "configure:1315: 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 <<EOF
-#line 1309 "configure"
+#line 1320 "configure"
#include "confdefs.h"
int main() {
@@ -1354,7 +1365,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1375,21 +1386,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1379: checking for inline" >&5
+echo "configure:1390: 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 <<EOF
-#line 1386 "configure"
+#line 1397 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1415,12 +1426,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1419: checking for off_t" >&5
+echo "configure:1430: 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 <<EOF
-#line 1424 "configure"
+#line 1435 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1448,12 +1459,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1452: checking for size_t" >&5
+echo "configure:1463: 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 <<EOF
-#line 1457 "configure"
+#line 1468 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1483,19 +1494,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:1487: checking for working alloca.h" >&5
+echo "configure:1498: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1492 "configure"
+#line 1503 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1510: \"$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
@@ -1516,12 +1527,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1520: checking for alloca" >&5
+echo "configure:1531: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1525 "configure"
+#line 1536 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -1549,7 +1560,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1564: \"$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
@@ -1581,12 +1592,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1585: checking whether alloca needs Cray hooks" >&5
+echo "configure:1596: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1590 "configure"
+#line 1601 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -1611,12 +1622,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1615: checking for $ac_func" >&5
+echo "configure:1626: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1620 "configure"
+#line 1631 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1639,7 +1650,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1654: \"$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
@@ -1666,7 +1677,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1670: checking stack direction for C alloca" >&5
+echo "configure:1681: 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
@@ -1674,7 +1685,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1678 "configure"
+#line 1689 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -1693,7 +1704,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:1697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1708: \"$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
@@ -1714,21 +1725,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:1722: checking for $ac_hdr" >&5
+echo "configure:1733: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1727 "configure"
+#line 1738 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1743: \"$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*
@@ -1757,12 +1768,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1761: checking for $ac_func" >&5
+echo "configure:1772: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1766 "configure"
+#line 1777 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1785,7 +1796,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1800: \"$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
@@ -1810,7 +1821,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:1814: checking for working mmap" >&5
+echo "configure:1825: 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
@@ -1818,7 +1829,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 1822 "configure"
+#line 1833 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -1846,24 +1857,11 @@ else
#include <fcntl.h>
#include <sys/mman.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
@@ -1971,7 +1969,7 @@ main()
}
EOF
-if { (eval echo configure:1975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1973: \"$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
@@ -1999,17 +1997,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:2003: checking for $ac_hdr" >&5
+echo "configure:2001: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2008 "configure"
+#line 2006 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2011: \"$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*
@@ -2039,12 +2037,12 @@ done
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2043: checking for $ac_func" >&5
+echo "configure:2041: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2048 "configure"
+#line 2046 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2067,7 +2065,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2069: \"$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
@@ -2096,12 +2094,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2100: checking for $ac_func" >&5
+echo "configure:2098: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2105 "configure"
+#line 2103 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2124,7 +2122,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2126: \"$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
@@ -2158,19 +2156,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2162: checking for LC_MESSAGES" >&5
+echo "configure:2160: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2167 "configure"
+#line 2165 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:2174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2172: \"$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
@@ -2191,7 +2189,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2195: checking whether NLS is requested" >&5
+echo "configure:2193: 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"
@@ -2211,7 +2209,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2215: checking whether included gettext is requested" >&5
+echo "configure:2213: 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"
@@ -2230,17 +2228,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2234: checking for libintl.h" >&5
+echo "configure:2232: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2239 "configure"
+#line 2237 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2242: \"$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*
@@ -2257,19 +2255,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:2261: checking for gettext in libc" >&5
+echo "configure:2259: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2266 "configure"
+#line 2264 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2271: \"$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
@@ -2285,7 +2283,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:2289: checking for bindtextdomain in -lintl" >&5
+echo "configure:2287: 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
@@ -2293,7 +2291,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2297 "configure"
+#line 2295 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2304,7 +2302,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:2308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2306: \"$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
@@ -2320,19 +2318,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:2324: checking for gettext in libintl" >&5
+echo "configure:2322: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2329 "configure"
+#line 2327 "configure"
#include "confdefs.h"
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2334: \"$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
@@ -2360,7 +2358,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:2364: checking for $ac_word" >&5
+echo "configure:2362: 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
@@ -2394,12 +2392,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2398: checking for $ac_func" >&5
+echo "configure:2396: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2403 "configure"
+#line 2401 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2422,7 +2420,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2424: \"$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
@@ -2449,7 +2447,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:2453: checking for $ac_word" >&5
+echo "configure:2451: 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
@@ -2485,7 +2483,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:2489: checking for $ac_word" >&5
+echo "configure:2487: 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
@@ -2517,7 +2515,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 2521 "configure"
+#line 2519 "configure"
#include "confdefs.h"
int main() {
@@ -2525,7 +2523,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:2529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -2557,7 +2555,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:2561: checking for $ac_word" >&5
+echo "configure:2559: 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
@@ -2591,7 +2589,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:2595: checking for $ac_word" >&5
+echo "configure:2593: 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
@@ -2627,7 +2625,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:2631: checking for $ac_word" >&5
+echo "configure:2629: 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
@@ -2717,7 +2715,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:2721: checking for catalogs to be installed" >&5
+echo "configure:2719: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -2745,17 +2743,17 @@ echo "configure:2721: 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:2749: checking for linux/version.h" >&5
+echo "configure:2747: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2754 "configure"
+#line 2752 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2757: \"$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*
@@ -2879,12 +2877,12 @@ EOF
fi
-for ac_prog in gawk mawk nawk awk
+for ac_prog in mawk gawk 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2888: checking for $ac_word" >&5
+echo "configure:2886: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2925,7 +2923,7 @@ done
# 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:2929: checking for a BSD compatible install" >&5
+echo "configure:2927: 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
@@ -2986,7 +2984,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:2990: checking for $ac_word" >&5
+echo "configure:2988: 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
@@ -3018,7 +3016,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:3022: checking for $ac_word" >&5
+echo "configure:3020: 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
@@ -3050,7 +3048,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:3054: checking for $ac_word" >&5
+echo "configure:3052: 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
@@ -3085,7 +3083,7 @@ fi
# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3089: checking for $ac_word" >&5
+echo "configure:3087: 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
@@ -3117,7 +3115,7 @@ fi
# Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
set dummy ${ac_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3121: checking for $ac_word" >&5
+echo "configure:3119: 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
@@ -3151,7 +3149,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:3155: checking for $ac_word" >&5
+echo "configure:3153: 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
@@ -3185,7 +3183,7 @@ test -n "$YACC" || YACC="yacc"
# Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args.
set dummy ${ac_tool_prefix}mig; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3189: checking for $ac_word" >&5
+echo "configure:3187: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3236,12 +3234,12 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3240: checking return type of signal handlers" >&5
+echo "configure:3238: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3245 "configure"
+#line 3243 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -3258,7 +3256,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:3262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -3278,12 +3276,12 @@ EOF
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3282: checking for ANSI C header files" >&5
+echo "configure:3280: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3287 "configure"
+#line 3285 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -3291,7 +3289,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3293: \"$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*
@@ -3308,7 +3306,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
-#line 3312 "configure"
+#line 3310 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -3326,7 +3324,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
-#line 3330 "configure"
+#line 3328 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -3347,7 +3345,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 3351 "configure"
+#line 3349 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3358,7 +3356,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:3362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -3402,17 +3400,17 @@ for ac_hdr in ctype.h nlist.h link.h thread_db.h proc_service.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3406: checking for $ac_hdr" >&5
+echo "configure:3404: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3411 "configure"
+#line 3409 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3416: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3414: \"$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*
@@ -3439,12 +3437,12 @@ fi
done
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:3443: checking whether stat file-mode macros are broken" >&5
+echo "configure:3441: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3448 "configure"
+#line 3446 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -3496,12 +3494,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3500: checking for working const" >&5
+echo "configure:3498: 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 <<EOF
-#line 3505 "configure"
+#line 3503 "configure"
#include "confdefs.h"
int main() {
@@ -3550,7 +3548,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:3554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -3571,21 +3569,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:3575: checking for inline" >&5
+echo "configure:3573: 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 <<EOF
-#line 3582 "configure"
+#line 3580 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:3589: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -3615,12 +3613,12 @@ for ac_func in bcopy btowc bzero canonicalize_file_name isascii poll \
realpath sbrk setpgid setpgrp sigaction sigprocmask sigsetmask
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3619: checking for $ac_func" >&5
+echo "configure:3617: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3624 "configure"
+#line 3622 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3643,7 +3641,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3645: \"$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
@@ -3670,19 +3668,19 @@ done
# 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:3674: checking for working alloca.h" >&5
+echo "configure:3672: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3679 "configure"
+#line 3677 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:3686: \"$ac_link\") 1>&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*
ac_cv_header_alloca_h=yes
else
@@ -3703,12 +3701,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3707: checking for alloca" >&5
+echo "configure:3705: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3712 "configure"
+#line 3710 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -3736,7 +3734,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:3740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3738: \"$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
@@ -3768,12 +3766,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:3772: checking whether alloca needs Cray hooks" >&5
+echo "configure:3770: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3777 "configure"
+#line 3775 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -3798,12 +3796,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3802: checking for $ac_func" >&5
+echo "configure:3800: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3807 "configure"
+#line 3805 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3826,7 +3824,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3828: \"$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
@@ -3853,7 +3851,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3857: checking stack direction for C alloca" >&5
+echo "configure:3855: 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
@@ -3861,7 +3859,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 3865 "configure"
+#line 3863 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -3880,7 +3878,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:3884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3882: \"$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
@@ -3902,12 +3900,12 @@ EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3906: checking for pid_t" >&5
+echo "configure:3904: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3911 "configure"
+#line 3909 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3936,17 +3934,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:3940: checking for vfork.h" >&5
+echo "configure:3938: checking for vfork.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3945 "configure"
+#line 3943 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3948: \"$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*
@@ -3971,18 +3969,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:3975: checking for working vfork" >&5
+echo "configure:3973: checking for working vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:3981: checking for vfork" >&5
+echo "configure:3979: checking for vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3986 "configure"
+#line 3984 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -4005,7 +4003,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:4009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
@@ -4027,7 +4025,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 4031 "configure"
+#line 4029 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -4122,7 +4120,7 @@ main() {
}
}
EOF
-if { (eval echo configure:4126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
@@ -4146,7 +4144,7 @@ fi
if test "$cross_compiling" = no; then
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:4150: checking whether setpgrp takes no argument" >&5
+echo "configure:4148: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4154,7 +4152,7 @@ else
{ echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 4158 "configure"
+#line 4156 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
@@ -4174,7 +4172,7 @@ main()
}
EOF
-if { (eval echo configure:4178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_setpgrp_void=no
else
@@ -4199,12 +4197,12 @@ fi
else
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:4203: checking whether setpgrp takes no argument" >&5
+echo "configure:4201: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4208 "configure"
+#line 4206 "configure"
#include "confdefs.h"
#include <unistd.h>
@@ -4218,7 +4216,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_func_setpgrp_void=no
else
@@ -4242,12 +4240,12 @@ fi
# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
# since sigsetjmp might only be defined as a macro.
echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:4246: checking for sigsetjmp" >&5
+echo "configure:4244: checking for sigsetjmp" >&5
if eval "test \"`echo '$''{'gdb_cv_func_sigsetjmp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4251 "configure"
+#line 4249 "configure"
#include "confdefs.h"
#include <setjmp.h>
@@ -4256,7 +4254,7 @@ int main() {
sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
; return 0; }
EOF
-if { (eval echo configure:4260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_func_sigsetjmp=yes
else
@@ -4279,19 +4277,19 @@ fi
# See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6
-echo "configure:4283: checking for r_fs in struct reg" >&5
+echo "configure:4281: checking for r_fs in struct reg" >&5
if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4288 "configure"
+#line 4286 "configure"
#include "confdefs.h"
#include <machine/reg.h>
int main() {
struct reg r; r.r_fs;
; return 0; }
EOF
-if { (eval echo configure:4295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_struct_reg_r_fs=yes
else
@@ -4311,19 +4309,19 @@ EOF
fi
echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6
-echo "configure:4315: checking for r_gs in struct reg" >&5
+echo "configure:4313: checking for r_gs in struct reg" >&5
if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4320 "configure"
+#line 4318 "configure"
#include "confdefs.h"
#include <machine/reg.h>
int main() {
struct reg r; r.r_gs;
; return 0; }
EOF
-if { (eval echo configure:4327: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_struct_reg_r_gs=yes
else
@@ -4345,19 +4343,19 @@ fi
# See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6
-echo "configure:4349: checking for PTRACE_GETREGS" >&5
+echo "configure:4347: checking for PTRACE_GETREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4354 "configure"
+#line 4352 "configure"
#include "confdefs.h"
#include <sys/ptrace.h>
int main() {
PTRACE_GETREGS;
; return 0; }
EOF
-if { (eval echo configure:4361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_ptrace_getregs=yes
else
@@ -4379,19 +4377,19 @@ fi
# See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6
-echo "configure:4383: checking for PTRACE_GETFPXREGS" >&5
+echo "configure:4381: checking for PTRACE_GETFPXREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4388 "configure"
+#line 4386 "configure"
#include "confdefs.h"
#include <sys/ptrace.h>
int main() {
PTRACE_GETFPXREGS;
; return 0; }
EOF
-if { (eval echo configure:4395: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_ptrace_getfpxregs=yes
else
@@ -4413,12 +4411,12 @@ fi
# See if <sys/ptrace.h> provides the PT_GETDBREGS request.
echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6
-echo "configure:4417: checking for PT_GETDBREGS" >&5
+echo "configure:4415: checking for PT_GETDBREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4422 "configure"
+#line 4420 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ptrace.h>
@@ -4426,7 +4424,7 @@ int main() {
PT_GETDBREGS;
; return 0; }
EOF
-if { (eval echo configure:4430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_pt_getdbregs=yes
else
@@ -4448,12 +4446,12 @@ fi
# See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6
-echo "configure:4452: checking for PT_GETXMMREGS" >&5
+echo "configure:4450: checking for PT_GETXMMREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_pt_getxmmregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4457 "configure"
+#line 4455 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ptrace.h>
@@ -4461,7 +4459,7 @@ int main() {
PT_GETXMMREGS;
; return 0; }
EOF
-if { (eval echo configure:4465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_pt_getxmmregs=yes
else
@@ -4483,7 +4481,7 @@ fi
echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6
-echo "configure:4487: checking for socketpair in -lsocket" >&5
+echo "configure:4485: checking for socketpair in -lsocket" >&5
ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4491,7 +4489,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4495 "configure"
+#line 4493 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4502,7 +4500,7 @@ int main() {
socketpair()
; return 0; }
EOF
-if { (eval echo configure:4506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4504: \"$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
@@ -4532,12 +4530,12 @@ fi
for ac_func in socketpair
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4536: checking for $ac_func" >&5
+echo "configure:4534: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4541 "configure"
+#line 4539 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4560,7 +4558,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4562: \"$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
@@ -4587,12 +4585,12 @@ done
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:4591: checking whether malloc must be declared" >&5
+echo "configure:4589: checking whether malloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4596 "configure"
+#line 4594 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4613,7 +4611,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:4617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_malloc=no
else
@@ -4634,12 +4632,12 @@ EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:4638: checking whether realloc must be declared" >&5
+echo "configure:4636: checking whether realloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4643 "configure"
+#line 4641 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4660,7 +4658,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:4664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_realloc=no
else
@@ -4681,12 +4679,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:4685: checking whether free must be declared" >&5
+echo "configure:4683: checking whether free must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4690 "configure"
+#line 4688 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4707,7 +4705,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:4711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -4728,12 +4726,12 @@ EOF
fi
echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6
-echo "configure:4732: checking whether strerror must be declared" >&5
+echo "configure:4730: checking whether strerror must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4737 "configure"
+#line 4735 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4754,7 +4752,7 @@ int main() {
char *(*pfn) = (char *(*)) strerror
; return 0; }
EOF
-if { (eval echo configure:4758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4756: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strerror=no
else
@@ -4775,12 +4773,12 @@ EOF
fi
echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6
-echo "configure:4779: checking whether strdup must be declared" >&5
+echo "configure:4777: checking whether strdup must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4784 "configure"
+#line 4782 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4801,7 +4799,7 @@ int main() {
char *(*pfn) = (char *(*)) strdup
; return 0; }
EOF
-if { (eval echo configure:4805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strdup=no
else
@@ -4822,12 +4820,12 @@ EOF
fi
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4826: checking whether strstr must be declared" >&5
+echo "configure:4824: checking whether strstr must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4831 "configure"
+#line 4829 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4848,7 +4846,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:4852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -4869,12 +4867,12 @@ EOF
fi
echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
-echo "configure:4873: checking whether canonicalize_file_name must be declared" >&5
+echo "configure:4871: checking whether canonicalize_file_name must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4878 "configure"
+#line 4876 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4895,7 +4893,7 @@ int main() {
char *(*pfn) = (char *(*)) canonicalize_file_name
; return 0; }
EOF
-if { (eval echo configure:4899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_canonicalize_file_name=no
else
@@ -4921,9 +4919,9 @@ fi
# could be expunged. --jsm 1999-03-22
echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6
-echo "configure:4925: checking for HPUX save_state structure" >&5
+echo "configure:4923: checking for HPUX save_state structure" >&5
cat > conftest.$ac_ext <<EOF
-#line 4927 "configure"
+#line 4925 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -4938,7 +4936,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 4942 "configure"
+#line 4940 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -4991,7 +4989,7 @@ EOF
EOF
;;
- *-*-unixware* | *-*-sysv4.2* | *-*-sysv5*)
+ *-*-unixware* | *-*-sysv4.2* | *-*-sysv5* | *-*-interix* )
cat >> confdefs.h <<\EOF
#define NEW_PROC_API 1
EOF
@@ -5008,12 +5006,12 @@ fi
if test "$ac_cv_header_sys_procfs_h" = yes; then
echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5012: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:5010: checking for pstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5017 "configure"
+#line 5015 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5022,7 +5020,7 @@ int main() {
pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus_t=yes
else
@@ -5044,12 +5042,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5048: checking for prrun_t in sys/procfs.h" >&5
+echo "configure:5046: checking for prrun_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5053 "configure"
+#line 5051 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5058,7 +5056,7 @@ int main() {
prrun_t avar
; return 0; }
EOF
-if { (eval echo configure:5062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prrun_t=yes
else
@@ -5080,12 +5078,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6
echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5084: checking for gregset_t in sys/procfs.h" >&5
+echo "configure:5082: checking for gregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5089 "configure"
+#line 5087 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5094,7 +5092,7 @@ int main() {
gregset_t avar
; return 0; }
EOF
-if { (eval echo configure:5098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_gregset_t=yes
else
@@ -5116,12 +5114,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6
echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5120: checking for fpregset_t in sys/procfs.h" >&5
+echo "configure:5118: checking for fpregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5125 "configure"
+#line 5123 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5130,7 +5128,7 @@ int main() {
fpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:5134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_fpregset_t=yes
else
@@ -5152,12 +5150,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6
echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5156: checking for prgregset_t in sys/procfs.h" >&5
+echo "configure:5154: checking for prgregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5161 "configure"
+#line 5159 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5166,7 +5164,7 @@ int main() {
prgregset_t avar
; return 0; }
EOF
-if { (eval echo configure:5170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prgregset_t=yes
else
@@ -5188,12 +5186,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6
echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5192: checking for prfpregset_t in sys/procfs.h" >&5
+echo "configure:5190: checking for prfpregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5197 "configure"
+#line 5195 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5202,7 +5200,7 @@ int main() {
prfpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:5206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5204: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prfpregset_t=yes
else
@@ -5224,12 +5222,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6
echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5228: checking for prgregset32_t in sys/procfs.h" >&5
+echo "configure:5226: checking for prgregset32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5233 "configure"
+#line 5231 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5238,7 +5236,7 @@ int main() {
prgregset32_t avar
; return 0; }
EOF
-if { (eval echo configure:5242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prgregset32_t=yes
else
@@ -5260,12 +5258,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6
echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5264: checking for prfpregset32_t in sys/procfs.h" >&5
+echo "configure:5262: checking for prfpregset32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5269 "configure"
+#line 5267 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5274,7 +5272,7 @@ int main() {
prfpregset32_t avar
; return 0; }
EOF
-if { (eval echo configure:5278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prfpregset32_t=yes
else
@@ -5296,12 +5294,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6
echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5300: checking for lwpid_t in sys/procfs.h" >&5
+echo "configure:5298: checking for lwpid_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5305 "configure"
+#line 5303 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5310,7 +5308,7 @@ int main() {
lwpid_t avar
; return 0; }
EOF
-if { (eval echo configure:5314: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpid_t=yes
else
@@ -5332,12 +5330,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6
echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5336: checking for psaddr_t in sys/procfs.h" >&5
+echo "configure:5334: checking for psaddr_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5341 "configure"
+#line 5339 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5346,7 +5344,7 @@ int main() {
psaddr_t avar
; return 0; }
EOF
-if { (eval echo configure:5350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psaddr_t=yes
else
@@ -5368,12 +5366,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6
echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5372: checking for prsysent_t in sys/procfs.h" >&5
+echo "configure:5370: checking for prsysent_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5377 "configure"
+#line 5375 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5382,7 +5380,7 @@ int main() {
prsysent_t avar
; return 0; }
EOF
-if { (eval echo configure:5386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prsysent_t=yes
else
@@ -5404,12 +5402,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6
echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5408: checking for pr_sigset_t in sys/procfs.h" >&5
+echo "configure:5406: checking for pr_sigset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5413 "configure"
+#line 5411 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5418,7 +5416,7 @@ int main() {
pr_sigset_t avar
; return 0; }
EOF
-if { (eval echo configure:5422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_sigset_t=yes
else
@@ -5440,12 +5438,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6
echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5444: checking for pr_sigaction64_t in sys/procfs.h" >&5
+echo "configure:5442: checking for pr_sigaction64_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5449 "configure"
+#line 5447 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5454,7 +5452,7 @@ int main() {
pr_sigaction64_t avar
; return 0; }
EOF
-if { (eval echo configure:5458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes
else
@@ -5476,12 +5474,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6
echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5480: checking for pr_siginfo64_t in sys/procfs.h" >&5
+echo "configure:5478: checking for pr_siginfo64_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5485 "configure"
+#line 5483 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5490,7 +5488,7 @@ int main() {
pr_siginfo64_t avar
; return 0; }
EOF
-if { (eval echo configure:5494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes
else
@@ -5517,7 +5515,7 @@ EOF
if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6
-echo "configure:5521: checking whether prfpregset_t type is broken" >&5
+echo "configure:5519: checking whether prfpregset_t type is broken" >&5
if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5525,7 +5523,7 @@ else
gdb_cv_prfpregset_t_broken=yes
else
cat > conftest.$ac_ext <<EOF
-#line 5529 "configure"
+#line 5527 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main ()
@@ -5535,7 +5533,7 @@ else
return 0;
}
EOF
-if { (eval echo configure:5539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_prfpregset_t_broken=no
else
@@ -5560,12 +5558,12 @@ EOF
echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5564: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
+echo "configure:5562: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5569 "configure"
+#line 5567 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <sys/types.h>
@@ -5578,7 +5576,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_procfs_piocset=yes
else
@@ -5602,19 +5600,19 @@ fi
if test ${host} = ${target} ; then
echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:5606: checking for member l_addr in struct link_map" >&5
+echo "configure:5604: checking for member l_addr in struct link_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5611 "configure"
+#line 5609 "configure"
#include "confdefs.h"
#include <link.h>
int main() {
struct link_map lm; (void) lm.l_addr;
; return 0; }
EOF
-if { (eval echo configure:5618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map_with_l_members=yes
else
@@ -5636,12 +5634,12 @@ EOF
echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:5640: checking for member lm_addr in struct link_map" >&5
+echo "configure:5638: checking for member lm_addr in struct link_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5645 "configure"
+#line 5643 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <link.h>
@@ -5649,7 +5647,7 @@ int main() {
struct link_map lm; (void) lm.lm_addr;
; return 0; }
EOF
-if { (eval echo configure:5653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map_with_lm_members=yes
else
@@ -5671,12 +5669,12 @@ EOF
echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6
-echo "configure:5675: checking for member som_addr in struct so_map" >&5
+echo "configure:5673: checking for member som_addr in struct so_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5680 "configure"
+#line 5678 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_NLIST_H
@@ -5687,7 +5685,7 @@ int main() {
struct so_map lm; (void) lm.som_addr;
; return 0; }
EOF
-if { (eval echo configure:5691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_so_map_with_som_members=yes
else
@@ -5709,12 +5707,12 @@ EOF
echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6
-echo "configure:5713: checking for struct link_map32 in sys/link.h" >&5
+echo "configure:5711: checking for struct link_map32 in sys/link.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5718 "configure"
+#line 5716 "configure"
#include "confdefs.h"
#define _SYSCALL32
#include <sys/link.h>
@@ -5722,7 +5720,7 @@ int main() {
struct link_map32 l;
; return 0; }
EOF
-if { (eval echo configure:5726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map32=yes
else
@@ -5748,7 +5746,7 @@ EOF
fi
echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:5752: checking for main in -lm" >&5
+echo "configure:5750: 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
@@ -5756,14 +5754,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5760 "configure"
+#line 5758 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:5767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5765: \"$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
@@ -5792,7 +5790,7 @@ fi
echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6
-echo "configure:5796: checking for wctype in -lc" >&5
+echo "configure:5794: checking for wctype in -lc" >&5
ac_lib_var=`echo c'_'wctype | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5800,7 +5798,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5804 "configure"
+#line 5802 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5811,7 +5809,7 @@ int main() {
wctype()
; return 0; }
EOF
-if { (eval echo configure:5815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5813: \"$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
@@ -5830,7 +5828,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6
-echo "configure:5834: checking for wctype in -lw" >&5
+echo "configure:5832: checking for wctype in -lw" >&5
ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5838,7 +5836,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lw $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5842 "configure"
+#line 5840 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5849,7 +5847,7 @@ int main() {
wctype()
; return 0; }
EOF
-if { (eval echo configure:5853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5851: \"$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
@@ -5881,12 +5879,12 @@ fi
echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6
-echo "configure:5885: checking for long long support in compiler" >&5
+echo "configure:5883: checking for long long support in compiler" >&5
if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5890 "configure"
+#line 5888 "configure"
#include "confdefs.h"
int main() {
@@ -5896,7 +5894,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_c_long_long=yes
else
@@ -5918,7 +5916,7 @@ fi
echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6
-echo "configure:5922: checking for long long support in printf" >&5
+echo "configure:5920: checking for long long support in printf" >&5
if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5926,7 +5924,7 @@ else
gdb_cv_printf_has_long_long=no
else
cat > conftest.$ac_ext <<EOF
-#line 5930 "configure"
+#line 5928 "configure"
#include "confdefs.h"
int main () {
@@ -5940,7 +5938,7 @@ int main () {
return (strcmp ("0x0123456789abcdef", buf));
}
EOF
-if { (eval echo configure:5944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_printf_has_long_long=yes
else
@@ -5964,19 +5962,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6
echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6
-echo "configure:5968: checking for long double support in compiler" >&5
+echo "configure:5966: checking for long double support in compiler" >&5
if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5973 "configure"
+#line 5971 "configure"
#include "confdefs.h"
int main() {
long double foo;
; return 0; }
EOF
-if { (eval echo configure:5980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_long_double=yes
else
@@ -5998,7 +5996,7 @@ fi
echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6
-echo "configure:6002: checking for long double support in printf" >&5
+echo "configure:6000: checking for long double support in printf" >&5
if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6006,7 +6004,7 @@ else
gdb_cv_printf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 6010 "configure"
+#line 6008 "configure"
#include "confdefs.h"
int main () {
@@ -6016,7 +6014,7 @@ int main () {
return (strncmp ("3.14159", buf, 7));
}
EOF
-if { (eval echo configure:6020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_printf_has_long_double=yes
else
@@ -6040,7 +6038,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6
echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6
-echo "configure:6044: checking for long double support in scanf" >&5
+echo "configure:6042: checking for long double support in scanf" >&5
if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6048,7 +6046,7 @@ else
gdb_cv_scanf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 6052 "configure"
+#line 6050 "configure"
#include "confdefs.h"
int main () {
@@ -6058,7 +6056,7 @@ int main () {
return !(f > 3.14159 && f < 3.14160);
}
EOF
-if { (eval echo configure:6062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_scanf_has_long_double=yes
else
@@ -6080,21 +6078,21 @@ EOF
fi
echo "$ac_t""$gdb_cv_scanf_has_long_double" 1>&6
-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:6088: checking for $ac_hdr" >&5
+echo "configure:6086: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6093 "configure"
+#line 6091 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6096: \"$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*
@@ -6123,12 +6121,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6127: checking for $ac_func" >&5
+echo "configure:6125: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6132 "configure"
+#line 6130 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6151,7 +6149,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6153: \"$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
@@ -6176,7 +6174,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6180: checking for working mmap" >&5
+echo "configure:6178: 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
@@ -6184,7 +6182,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 6188 "configure"
+#line 6186 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6212,24 +6210,11 @@ else
#include <fcntl.h>
#include <sys/mman.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
@@ -6337,7 +6322,7 @@ main()
}
EOF
-if { (eval echo configure:6341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6326: \"$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
@@ -6363,7 +6348,7 @@ fi
case ${host_os} in
aix*)
echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6
-echo "configure:6367: checking for -bbigtoc option" >&5
+echo "configure:6352: checking for -bbigtoc option" >&5
if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6377,14 +6362,14 @@ else
LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
cat > conftest.$ac_ext <<EOF
-#line 6381 "configure"
+#line 6366 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:6388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
:
else
echo "configure: failed program was:" >&5
@@ -6407,7 +6392,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
case ${host_os} in
hpux*)
echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6
-echo "configure:6411: checking for HPUX/OSF thread support" >&5
+echo "configure:6396: checking for HPUX/OSF thread support" >&5
if test -f /usr/include/dce/cma_config.h ; then
if test "$GCC" = "yes" ; then
echo "$ac_t""yes" 1>&6
@@ -6426,7 +6411,7 @@ EOF
;;
solaris*)
echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
-echo "configure:6430: checking for Solaris thread debugging library" >&5
+echo "configure:6415: checking for Solaris thread debugging library" >&5
if test -f /usr/lib/libthread_db.so.1 ; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
@@ -6436,7 +6421,7 @@ EOF
CONFIG_LIB_OBS="${CONFIG_LIB_OBS} sol-thread.o"
CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:6440: checking for dlopen in -ldl" >&5
+echo "configure:6425: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6444,7 +6429,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6448 "configure"
+#line 6433 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6455,7 +6440,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:6459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6444: \"$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
@@ -6487,17 +6472,17 @@ fi
# all symbols visible in the dynamic symbol table.
hold_ldflags=$LDFLAGS
echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6
-echo "configure:6491: checking for the ld -export-dynamic flag" >&5
+echo "configure:6476: checking for the ld -export-dynamic flag" >&5
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
cat > conftest.$ac_ext <<EOF
-#line 6494 "configure"
+#line 6479 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:6501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
found=yes
else
@@ -6516,13 +6501,13 @@ rm -f conftest*
# Sun randomly tweaked the prototypes in <proc_service.h>
# at one point.
echo $ac_n "checking if <proc_service.h> is old""... $ac_c" 1>&6
-echo "configure:6520: checking if <proc_service.h> is old" >&5
+echo "configure:6505: checking if <proc_service.h> is old" >&5
if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6526 "configure"
+#line 6511 "configure"
#include "confdefs.h"
#include <proc_service.h>
@@ -6533,7 +6518,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:6537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_proc_service_is_old=no
else
@@ -6561,6 +6546,43 @@ EOF
fi
+if test "x$ac_cv_header_thread_db_h" = "xyes"; then
+ echo $ac_n "checking whether <thread_db.h> has TD_NOTALLOC""... $ac_c" 1>&6
+echo "configure:6552: checking whether <thread_db.h> has TD_NOTALLOC" >&5
+if eval "test \"`echo '$''{'gdb_cv_thread_db_h_has_td_notalloc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6557 "configure"
+#include "confdefs.h"
+#include <thread_db.h>
+int main() {
+int i = TD_NOTALLOC;
+; return 0; }
+EOF
+if { (eval echo configure:6564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gdb_cv_thread_db_h_has_td_notalloc=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gdb_cv_thread_db_h_has_td_notalloc=no
+
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$gdb_cv_thread_db_h_has_td_notalloc" 1>&6
+fi
+if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
+ cat >> confdefs.h <<\EOF
+#define THREAD_DB_HAS_TD_NOTALLOC 1
+EOF
+
+fi
+
# Check whether --enable-gdbcli or --disable-gdbcli was given.
if test "${enable_gdbcli+set}" = set; then
@@ -6752,7 +6774,7 @@ WERROR_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes
then
echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6
-echo "configure:6756: checking compiler warning flags" >&5
+echo "configure:6778: checking compiler warning flags" >&5
# Separate out the -Werror flag as some files just cannot be
# compiled with it enabled.
for w in ${build_warnings}; do
@@ -6762,14 +6784,14 @@ echo "configure:6756: checking compiler warning flags" >&5
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $w"
cat > conftest.$ac_ext <<EOF
-#line 6766 "configure"
+#line 6788 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:6773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
WARN_CFLAGS="${WARN_CFLAGS} $w"
else
@@ -6829,12 +6851,12 @@ fi
if test $want_included_regex = false; then
echo $ac_n "checking for GNU regex""... $ac_c" 1>&6
-echo "configure:6833: checking for GNU regex" >&5
+echo "configure:6855: checking for GNU regex" >&5
if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6838 "configure"
+#line 6860 "configure"
#include "confdefs.h"
#include <gnu-versions.h>
#include <sys/types.h>
@@ -6846,7 +6868,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:6850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_gnu_regex=yes
else
@@ -6875,12 +6897,12 @@ fi
# In the Cygwin environment, we need some additional flags.
echo $ac_n "checking for cygwin""... $ac_c" 1>&6
-echo "configure:6879: checking for cygwin" >&5
+echo "configure:6901: checking for cygwin" >&5
if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6884 "configure"
+#line 6906 "configure"
#include "confdefs.h"
#if defined (__CYGWIN__) || defined (__CYGWIN32__)
@@ -6918,7 +6940,7 @@ if test x$gdb_cv_os_cygwin = xyes; then
else
TERM_LIB=
echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:6922: checking for tgetent in -lncurses" >&5
+echo "configure:6944: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6926,7 +6948,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6930 "configure"
+#line 6952 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6937,7 +6959,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:6941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6963: \"$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
@@ -6956,7 +6978,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6
-echo "configure:6960: checking for tgetent in -lHcurses" >&5
+echo "configure:6982: checking for tgetent in -lHcurses" >&5
ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6964,7 +6986,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lHcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6968 "configure"
+#line 6990 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6975,7 +6997,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:6979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7001: \"$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
@@ -6994,7 +7016,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6
-echo "configure:6998: checking for tgetent in -ltermlib" >&5
+echo "configure:7020: checking for tgetent in -ltermlib" >&5
ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7002,7 +7024,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermlib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7006 "configure"
+#line 7028 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7013,7 +7035,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:7017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7039: \"$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
@@ -7032,7 +7054,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:7036: checking for tgetent in -ltermcap" >&5
+echo "configure:7058: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7040,7 +7062,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7044 "configure"
+#line 7066 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7051,7 +7073,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:7055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7077: \"$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
@@ -7070,7 +7092,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:7074: checking for tgetent in -lcurses" >&5
+echo "configure:7096: checking for tgetent in -lcurses" >&5
ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7078,7 +7100,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7082 "configure"
+#line 7104 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7089,7 +7111,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:7093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7115: \"$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
@@ -7108,7 +7130,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6
-echo "configure:7112: checking for tgetent in -lterminfo" >&5
+echo "configure:7134: checking for tgetent in -lterminfo" >&5
ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7116,7 +7138,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lterminfo $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7120 "configure"
+#line 7142 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7127,7 +7149,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:7131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7153: \"$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
@@ -7292,7 +7314,7 @@ if test "${with_tclconfig+set}" = set; then
fi
echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
-echo "configure:7296: checking for Tcl configuration" >&5
+echo "configure:7318: checking for Tcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7400,7 +7422,7 @@ if test "${with_tkconfig+set}" = set; then
fi
echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
-echo "configure:7404: checking for Tk configuration" >&5
+echo "configure:7426: checking for Tk configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7509,7 +7531,7 @@ fi
no_tcl=true
echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6
-echo "configure:7513: checking for Tcl private headers. dir=${configdir}" >&5
+echo "configure:7535: checking for Tcl private headers. dir=${configdir}" >&5
# Check whether --with-tclinclude or --without-tclinclude was given.
if test "${with_tclinclude+set}" = set; then
withval="$with_tclinclude"
@@ -7575,17 +7597,17 @@ fi
if test x"${ac_cv_c_tclh}" = x ; then
ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6
-echo "configure:7579: checking for tclInt.h" >&5
+echo "configure:7601: checking for tclInt.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7584 "configure"
+#line 7606 "configure"
#include "confdefs.h"
#include <tclInt.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7611: \"$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*
@@ -7645,7 +7667,7 @@ fi
#
no_tk=true
echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
-echo "configure:7649: checking for Tk private headers" >&5
+echo "configure:7671: checking for Tk private headers" >&5
# Check whether --with-tkinclude or --without-tkinclude was given.
if test "${with_tkinclude+set}" = set; then
withval="$with_tkinclude"
@@ -7711,17 +7733,17 @@ fi
if test x"${ac_cv_c_tkh}" = x ; then
ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tk.h""... $ac_c" 1>&6
-echo "configure:7715: checking for tk.h" >&5
+echo "configure:7737: checking for tk.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7720 "configure"
+#line 7742 "configure"
#include "confdefs.h"
#include <tk.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7747: \"$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*
@@ -7767,7 +7789,7 @@ fi
echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:7771: checking for Itcl private headers. srcdir=${srcdir}" >&5
+echo "configure:7793: checking for Itcl private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_itclh}" = x ; then
for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
if test -f $i/generic/itcl.h ; then
@@ -7790,7 +7812,7 @@ fi
echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:7794: checking for Itk private headers. srcdir=${srcdir}" >&5
+echo "configure:7816: checking for Itk private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_itkh}" = x ; then
for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
if test -f $i/generic/itk.h ; then
@@ -7813,7 +7835,7 @@ fi
echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:7817: checking for Tix private headers. srcdir=${srcdir}" >&5
+echo "configure:7839: checking for Tix private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_tixh}" = x ; then
for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do
if test -f $i/generic/tix.h ; then
@@ -7865,7 +7887,7 @@ if test "${with_itclconfig+set}" = set; then
fi
echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6
-echo "configure:7869: checking for Itcl configuration" >&5
+echo "configure:7891: checking for Itcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7968,7 +7990,7 @@ if test "${with_itkconfig+set}" = set; then
fi
echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6
-echo "configure:7972: checking for Itk configuration" >&5
+echo "configure:7994: checking for Itk configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8071,7 +8093,7 @@ if test "${with_tixconfig+set}" = set; then
fi
echo $ac_n "checking for Tix configuration""... $ac_c" 1>&6
-echo "configure:8075: checking for Tix configuration" >&5
+echo "configure:8097: checking for Tix configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tixconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8217,7 +8239,7 @@ fi
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:8221: checking for X" >&5
+echo "configure:8243: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -8279,12 +8301,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 8283 "configure"
+#line 8305 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8310: \"$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*
@@ -8353,14 +8375,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8357 "configure"
+#line 8379 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:8364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -8652,7 +8674,7 @@ fi
# ``gdbserver'' can only be built in a native configuration.
if test x"${target}" = x"${host}"; then
echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6
-echo "configure:8656: checking whether gdbserver is supported on this host" >&5
+echo "configure:8678: checking whether gdbserver is supported on this host" >&5
if test x"${build_gdbserver}" = xyes ; then
configdirs="${configdirs} gdbserver"
SUBDIRS="${SUBDIRS} gdbserver"
@@ -8714,7 +8736,7 @@ fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:8718: checking whether ln -s works" >&5
+echo "configure:8740: 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
@@ -8738,12 +8760,12 @@ fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:8742: checking for Cygwin environment" >&5
+echo "configure:8764: 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 <<EOF
-#line 8747 "configure"
+#line 8769 "configure"
#include "confdefs.h"
int main() {
@@ -8754,7 +8776,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:8758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -8771,19 +8793,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:8775: checking for mingw32 environment" >&5
+echo "configure:8797: 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 <<EOF
-#line 8780 "configure"
+#line 8802 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:8787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -8802,7 +8824,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:8806: checking for executable suffix" >&5
+echo "configure:8828: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8812,10 +8834,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:8816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:8838: \"$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
@@ -8854,7 +8876,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:8858: checking for iconv" >&5
+echo "configure:8880: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8862,7 +8884,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 8866 "configure"
+#line 8888 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -8872,7 +8894,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:8876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -8884,7 +8906,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
cat > conftest.$ac_ext <<EOF
-#line 8888 "configure"
+#line 8910 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -8894,7 +8916,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:8898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_lib_iconv=yes
am_cv_func_iconv=yes
@@ -8915,13 +8937,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:8919: checking for iconv declaration" >&5
+echo "configure:8941: checking for iconv declaration" >&5
if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8925 "configure"
+#line 8947 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -8940,7 +8962,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:8944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
diff --git a/gdb/configure.in b/gdb/configure.in
index 7bb455e39fd..4c2e06363a5 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -279,7 +279,7 @@ if test "${target}" = "${host}"; then
ia64-*-aix*)
AC_DEFINE(NEW_PROC_API)
;;
- *-*-unixware* | *-*-sysv4.2* | *-*-sysv5*)
+ *-*-unixware* | *-*-sysv4.2* | *-*-sysv5* | *-*-interix* )
AC_DEFINE(NEW_PROC_API)
;;
*-*-solaris2.[[678]])
@@ -600,6 +600,23 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
AC_SUBST(CONFIG_LDFLAGS)
fi
+dnl See if we have a thread_db header file that has TD_NOTALLOC.
+if test "x$ac_cv_header_thread_db_h" = "xyes"; then
+ AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTALLOC],
+ gdb_cv_thread_db_h_has_td_notalloc,
+ AC_TRY_COMPILE(
+ [#include <thread_db.h>],
+ [int i = TD_NOTALLOC;],
+ gdb_cv_thread_db_h_has_td_notalloc=yes,
+ gdb_cv_thread_db_h_has_td_notalloc=no
+ )
+ )
+fi
+if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
+ AC_DEFINE(THREAD_DB_HAS_TD_NOTALLOC, 1,
+ [Define if <thread_db.h> has the TD_NOTALLOC error code.])
+fi
+
dnl The CLI cannot be disabled yet, but may be in the future
dnl Handle CLI sub-directory configury.
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 896fbb18cb3..d272950a845 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -38,9 +38,11 @@ esac
case "${target}" in
+*-*-freebsd*) gdb_target=fbsd
+ ;;
+
alpha*-*-osf*) gdb_target=alpha-osf1 ;;
alpha*-*-linux*) gdb_target=alpha-linux ;;
-alpha*-*-freebsd*) gdb_target=fbsd ;;
alpha*-*-netbsd*) gdb_target=nbsd ;;
alpha*-*-*) gdb_target=alpha ;;
@@ -91,9 +93,8 @@ i[3456]86-sequent-sysv*) gdb_target=ptx ;;
i[3456]86-ncr-*) gdb_target=ncr3000 ;;
# OBSOLETE i[3456]86-*-aix*) gdb_target=i386aix ;;
i[3456]86-*-bsd*) gdb_target=i386bsd ;;
-i[3456]86-*-freebsd*) gdb_target=fbsd ;;
i[3456]86-*-netbsd*) gdb_target=nbsd ;;
-i[3456]86-*-openbsd*) gdb_target=nbsd ;; # FIXME: needs its own target
+i[3456]86-*-openbsd*) gdb_target=obsd ;;
# OBSOLETE i[3456]86-*-os9k) gdb_target=i386os9k ;;
i[3456]86-*-go32*) gdb_target=i386aout ;;
i[3456]86-*-msdosdjgpp*) gdb_target=go32 ;;
@@ -268,8 +269,6 @@ sparc86x-*-*) gdb_target=sparclite ;;
# regs (some of which are usable in v8plus) so sp64sol.mt hasn't been
# deleted though presumably it should be eventually.
#sparc64-*-solaris2*) gdb_target=sp64sol2 ;;
-sparc64-*-freebsd*|ultrasparc-*-freebsd*|sparcv9-*-freebsd*)
- gdb_target=fbsd ;;
sparc64-*-linux*) gdb_target=sp64linux ;;
sparc64-*-netbsd*) gdb_target=nbsd64 ;;
sparcv9-*-* | sparc64-*-*) gdb_target=sp64 ;;
@@ -293,7 +292,6 @@ x86_64-*-linux*) gdb_target=x86-64linux
build_gdbserver=yes
;;
-
z8k-*-coff*) gdb_target=z8k ;;
esac
diff --git a/gdb/core-sol2.c b/gdb/core-sol2.c
index 0123cf4b5e1..f978b68e784 100644
--- a/gdb/core-sol2.c
+++ b/gdb/core-sol2.c
@@ -94,15 +94,19 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
struct regs *gregs = (struct regs *) core_reg_sect;
/* G0 *always* holds 0. */
- *(int *) &registers[REGISTER_BYTE (0)] = 0;
+ *(int *) &deprecated_registers[REGISTER_BYTE (0)] = 0;
/* The globals and output registers. */
- memcpy (&registers[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1,
- 15 * REGISTER_RAW_SIZE (G1_REGNUM));
- *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
- *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
- *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc;
- *(int *) &registers[REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
+ memcpy (&deprecated_registers[REGISTER_BYTE (G1_REGNUM)],
+ &gregs->r_g1, 15 * REGISTER_RAW_SIZE (G1_REGNUM));
+ *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)]
+ = gregs->r_ps;
+ *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)]
+ = gregs->r_pc;
+ *(int *) &deprecated_registers[REGISTER_BYTE (NPC_REGNUM)]
+ = gregs->r_npc;
+ *(int *) &deprecated_registers[REGISTER_BYTE (Y_REGNUM)]
+ = gregs->r_y;
/* My best guess at where to get the locals and input
registers is exactly where they usually are, right above
@@ -112,9 +116,9 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
{
int sp;
- sp = *(int *) &registers[REGISTER_BYTE (SP_REGNUM)];
+ sp = *(int *) &deprecated_registers[REGISTER_BYTE (SP_REGNUM)];
if (0 != target_read_memory (sp,
- &registers[REGISTER_BYTE (L0_REGNUM)],
+ &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM)))
{
warning ("couldn't read input and local registers from core file\n");
@@ -163,10 +167,10 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
{
struct fpu *fpuregs = (struct fpu *) core_reg_sect;
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &fpuregs->fpu_fr,
- sizeof (fpuregs->fpu_fr));
- memcpy (&registers[REGISTER_BYTE (FPS_REGNUM)], &fpuregs->fpu_fsr,
- sizeof (FPU_FSR_TYPE));
+ memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ &fpuregs->fpu_fr, sizeof (fpuregs->fpu_fr));
+ memcpy (&deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
+ &fpuregs->fpu_fsr, sizeof (FPU_FSR_TYPE));
}
else
{
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 4f6eef2ce72..be0ecf0e3b0 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -356,6 +356,14 @@ read_memory_string (CORE_ADDR memaddr, char *buffer, int max_len)
}
}
+CORE_ADDR
+read_memory_typed_address (CORE_ADDR addr, struct type *type)
+{
+ char *buf = alloca (TYPE_LENGTH (type));
+ read_memory (addr, buf, TYPE_LENGTH (type));
+ return extract_typed_address (buf, type);
+}
+
/* Same as target_write_memory, but report an error if can't write. */
void
write_memory (CORE_ADDR memaddr, char *myaddr, int len)
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 785b8e14323..f7e3cf0f425 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -466,7 +466,7 @@ get_core_registers (int regno)
get_core_register_section (".reg2", 2, "floating-point", 0);
get_core_register_section (".reg-xfp", 3, "extended floating-point", 0);
- registers_fetched ();
+ deprecated_registers_fetched ();
}
static void
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 28dc0259c24..f362d847536 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -161,21 +161,13 @@ cp_print_class_method (char *valaddr,
}
}
-/* This was what it was for gcc 2.4.5 and earlier. */
-static const char vtbl_ptr_name_old[] =
-{
- CPLUS_MARKER, 'v', 't', 'b', 'l', '_', 'p', 't', 'r', '_',
- 't', 'y', 'p', 'e', 0
-};
-
-/* It was changed to this after 2.4.5. */
+/* GCC versions after 2.4.5 use this. */
const char vtbl_ptr_name[] = "__vtbl_ptr_type";
-/* HP aCC uses different names */
+/* HP aCC uses different names. */
const char hpacc_vtbl_ptr_name[] = "__vfp";
const char hpacc_vtbl_ptr_type_name[] = "__vftyp";
-
/* Return truth value for assertion that TYPE is of the type
"pointer to virtual function". */
@@ -184,9 +176,7 @@ cp_is_vtbl_ptr_type (struct type *type)
{
char *typename = type_name_no_tag (type);
- return (typename != NULL
- && (STREQ (typename, vtbl_ptr_name)
- || STREQ (typename, vtbl_ptr_name_old)));
+ return (typename != NULL && !strcmp (typename, vtbl_ptr_name));
}
/* Return truth value for the assertion that TYPE is of the type
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 5d64d43f1f6..046c08b072a 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -972,7 +972,7 @@ cris_abi_original_store_return_value (struct type *type, char *valbuf)
int len = TYPE_LENGTH (type);
if (len <= REGISTER_SIZE)
- write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf, len);
+ deprecated_write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf, len);
else
internal_error (__FILE__, __LINE__, "cris_abi_original_store_return_value: type length too large.");
}
@@ -987,7 +987,8 @@ cris_abi_v2_store_return_value (struct type *type, char *valbuf)
if (len <= 2 * REGISTER_SIZE)
{
/* Note that this works since R10 and R11 are consecutive registers. */
- write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf, len);
+ deprecated_write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf,
+ len);
}
else
internal_error (__FILE__, __LINE__, "cris_abi_v2_store_return_value: type length too large.");
@@ -3706,8 +3707,8 @@ cris_fpless_backtrace (char *noargs, int from_tty)
function (since there's no push srp in that case). */
int innermost_frame = 1;
- read_register_gen (PC_REGNUM, (char *) &pc);
- read_register_gen (SP_REGNUM, (char *) &sp);
+ deprecated_read_register_gen (PC_REGNUM, (char *) &pc);
+ deprecated_read_register_gen (SP_REGNUM, (char *) &sp);
/* We make an explicit return when we can't find an outer frame. */
while (1)
@@ -3846,7 +3847,7 @@ cris_fpless_backtrace (char *noargs, int from_tty)
/* We couldn't find a push srp in the prologue, so this must be
a leaf function, and thus we use the srp register directly.
This should happen at most once, for the innermost function. */
- read_register_gen (SRP_REGNUM, (char *) &pc);
+ deprecated_read_register_gen (SRP_REGNUM, (char *) &pc);
}
else
{
@@ -4289,7 +4290,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
- set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
+ set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
/* No register requires conversion from raw format to virtual format. */
set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not);
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index d338ff47810..1b2987ad67e 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -486,15 +486,15 @@ d10v_store_return_value (struct type *type, char *valbuf)
if (TYPE_LENGTH (type) == 1
&& TYPE_CODE (type) == TYPE_CODE_INT)
{
- write_register_bytes (REGISTER_BYTE (RET1_REGNUM),
- &tmp, 1); /* zero the high byte */
- write_register_bytes (REGISTER_BYTE (RET1_REGNUM) + 1,
- valbuf, 1); /* copy the low byte */
+ /* zero the high byte */
+ deprecated_write_register_bytes (REGISTER_BYTE (RET1_REGNUM), &tmp, 1);
+ /* copy the low byte */
+ deprecated_write_register_bytes (REGISTER_BYTE (RET1_REGNUM) + 1,
+ valbuf, 1);
}
else
- write_register_bytes (REGISTER_BYTE (RET1_REGNUM),
- valbuf,
- TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (RET1_REGNUM),
+ valbuf, TYPE_LENGTH (type));
}
/* Extract from an array REGBUF containing the (raw) register state
@@ -558,7 +558,8 @@ do_d10v_pop_frame (struct frame_info *fi)
if (fi->saved_regs[regnum])
{
read_memory (fi->saved_regs[regnum], raw_buffer, REGISTER_RAW_SIZE (regnum));
- write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, REGISTER_RAW_SIZE (regnum));
+ deprecated_write_register_bytes (REGISTER_BYTE (regnum), raw_buffer,
+ REGISTER_RAW_SIZE (regnum));
}
}
for (regnum = 0; regnum < SP_REGNUM; regnum++)
@@ -977,7 +978,7 @@ show_regs (char *args, int from_tty)
char num[MAX_REGISTER_RAW_SIZE];
int i;
printf_filtered (" ");
- read_register_gen (a, (char *) &num);
+ deprecated_read_register_gen (a, (char *) &num);
for (i = 0; i < MAX_REGISTER_RAW_SIZE; i++)
{
printf_filtered ("%02x", (num[i] & 0xff));
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 6592b74338b..0cf70919972 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -167,34 +167,34 @@ static int has_line_numbers;
/* Complaints about the symbols we have encountered. */
-struct complaint lbrac_complaint =
+struct deprecated_complaint lbrac_complaint =
{"bad block start address patched", 0, 0};
-struct complaint string_table_offset_complaint =
+struct deprecated_complaint string_table_offset_complaint =
{"bad string table offset in symbol %d", 0, 0};
-struct complaint unknown_symtype_complaint =
+struct deprecated_complaint unknown_symtype_complaint =
{"unknown symbol type %s", 0, 0};
-struct complaint unknown_symchar_complaint =
+struct deprecated_complaint unknown_symchar_complaint =
{"unknown symbol descriptor `%c'", 0, 0};
-struct complaint lbrac_rbrac_complaint =
+struct deprecated_complaint lbrac_rbrac_complaint =
{"block start larger than block end", 0, 0};
-struct complaint lbrac_unmatched_complaint =
+struct deprecated_complaint lbrac_unmatched_complaint =
{"unmatched N_LBRAC before symtab pos %d", 0, 0};
-struct complaint lbrac_mismatch_complaint =
+struct deprecated_complaint lbrac_mismatch_complaint =
{"N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d", 0, 0};
-struct complaint repeated_header_complaint =
+struct deprecated_complaint repeated_header_complaint =
{"\"repeated\" header file %s not previously seen, at symtab pos %d", 0, 0};
-struct complaint unclaimed_bincl_complaint =
+struct deprecated_complaint unclaimed_bincl_complaint =
{"N_BINCL %s not in entries for any file, at symtab pos %d", 0, 0};
-struct complaint discarding_local_symbols_complaint =
+struct deprecated_complaint discarding_local_symbols_complaint =
{"misplaced N_LBRAC entry; discarding local symbols which have no enclosing block", 0, 0};
/* find_text_range --- find start and end of loadable code sections
@@ -1360,7 +1360,7 @@ read_dbx_symtab (struct objfile *objfile)
switch (nlist.n_type)
{
- static struct complaint function_outside_compilation_unit = {
+ static struct deprecated_complaint function_outside_compilation_unit = {
"function `%s' appears to be defined outside of all compilation units", 0, 0
};
char *p;
diff --git a/gdb/defs.h b/gdb/defs.h
index d13cd699b21..48eb509ebe6 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -157,10 +157,6 @@ typedef bfd_vma CORE_ADDR;
#define STREQ(a,b) (*(a) == *(b) ? !strcmp ((a), (b)) : 0)
#define STREQN(a,b,c) (*(a) == *(b) ? !strncmp ((a), (b), (c)) : 0)
-/* The character GNU C++ uses to build identifiers that must be unique from
- the program's identifiers (such as $this and $$vptr). */
-#define CPLUS_MARKER '$' /* May be overridden to '.' for SysV */
-
/* Check if a character is one of the commonly used C++ marker characters. */
extern int is_cplus_marker (int);
@@ -209,6 +205,7 @@ enum language
language_auto, /* Placeholder for automatic setting */
language_c, /* C */
language_cplus, /* C++ */
+ language_objc, /* Objective-C */
language_java, /* Java */
/* OBSOLETE language_chill, */ /* Chill */
language_fortran, /* Fortran */
@@ -446,6 +443,8 @@ extern void puts_filtered (const char *);
extern void puts_unfiltered (const char *);
+extern void puts_filtered_tabular (char *string, int width, int right);
+
extern void puts_debug (char *prefix, char *string, char *suffix);
extern void vprintf_filtered (const char *, va_list) ATTR_FORMAT (printf, 1, 0);
diff --git a/gdb/demangle.c b/gdb/demangle.c
index 1fd69be4c58..2b9579bc59c 100644
--- a/gdb/demangle.c
+++ b/gdb/demangle.c
@@ -150,24 +150,18 @@ set_demangling_style (char *style)
set_demangling_command ((char *) NULL, 0, (struct cmd_list_element *) NULL);
}
-/* In order to allow a single demangler executable to demangle strings
- using various common values of CPLUS_MARKER, as well as any specific
- one set at compile time, we maintain a string containing all the
- commonly used ones, and check to see if the marker we are looking for
- is in that string. CPLUS_MARKER is usually '$' on systems where the
- assembler can deal with that. Where the assembler can't, it's usually
- '.' (but on many systems '.' is used for other things). We put the
- current defined CPLUS_MARKER first (which defaults to '$'), followed
- by the next most common value, followed by an explicit '$' in case
- the value of CPLUS_MARKER is not '$'.
-
- We could avoid this if we could just get g++ to tell us what the actual
- cplus marker character is as part of the debug information, perhaps by
- ensuring that it is the character that terminates the gcc<n>_compiled
- marker symbol (FIXME). */
-
-static char cplus_markers[] =
-{CPLUS_MARKER, '.', '$', '\0'};
+/* G++ uses a special character to indicate certain internal names. Which
+ character it is depends on the platform:
+ - Usually '$' on systems where the assembler will accept that
+ - Usually '.' otherwise (this includes most sysv4-like systems and most
+ ELF targets)
+ - Occasionally '_' if neither of the above is usable
+
+ We check '$' first because it is the safest, and '.' often has another
+ meaning. We don't currently try to handle '_' because the precise forms
+ of the names are different on those targets. */
+
+static char cplus_markers[] = {'$', '.', '\0'};
int
is_cplus_marker (int c)
@@ -204,5 +198,4 @@ Use `set demangle-style' without arguments for a list of demangling styles.",
/* Set the default demangling style chosen at compilation time. */
set_demangling_style (DEFAULT_DEMANGLING_STYLE);
- set_cplus_marker_for_demangling (CPLUS_MARKER);
}
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 749f1811fa7..7f05283d24b 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,31 @@
+2002-10-26 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Delete
+ definition of DO_REGISTERS_INFO.
+
+2002-10-18 Kevin Buettner <kevinb@redhat.com>
+
+ * gdbint.texinfo (Address Classes): Fix problems with insertion
+ of ``{'' and ``}'' in example.
+
+2002-10-17 Kevin Buettner <kevinb@redhat.com>
+
+ * gdbint.texinfo (Address Classes): New section.
+ (Target Conditionals): Document ADDRESS_CLASS_NAME_TO_TYPE_FLAGS,
+ ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P, ADDRESS_CLASS_TYPE_FLAGS,
+ ADDRESS_CLASS_TYPE_FLAGS_P, ADDRESS_CLASS_TYPE_FLAGS_TO_NAME, and
+ ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P.
+
+2002-10-11 Klee Dienes <kdienes@apple.com>
+
+ * gdb.texinfo (Registers): Mention vector registers as well as
+ floating registers in the documentation for 'info registers' and
+ 'info all-registers'.
+
+2002-10-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbint.texinfo (CPLUS_MARKER): Remove item.
+
2002-10-03 Jeff Johnston <jjohnstn@redhat.com>
* gdbint.texinfo (Item Output Functions): Add new ui_out_field_fmt_int
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 9269c5dcc40..56db6ca04fe 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -5557,13 +5557,13 @@ your machine.
@kindex info registers
@item info registers
Print the names and values of all registers except floating-point
-registers (in the selected stack frame).
+and vector registers (in the selected stack frame).
@kindex info all-registers
@cindex floating point registers
@item info all-registers
Print the names and values of all registers, including floating-point
-registers.
+and vector registers (in the selected stack frame).
@item info registers @var{regname} @dots{}
Print the @dfn{relativized} value of each specified register @var{regname}.
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 01587ecd578..0cdbc053376 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -2630,6 +2630,91 @@ This function may safely assume that @var{type} is either a pointer or a
C@t{++} reference type.
@end deftypefn
+@section Address Classes
+@cindex address classes
+@cindex DW_AT_byte_size
+@cindex DW_AT_address_class
+
+Sometimes information about different kinds of addresses is available
+via the debug information. For example, some programming environments
+define addresses of several different sizes. If the debug information
+distinguishes these kinds of address classes through either the size
+info (e.g, @code{DW_AT_byte_size} in @w{DWARF 2}) or through an explicit
+address class attribute (e.g, @code{DW_AT_address_class} in @w{DWARF 2}), the
+following macros should be defined in order to disambiguate these
+types within @value{GDBN} as well as provide the added information to
+a @value{GDBN} user when printing type expressions.
+
+@deftypefn {Target Macro} int ADDRESS_CLASS_TYPE_FLAGS (int @var{byte_size}, int @var{dwarf2_addr_class})
+Returns the type flags needed to construct a pointer type whose size
+is @var{byte_size} and whose address class is @var{dwarf2_addr_class}.
+This function is normally called from within a symbol reader. See
+@file{dwarf2read.c}.
+@end deftypefn
+
+@deftypefn {Target Macro} char *ADDRESS_CLASS_TYPE_FLAGS_TO_NAME (int @var{type_flags})
+Given the type flags representing an address class qualifier, return
+its name.
+@end deftypefn
+@deftypefn {Target Macro} int ADDRESS_CLASS_NAME_to_TYPE_FLAGS (int @var{name}, int *var{type_flags_ptr})
+Given an address qualifier name, set the @code{int} refererenced by @var{type_flags_ptr} to the type flags
+for that address class qualifier.
+@end deftypefn
+
+Since the need for address classes is rather rare, none of
+the address class macros defined by default. Predicate
+macros are provided to detect when they are defined.
+
+Consider a hypothetical architecture in which addresses are normally
+32-bits wide, but 16-bit addresses are also supported. Furthermore,
+suppose that the @w{DWARF 2} information for this architecture simply
+uses a @code{DW_AT_byte_size} value of 2 to indicate the use of one
+of these "short" pointers. The following functions could be defined
+to implement the address class macros:
+
+@smallexample
+somearch_address_class_type_flags (int byte_size,
+ int dwarf2_addr_class)
+@{
+ if (byte_size == 2)
+ return TYPE_FLAG_ADDRESS_CLASS_1;
+ else
+ return 0;
+@}
+
+static char *
+somearch_address_class_type_flags_to_name (int type_flags)
+@{
+ if (type_flags & TYPE_FLAG_ADDRESS_CLASS_1)
+ return "short";
+ else
+ return NULL;
+@}
+
+int
+somearch_address_class_name_to_type_flags (char *name,
+ int *type_flags_ptr)
+@{
+ if (strcmp (name, "short") == 0)
+ @{
+ *type_flags_ptr = TYPE_FLAG_ADDRESS_CLASS_1;
+ return 1;
+ @}
+ else
+ return 0;
+@}
+@end smallexample
+
+The qualifier @code{@@short} is used in @value{GDBN}'s type expressions
+to indicate the presence of one of these "short" pointers. E.g, if
+the debug information indicates that @code{short_ptr_var} is one of these
+short pointers, @value{GDBN} might show the following behavior:
+
+@smallexample
+(gdb) ptype short_ptr_var
+type = int * @@short
+@end smallexample
+
@section Raw and Virtual Register Representations
@cindex raw register representation
@@ -2857,6 +2942,49 @@ boundaries, the processor masks out these bits to generate the actual
address of the instruction. ADDR_BITS_REMOVE should filter out these
bits with an expression such as @code{((addr) & ~3)}.
+@item ADDRESS_CLASS_NAME_TO_TYPE_FLAGS (@var{name}, @var{type_flags_ptr})
+@findex ADDRESS_CLASS_NAME_TO_TYPE_FLAGS
+If @var{name} is a valid address class qualifier name, set the @code{int}
+referenced by @var{type_flags_ptr} to the mask representing the qualifier
+and return 1. If @var{name} is not a valid address class qualifier name,
+return 0.
+
+The value for @var{type_flags_ptr} should be one of
+@code{TYPE_FLAG_ADDRESS_CLASS_1}, @code{TYPE_FLAG_ADDRESS_CLASS_2}, or
+possibly some combination of these values or'd together.
+@xref{Target Architecture Definition, , Address Classes}.
+
+@item ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P ()
+@findex ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P
+Predicate which indicates whether @code{ADDRESS_CLASS_NAME_TO_TYPE_FLAGS}
+has been defined.
+
+@item ADDRESS_CLASS_TYPE_FLAGS (@var{byte_size}, @var{dwarf2_addr_class})
+@findex ADDRESS_CLASS_TYPE_FLAGS (@var{byte_size}, @var{dwarf2_addr_class})
+Given a pointers byte size (as described by the debug information) and
+the possible @code{DW_AT_address_class} value, return the type flags
+used by @value{GDBN} to represent this address class. The value
+returned should be one of @code{TYPE_FLAG_ADDRESS_CLASS_1},
+@code{TYPE_FLAG_ADDRESS_CLASS_2}, or possibly some combination of these
+values or'd together.
+@xref{Target Architecture Definition, , Address Classes}.
+
+@item ADDRESS_CLASS_TYPE_FLAGS_P ()
+@findex ADDRESS_CLASS_TYPE_FLAGS_P
+Predicate which indicates whether @code{ADDRESS_CLASS_TYPE_FLAGS} has
+been defined.
+
+@item ADDRESS_CLASS_TYPE_FLAGS_TO_NAME (@var{type_flags})
+@findex ADDRESS_CLASS_TYPE_FLAGS_TO_NAME
+Return the name of the address class qualifier associated with the type
+flags given by @var{type_flags}.
+
+@item ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P ()
+@findex ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P
+Predicate which indicates whether @code{ADDRESS_CLASS_TYPE_FLAGS_TO_NAME} has
+been defined.
+@xref{Target Architecture Definition, , Address Classes}.
+
@item ADDRESS_TO_POINTER (@var{type}, @var{buf}, @var{addr})
@findex ADDRESS_TO_POINTER
Store in @var{buf} a pointer of type @var{type} representing the address
@@ -3069,13 +3197,6 @@ Return non-zero if register @var{regnum} can represent data values in a
non-standard form.
@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}.
-@item CPLUS_MARKER
-@findex CPLUS_MARKERz
-Define this to expand into the character that G@t{++} uses to distinguish
-compiler-generated identifiers from programmer-specified identifiers.
-By default, this expands into @code{'$'}. Most System V targets should
-define this to @code{'.'}.
-
@item DBX_PARM_SYMBOL_CLASS
@findex DBX_PARM_SYMBOL_CLASS
Hook for the @code{SYMBOL_CLASS} of a parameter when decoding DBX symbol
@@ -3097,12 +3218,6 @@ Similarly, for hardware breakpoints.
If defined, this should evaluate to 1 if @var{addr} is in a shared
library in which breakpoints cannot be set and so should be disabled.
-@item DO_REGISTERS_INFO
-@findex DO_REGISTERS_INFO
-If defined, use this to print the value of a register or all registers.
-
-This method is deprecated.
-
@item PRINT_FLOAT_INFO()
@findex PRINT_FLOAT_INFO
If defined, then the @samp{info float} command will print information about
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
new file mode 100644
index 00000000000..ddc4db8f4b3
--- /dev/null
+++ b/gdb/dummy-frame.c
@@ -0,0 +1,310 @@
+/* Code dealing with dummy stack frames, for GDB, the GNU debugger.
+
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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 "defs.h"
+#include "dummy-frame.h"
+#include "regcache.h"
+#include "frame.h"
+#include "inferior.h"
+#include "gdb_assert.h"
+
+/* Dummy frame. This saves the processor state just prior to setting
+ up the inferior function call. Older targets save the registers
+ on the target stack (but that really slows down function calls). */
+
+struct dummy_frame
+{
+ struct dummy_frame *next;
+
+ CORE_ADDR pc;
+ CORE_ADDR fp;
+ CORE_ADDR sp;
+ CORE_ADDR top;
+ struct regcache *regcache;
+
+ /* Address range of the call dummy code. Look for PC in the range
+ [LO..HI) (after allowing for DECR_PC_AFTER_BREAK). */
+ CORE_ADDR call_lo;
+ CORE_ADDR call_hi;
+};
+
+static struct dummy_frame *dummy_frame_stack = NULL;
+
+/* Function: find_dummy_frame(pc, fp, sp)
+
+ Search the stack of dummy frames for one matching the given PC and
+ FP/SP. Unlike PC_IN_CALL_DUMMY, this function doesn't need to
+ adjust for DECR_PC_AFTER_BREAK. This is because it is only legal
+ to call this function after the PC has been adjusted. */
+
+static struct dummy_frame *
+find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
+{
+ struct dummy_frame *dummyframe;
+
+ for (dummyframe = dummy_frame_stack; dummyframe != NULL;
+ dummyframe = dummyframe->next)
+ {
+ /* Does the PC fall within the dummy frame's breakpoint
+ instruction. If not, discard this one. */
+ if (!(pc >= dummyframe->call_lo && pc < dummyframe->call_hi))
+ continue;
+ /* Does the FP match? */
+ if (dummyframe->top != 0)
+ {
+ /* If the target architecture explicitly saved the
+ top-of-stack before the inferior function call, assume
+ that that same architecture will always pass in an FP
+ (frame base) value that eactly matches that saved TOS.
+ Don't check the saved SP and SP as they can lead to false
+ hits. */
+ if (fp != dummyframe->top)
+ continue;
+ }
+ else
+ {
+ /* An older target that hasn't explicitly or implicitly
+ saved the dummy frame's top-of-stack. Try matching the
+ FP against the saved SP and FP. NOTE: If you're trying
+ to fix a problem with GDB not correctly finding a dummy
+ frame, check the comments that go with FRAME_ALIGN() and
+ SAVE_DUMMY_FRAME_TOS(). */
+ if (fp != dummyframe->fp && fp != dummyframe->sp)
+ continue;
+ }
+ /* The FP matches this dummy frame. */
+ return dummyframe;
+ }
+
+ return NULL;
+}
+
+struct dummy_frame *
+cached_find_dummy_frame (struct frame_info *frame, void **cache)
+{
+ if ((*cache) == NULL)
+ (*cache) = find_dummy_frame (frame->pc, frame->frame);
+ return (*cache);
+}
+
+struct regcache *
+generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
+{
+ struct dummy_frame *dummy = find_dummy_frame (pc, fp);
+ if (dummy != NULL)
+ return dummy->regcache;
+ else
+ return NULL;
+}
+
+char *
+deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
+{
+ struct regcache *regcache = generic_find_dummy_frame (pc, fp);
+ if (regcache == NULL)
+ return NULL;
+ return deprecated_grub_regcache_for_registers (regcache);
+}
+
+/* Function: pc_in_call_dummy (pc, sp, fp)
+
+ Return true if the PC falls in a dummy frame created by gdb for an
+ inferior call. The code below which allows DECR_PC_AFTER_BREAK is
+ for infrun.c, which may give the function a PC without that
+ subtracted out. */
+
+int
+generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
+{
+ struct dummy_frame *dummyframe;
+ for (dummyframe = dummy_frame_stack;
+ dummyframe != NULL;
+ dummyframe = dummyframe->next)
+ {
+ if ((pc >= dummyframe->call_lo)
+ && (pc < dummyframe->call_hi + DECR_PC_AFTER_BREAK))
+ return 1;
+ }
+ return 0;
+}
+
+/* Function: read_register_dummy
+ Find a saved register from before GDB calls a function in the inferior */
+
+CORE_ADDR
+deprecated_read_register_dummy (CORE_ADDR pc, CORE_ADDR fp, int regno)
+{
+ struct regcache *dummy_regs = generic_find_dummy_frame (pc, fp);
+
+ if (dummy_regs)
+ {
+ /* NOTE: cagney/2002-08-12: Replaced a call to
+ regcache_raw_read_as_address() with a call to
+ regcache_cooked_read_unsigned(). The old, ...as_address
+ function was eventually calling extract_unsigned_integer (via
+ extract_address) to unpack the registers value. The below is
+ doing an unsigned extract so that it is functionally
+ equivalent. The read needs to be cooked as, otherwise, it
+ will never correctly return the value of a register in the
+ [NUM_REGS .. NUM_REGS+NUM_PSEUDO_REGS) range. */
+ ULONGEST val;
+ regcache_cooked_read_unsigned (dummy_regs, regno, &val);
+ return val;
+ }
+ else
+ return 0;
+}
+
+/* Save all the registers on the dummy frame stack. Most ports save the
+ registers on the target stack. This results in lots of unnecessary memory
+ references, which are slow when debugging via a serial line. Instead, we
+ save all the registers internally, and never write them to the stack. The
+ registers get restored when the called function returns to the entry point,
+ where a breakpoint is laying in wait. */
+
+void
+generic_push_dummy_frame (void)
+{
+ struct dummy_frame *dummy_frame;
+ CORE_ADDR fp = (get_current_frame ())->frame;
+
+ /* check to see if there are stale dummy frames,
+ perhaps left over from when a longjump took us out of a
+ function that was called by the debugger */
+
+ dummy_frame = dummy_frame_stack;
+ while (dummy_frame)
+ if (INNER_THAN (dummy_frame->fp, fp)) /* stale -- destroy! */
+ {
+ dummy_frame_stack = dummy_frame->next;
+ regcache_xfree (dummy_frame->regcache);
+ xfree (dummy_frame);
+ dummy_frame = dummy_frame_stack;
+ }
+ else
+ dummy_frame = dummy_frame->next;
+
+ dummy_frame = xmalloc (sizeof (struct dummy_frame));
+ dummy_frame->regcache = regcache_xmalloc (current_gdbarch);
+
+ dummy_frame->pc = read_pc ();
+ dummy_frame->sp = read_sp ();
+ dummy_frame->top = 0;
+ dummy_frame->fp = fp;
+ regcache_cpy (dummy_frame->regcache, current_regcache);
+ dummy_frame->next = dummy_frame_stack;
+ dummy_frame_stack = dummy_frame;
+}
+
+void
+generic_save_dummy_frame_tos (CORE_ADDR sp)
+{
+ dummy_frame_stack->top = sp;
+}
+
+/* Record the upper/lower bounds on the address of the call dummy. */
+
+void
+generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi)
+{
+ dummy_frame_stack->call_lo = lo;
+ dummy_frame_stack->call_hi = hi;
+}
+
+/* Restore the machine state from either the saved dummy stack or a
+ real stack frame. */
+
+void
+generic_pop_current_frame (void (*popper) (struct frame_info * frame))
+{
+ struct frame_info *frame = get_current_frame ();
+
+ if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ generic_pop_dummy_frame ();
+ else
+ (*popper) (frame);
+}
+
+/* Function: pop_dummy_frame
+ Restore the machine state from a saved dummy stack frame. */
+
+void
+generic_pop_dummy_frame (void)
+{
+ struct dummy_frame *dummy_frame = dummy_frame_stack;
+
+ /* FIXME: what if the first frame isn't the right one, eg..
+ because one call-by-hand function has done a longjmp into another one? */
+
+ if (!dummy_frame)
+ error ("Can't pop dummy frame!");
+ dummy_frame_stack = dummy_frame->next;
+ regcache_cpy (current_regcache, dummy_frame->regcache);
+ flush_cached_frames ();
+
+ regcache_xfree (dummy_frame->regcache);
+ xfree (dummy_frame);
+}
+
+/* Function: fix_call_dummy
+ Stub function. Generic dummy frames typically do not need to fix
+ the frame being created */
+
+void
+generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
+ struct value **args, struct type *type, int gcc_p)
+{
+ return;
+}
+
+/* Given a call-dummy dummy-frame, return the registers. Here the
+ register value is taken from the local copy of the register buffer. */
+
+void
+dummy_frame_register_unwind (struct frame_info *frame, void **cache,
+ int regnum, int *optimized,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnum, void *bufferp)
+{
+ struct dummy_frame *dummy = cached_find_dummy_frame (frame, cache);
+ gdb_assert (dummy != NULL);
+
+ /* Describe the register's location. Generic dummy frames always
+ have the register value in an ``expression''. */
+ *optimized = 0;
+ *lvalp = not_lval;
+ *addrp = 0;
+ *realnum = -1;
+
+ /* If needed, find and return the value of the register. */
+ if (bufferp != NULL)
+ {
+ /* Return the actual value. */
+ /* Use the regcache_cooked_read() method so that it, on the fly,
+ constructs either a raw or pseudo register from the raw
+ register cache. */
+ regcache_cooked_read (dummy->regcache, regnum, bufferp);
+ }
+}
+
diff --git a/gdb/dummy-frame.h b/gdb/dummy-frame.h
new file mode 100644
index 00000000000..bd4e199c758
--- /dev/null
+++ b/gdb/dummy-frame.h
@@ -0,0 +1,65 @@
+/* Code dealing with dummy stack frames, for GDB, the GNU debugger.
+
+ Copyright 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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. */
+
+#if !defined (DUMMY_FRAME_H)
+#define DUMMY_FRAME_H 1
+
+struct frame_info;
+struct regcache;
+
+/* GENERIC DUMMY FRAMES
+
+ The following code serves to maintain the dummy stack frames for
+ inferior function calls (ie. when gdb calls into the inferior via
+ call_function_by_hand). This code saves the machine state before
+ the call in host memory, so we must maintain an independent stack
+ and keep it consistant etc. I am attempting to make this code
+ generic enough to be used by many targets.
+
+ The cheapest and most generic way to do CALL_DUMMY on a new target
+ is probably to define CALL_DUMMY to be empty, CALL_DUMMY_LENGTH to
+ zero, and CALL_DUMMY_LOCATION to AT_ENTRY. Then you must remember
+ to define PUSH_RETURN_ADDRESS, because no call instruction will be
+ being executed by the target. Also FRAME_CHAIN_VALID as
+ generic_{file,func}_frame_chain_valid and FIX_CALL_DUMMY as
+ generic_fix_call_dummy. */
+
+/* Assuming that FRAME is a dummy, return a register value for the
+ previous frame. */
+
+extern void dummy_frame_register_unwind (struct frame_info *frame,
+ void **unwind_cache,
+ int regnum,
+ int *optimized,
+ enum lval_type *lvalp,
+ CORE_ADDR *addrp,
+ int *realnump,
+ void *valuep);
+
+/* Return the regcache that belongs to the dummy-frame identifed by PC
+ and FP, or NULL if no such frame exists. */
+/* FIXME: cagney/2002-11-08: The function only exists because of
+ deprecated_generic_get_saved_register. Eliminate that function and
+ this, to, can go. */
+
+extern struct regcache *generic_find_dummy_frame (CORE_ADDR pc,
+ CORE_ADDR fp);
+#endif /* !defined (DUMMY_FRAME_H) */
diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c
index 18782b16dc8..30c2db7e683 100644
--- a/gdb/dwarf2cfi.c
+++ b/gdb/dwarf2cfi.c
@@ -90,37 +90,6 @@ struct fde_array
int array_size;
};
-struct context_reg
-{
- union
- {
- unsigned int reg;
- long offset;
- CORE_ADDR addr;
- }
- loc;
- enum
- {
- REG_CTX_UNSAVED,
- REG_CTX_SAVED_OFFSET,
- REG_CTX_SAVED_REG,
- REG_CTX_SAVED_ADDR,
- REG_CTX_VALUE,
- }
- how;
-};
-
-/* This is the register and unwind state for a particular frame. */
-struct context
-{
- struct context_reg *reg;
-
- CORE_ADDR cfa;
- CORE_ADDR ra;
- void *lsda;
- int args_size;
-};
-
struct frame_state_reg
{
union
@@ -208,30 +177,27 @@ static struct fde_unit *fde_unit_alloc (void);
static struct cie_unit *cie_unit_alloc (void);
static void fde_chunks_need_space ();
-static struct context *context_alloc ();
-static struct frame_state *frame_state_alloc ();
static void unwind_tmp_obstack_init ();
static void unwind_tmp_obstack_free ();
-static void context_cpy (struct context *dst, struct context *src);
-
-static unsigned int read_1u (bfd * abfd, char **p);
-static int read_1s (bfd * abfd, char **p);
-static unsigned int read_2u (bfd * abfd, char **p);
-static int read_2s (bfd * abfd, char **p);
-static unsigned int read_4u (bfd * abfd, char **p);
-static int read_4s (bfd * abfd, char **p);
-static ULONGEST read_8u (bfd * abfd, char **p);
-static LONGEST read_8s (bfd * abfd, char **p);
-
-static ULONGEST read_uleb128 (bfd * abfd, char **p);
-static LONGEST read_sleb128 (bfd * abfd, char **p);
-static CORE_ADDR read_pointer (bfd * abfd, char **p);
-static CORE_ADDR read_encoded_pointer (bfd * abfd, char **p,
+
+static unsigned int read_1u (bfd *abfd, char **p);
+static int read_1s (bfd *abfd, char **p);
+static unsigned int read_2u (bfd *abfd, char **p);
+static int read_2s (bfd *abfd, char **p);
+static unsigned int read_4u (bfd *abfd, char **p);
+static int read_4s (bfd *abfd, char **p);
+static ULONGEST read_8u (bfd *abfd, char **p);
+static LONGEST read_8s (bfd *abfd, char **p);
+
+static ULONGEST read_uleb128 (bfd *abfd, char **p);
+static LONGEST read_sleb128 (bfd *abfd, char **p);
+static CORE_ADDR read_pointer (bfd *abfd, char **p);
+static CORE_ADDR read_encoded_pointer (bfd *abfd, char **p,
unsigned char encoding);
static enum ptr_encoding pointer_encoding (unsigned char encoding);
-static LONGEST read_initial_length (bfd * abfd, char *buf, int *bytes_read);
-static ULONGEST read_length (bfd * abfd, char *buf, int *bytes_read,
+static LONGEST read_initial_length (bfd *abfd, char *buf, int *bytes_read);
+static ULONGEST read_length (bfd *abfd, char *buf, int *bytes_read,
int dwarf64);
static int is_cie (ULONGEST cie_id, int dwarf64);
@@ -286,7 +252,7 @@ fde_chunks_need_space (void)
}
/* Alocate a new `struct context' on temporary obstack. */
-static struct context *
+struct context *
context_alloc (void)
{
struct context *context;
@@ -303,7 +269,7 @@ context_alloc (void)
}
/* Alocate a new `struct frame_state' on temporary obstack. */
-static struct frame_state *
+struct frame_state *
frame_state_alloc (void)
{
struct frame_state *fs;
@@ -332,32 +298,23 @@ unwind_tmp_obstack_free (void)
unwind_tmp_obstack_init ();
}
-static void
+void
context_cpy (struct context *dst, struct context *src)
{
int regs_size = sizeof (struct context_reg) * NUM_REGS;
struct context_reg *dreg;
- /* Structure dst contains a pointer to an array of
- * registers of a given frame as well as src does. This
- * array was already allocated before dst was passed to
- * context_cpy but the pointer to it was overriden by
- * '*dst = *src' and the array was lost. This led to the
- * situation, that we've had a copy of src placed in dst,
- * but both of them pointed to the same regs array and
- * thus we've sometimes blindly rewritten it. Now we save
- * the pointer before copying src to dst, return it back
- * after that and copy the registers into their new place
- * finally. --- mludvig@suse.cz */
+ /* Since `struct context' contains a pointer to an array with
+ register values, make sure we end up with a copy of that array,
+ and not with a copy of the pointer to that array. */
dreg = dst->reg;
*dst = *src;
dst->reg = dreg;
-
memcpy (dst->reg, src->reg, regs_size);
}
static unsigned int
-read_1u (bfd * abfd, char **p)
+read_1u (bfd *abfd, char **p)
{
unsigned ret;
@@ -367,7 +324,7 @@ read_1u (bfd * abfd, char **p)
}
static int
-read_1s (bfd * abfd, char **p)
+read_1s (bfd *abfd, char **p)
{
int ret;
@@ -377,7 +334,7 @@ read_1s (bfd * abfd, char **p)
}
static unsigned int
-read_2u (bfd * abfd, char **p)
+read_2u (bfd *abfd, char **p)
{
unsigned ret;
@@ -387,7 +344,7 @@ read_2u (bfd * abfd, char **p)
}
static int
-read_2s (bfd * abfd, char **p)
+read_2s (bfd *abfd, char **p)
{
int ret;
@@ -397,7 +354,7 @@ read_2s (bfd * abfd, char **p)
}
static unsigned int
-read_4u (bfd * abfd, char **p)
+read_4u (bfd *abfd, char **p)
{
unsigned int ret;
@@ -407,7 +364,7 @@ read_4u (bfd * abfd, char **p)
}
static int
-read_4s (bfd * abfd, char **p)
+read_4s (bfd *abfd, char **p)
{
int ret;
@@ -417,7 +374,7 @@ read_4s (bfd * abfd, char **p)
}
static ULONGEST
-read_8u (bfd * abfd, char **p)
+read_8u (bfd *abfd, char **p)
{
ULONGEST ret;
@@ -427,7 +384,7 @@ read_8u (bfd * abfd, char **p)
}
static LONGEST
-read_8s (bfd * abfd, char **p)
+read_8s (bfd *abfd, char **p)
{
LONGEST ret;
@@ -437,7 +394,7 @@ read_8s (bfd * abfd, char **p)
}
static ULONGEST
-read_uleb128 (bfd * abfd, char **p)
+read_uleb128 (bfd *abfd, char **p)
{
ULONGEST ret;
int i, shift;
@@ -461,7 +418,7 @@ read_uleb128 (bfd * abfd, char **p)
}
static LONGEST
-read_sleb128 (bfd * abfd, char **p)
+read_sleb128 (bfd *abfd, char **p)
{
LONGEST ret;
int i, shift, size, num_read;
@@ -491,7 +448,7 @@ read_sleb128 (bfd * abfd, char **p)
}
static CORE_ADDR
-read_pointer (bfd * abfd, char **p)
+read_pointer (bfd *abfd, char **p)
{
switch (TARGET_ADDR_BIT / TARGET_CHAR_BIT)
{
@@ -504,11 +461,11 @@ read_pointer (bfd * abfd, char **p)
}
}
-/* This functions only reads appropriate amount of data from *p
- * and returns the resulting value. Calling function must handle
- * different encoding possibilities itself! */
+/* Read the appropriate amount of data from *P and return the
+ resulting value based on ENCODING, which the calling function must
+ provide. */
static CORE_ADDR
-read_encoded_pointer (bfd * abfd, char **p, unsigned char encoding)
+read_encoded_pointer (bfd *abfd, char **p, unsigned char encoding)
{
CORE_ADDR ret;
@@ -553,10 +510,10 @@ read_encoded_pointer (bfd * abfd, char **p, unsigned char encoding)
return ret;
}
-/* Variable 'encoding' carries 3 different flags:
- * - encoding & 0x0f : size of the address (handled in read_encoded_pointer())
- * - encoding & 0x70 : type (absolute, relative, ...)
- * - encoding & 0x80 : indirect flag (DW_EH_PE_indirect == 0x80). */
+/* The variable 'encoding' carries three different flags:
+ - encoding & 0x0f : size of the address (handled in read_encoded_pointer())
+ - encoding & 0x70 : type (absolute, relative, ...)
+ - encoding & 0x80 : indirect flag (DW_EH_PE_indirect == 0x80). */
enum ptr_encoding
pointer_encoding (unsigned char encoding)
{
@@ -581,7 +538,7 @@ pointer_encoding (unsigned char encoding)
}
static LONGEST
-read_initial_length (bfd * abfd, char *buf, int *bytes_read)
+read_initial_length (bfd *abfd, char *buf, int *bytes_read)
{
LONGEST ret = 0;
@@ -601,7 +558,7 @@ read_initial_length (bfd * abfd, char *buf, int *bytes_read)
}
static ULONGEST
-read_length (bfd * abfd, char *buf, int *bytes_read, int dwarf64)
+read_length (bfd *abfd, char *buf, int *bytes_read, int dwarf64)
{
if (dwarf64)
{
@@ -848,13 +805,13 @@ frame_state_for (struct context *context, struct frame_state *fs)
gdb_assert (fde->cie_ptr != NULL);
cie = fde->cie_ptr;
-
+
fs->code_align = cie->code_align;
fs->data_align = cie->data_align;
fs->retaddr_column = cie->ra;
fs->addr_encoding = cie->addr_encoding;
fs->objfile = cie->objfile;
-
+
execute_cfa_program (cie->objfile, cie->data,
cie->data + cie->data_length, context, fs);
execute_cfa_program (cie->objfile, fde->data,
@@ -867,14 +824,14 @@ get_reg (char *reg, struct context *context, int regnum)
switch (context->reg[regnum].how)
{
case REG_CTX_UNSAVED:
- read_register_gen (regnum, reg);
+ deprecated_read_register_gen (regnum, reg);
break;
case REG_CTX_SAVED_OFFSET:
target_read_memory (context->cfa + context->reg[regnum].loc.offset,
reg, REGISTER_RAW_SIZE (regnum));
break;
case REG_CTX_SAVED_REG:
- read_register_gen (context->reg[regnum].loc.reg, reg);
+ deprecated_read_register_gen (context->reg[regnum].loc.reg, reg);
break;
case REG_CTX_SAVED_ADDR:
target_read_memory (context->reg[regnum].loc.addr,
@@ -1128,7 +1085,7 @@ execute_stack_op (struct objfile *objfile,
case DW_OP_deref_size:
{
int len = *op_ptr++;
- if (len != 1 && len != 2 && len != 4 && len !=8)
+ if (len != 1 && len != 2 && len != 4 && len != 8)
internal_error (__FILE__, __LINE__,
"execute_stack_op error");
result = read_memory_unsigned_integer (result, len);
@@ -1731,7 +1688,7 @@ cfi_write_fp (CORE_ADDR val)
if (fs->cfa_how == CFA_REG_OFFSET)
{
val -= fs->cfa_offset;
- write_register_gen (fs->cfa_reg, (char *) &val);
+ deprecated_write_register_gen (fs->cfa_reg, (char *) &val);
}
else
warning ("Can't write fp.");
@@ -1750,8 +1707,8 @@ cfi_pop_frame (struct frame_info *fi)
for (regnum = 0; regnum < NUM_REGS; regnum++)
{
get_reg (regbuf, UNWIND_CONTEXT (fi), regnum);
- write_register_bytes (REGISTER_BYTE (regnum), regbuf,
- REGISTER_RAW_SIZE (regnum));
+ deprecated_write_register_bytes (REGISTER_BYTE (regnum), regbuf,
+ REGISTER_RAW_SIZE (regnum));
}
write_register (PC_REGNUM, UNWIND_CONTEXT (fi)->ra);
@@ -1862,7 +1819,7 @@ cfi_get_saved_register (char *raw_buffer,
if (!frame->next)
{
- read_register_gen (regnum, raw_buffer);
+ deprecated_read_register_gen (regnum, raw_buffer);
if (lval != NULL)
*lval = lval_register;
if (addrp != NULL)
@@ -1874,7 +1831,7 @@ cfi_get_saved_register (char *raw_buffer,
switch (UNWIND_CONTEXT (frame)->reg[regnum].how)
{
case REG_CTX_UNSAVED:
- read_register_gen (regnum, raw_buffer);
+ deprecated_read_register_gen (regnum, raw_buffer);
if (lval != NULL)
*lval = not_lval;
if (optimized != NULL)
@@ -1892,8 +1849,8 @@ cfi_get_saved_register (char *raw_buffer,
UNWIND_CONTEXT (frame)->reg[regnum].loc.offset;
break;
case REG_CTX_SAVED_REG:
- read_register_gen (UNWIND_CONTEXT (frame)->reg[regnum].loc.reg,
- raw_buffer);
+ deprecated_read_register_gen (UNWIND_CONTEXT (frame)->reg[regnum].loc.reg,
+ raw_buffer);
if (lval != NULL)
*lval = lval_register;
if (addrp != NULL)
diff --git a/gdb/dwarf2cfi.h b/gdb/dwarf2cfi.h
index f4c675aca7b..a1cc39cb581 100644
--- a/gdb/dwarf2cfi.h
+++ b/gdb/dwarf2cfi.h
@@ -22,6 +22,37 @@
#ifndef DWARF2CFI_H
#define DWARF2CFI_H
+struct context_reg
+{
+ union
+ {
+ unsigned int reg;
+ long offset;
+ CORE_ADDR addr;
+ }
+ loc;
+ enum
+ {
+ REG_CTX_UNSAVED,
+ REG_CTX_SAVED_OFFSET,
+ REG_CTX_SAVED_REG,
+ REG_CTX_SAVED_ADDR,
+ REG_CTX_VALUE,
+ }
+ how;
+};
+
+/* This is the register and unwind state for a particular frame. */
+struct context
+{
+ struct context_reg *reg;
+
+ CORE_ADDR cfa;
+ CORE_ADDR ra;
+ void *lsda;
+ int args_size;
+};
+
/* Return the frame address. */
CORE_ADDR cfi_read_fp ();
@@ -53,7 +84,7 @@ CORE_ADDR cfi_get_ra (struct frame_info *fi);
The argument RAW_BUFFER must point to aligned memory. */
void cfi_get_saved_register (char *raw_buffer,
int *optimized,
- CORE_ADDR * addrp,
+ CORE_ADDR *addrp,
struct frame_info *frame,
int regnum, enum lval_type *lval);
@@ -63,4 +94,7 @@ void cfi_get_saved_register (char *raw_buffer,
void cfi_virtual_frame_pointer (CORE_ADDR pc, int *frame_regnum,
LONGEST * frame_offset);
+struct context *context_alloc ();
+void context_cpy (struct context *dst, struct context *src);
+struct frame_state *frame_state_alloc ();
#endif
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index b62b0282b3f..b5ba7dc713d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -162,6 +162,11 @@ unsigned int dwarf_eh_frame_size;
/* local data types */
+/* We hold several abbreviation tables in memory at the same time. */
+#ifndef ABBREV_HASH_SIZE
+#define ABBREV_HASH_SIZE 121
+#endif
+
/* The data in a compilation unit header, after target2host
translation, looks like this. */
struct comp_unit_head
@@ -174,6 +179,29 @@ struct comp_unit_head
unsigned int offset_size; /* size of file offsets; either 4 or 8 */
unsigned int initial_length_size; /* size of the length field; either
4 or 12 */
+
+ /* Offset to the first byte of this compilation unit header in the
+ * .debug_info section, for resolving relative reference dies. */
+
+ unsigned int offset;
+
+ /* Pointer to this compilation unit header in the .debug_info
+ * section */
+
+ char *cu_head_ptr;
+
+ /* Pointer to the first die of this compilatio unit. This will
+ * be the first byte following the compilation unit header. */
+
+ char *first_die_ptr;
+
+ /* Pointer to the next compilation unit header in the program. */
+
+ struct comp_unit_head *next;
+
+ /* DWARF abbreviation table associated with this compilation unit */
+
+ struct abbrev_info *dwarf2_abbrevs[ABBREV_HASH_SIZE];
};
/* The line number information for a compilation unit (found in the
@@ -312,17 +340,10 @@ struct dwarf_block
char *data;
};
-/* We only hold one compilation unit's abbrevs in
- memory at any one time. */
-#ifndef ABBREV_HASH_SIZE
-#define ABBREV_HASH_SIZE 121
-#endif
#ifndef ATTR_ALLOC_CHUNK
#define ATTR_ALLOC_CHUNK 4
#endif
-static struct abbrev_info *dwarf2_abbrevs[ABBREV_HASH_SIZE];
-
/* A hash table of die offsets for following references. */
#ifndef REF_HASH_SIZE
#define REF_HASH_SIZE 1021
@@ -389,6 +410,12 @@ static int islocal; /* Variable is at the returned offset
this function, so we can't say
which register it's relative to;
use LOC_LOCAL. */
+static int is_thread_local; /* Variable is at a constant offset in the
+ thread-local storage block for the
+ current thread and the dynamic linker
+ module containing this expression.
+ decode_locdesc returns the offset from
+ that base. */
/* DW_AT_frame_base values for the current function.
frame_base_reg is -1 if DW_AT_frame_base is missing, otherwise it
@@ -534,134 +561,138 @@ struct field_info
/* Various complaints about symbol reading that don't abort the process */
-static struct complaint dwarf2_const_ignored =
+static struct deprecated_complaint dwarf2_const_ignored =
{
"type qualifier 'const' ignored", 0, 0
};
-static struct complaint dwarf2_volatile_ignored =
+static struct deprecated_complaint dwarf2_volatile_ignored =
{
"type qualifier 'volatile' ignored", 0, 0
};
-static struct complaint dwarf2_non_const_array_bound_ignored =
+static struct deprecated_complaint dwarf2_non_const_array_bound_ignored =
{
"non-constant array bounds form '%s' ignored", 0, 0
};
-static struct complaint dwarf2_missing_line_number_section =
+static struct deprecated_complaint dwarf2_missing_line_number_section =
{
"missing .debug_line section", 0, 0
};
-static struct complaint dwarf2_statement_list_fits_in_line_number_section =
+static struct deprecated_complaint dwarf2_statement_list_fits_in_line_number_section =
{
"statement list doesn't fit in .debug_line section", 0, 0
};
-static struct complaint dwarf2_mangled_line_number_section =
+static struct deprecated_complaint dwarf2_mangled_line_number_section =
{
"mangled .debug_line section", 0, 0
};
-static struct complaint dwarf2_unsupported_die_ref_attr =
+static struct deprecated_complaint dwarf2_unsupported_die_ref_attr =
{
"unsupported die ref attribute form: '%s'", 0, 0
};
-static struct complaint dwarf2_unsupported_stack_op =
+static struct deprecated_complaint dwarf2_unsupported_stack_op =
{
"unsupported stack op: '%s'", 0, 0
};
-static struct complaint dwarf2_complex_location_expr =
+static struct deprecated_complaint dwarf2_complex_location_expr =
{
"location expression too complex", 0, 0
};
-static struct complaint dwarf2_unsupported_tag =
+static struct deprecated_complaint dwarf2_unsupported_tag =
{
"unsupported tag: '%s'", 0, 0
};
-static struct complaint dwarf2_unsupported_at_encoding =
+static struct deprecated_complaint dwarf2_unsupported_at_encoding =
{
"unsupported DW_AT_encoding: '%s'", 0, 0
};
-static struct complaint dwarf2_unsupported_at_frame_base =
+static struct deprecated_complaint dwarf2_unsupported_at_frame_base =
{
"unsupported DW_AT_frame_base for function '%s'", 0, 0
};
-static struct complaint dwarf2_unexpected_tag =
+static struct deprecated_complaint dwarf2_unexpected_tag =
{
"unexepected tag in read_type_die: '%s'", 0, 0
};
-static struct complaint dwarf2_missing_at_frame_base =
+static struct deprecated_complaint dwarf2_missing_at_frame_base =
{
"DW_AT_frame_base missing for DW_OP_fbreg", 0, 0
};
-static struct complaint dwarf2_bad_static_member_name =
+static struct deprecated_complaint dwarf2_bad_static_member_name =
{
"unrecognized static data member name '%s'", 0, 0
};
-static struct complaint dwarf2_unsupported_accessibility =
+static struct deprecated_complaint dwarf2_unsupported_accessibility =
{
"unsupported accessibility %d", 0, 0
};
-static struct complaint dwarf2_bad_member_name_complaint =
+static struct deprecated_complaint dwarf2_bad_member_name_complaint =
{
"cannot extract member name from '%s'", 0, 0
};
-static struct complaint dwarf2_missing_member_fn_type_complaint =
+static struct deprecated_complaint dwarf2_missing_member_fn_type_complaint =
{
"member function type missing for '%s'", 0, 0
};
-static struct complaint dwarf2_vtbl_not_found_complaint =
+static struct deprecated_complaint dwarf2_vtbl_not_found_complaint =
{
"virtual function table pointer not found when defining class '%s'", 0, 0
};
-static struct complaint dwarf2_absolute_sibling_complaint =
+static struct deprecated_complaint dwarf2_absolute_sibling_complaint =
{
"ignoring absolute DW_AT_sibling", 0, 0
};
-static struct complaint dwarf2_const_value_length_mismatch =
+static struct deprecated_complaint dwarf2_const_value_length_mismatch =
{
"const value length mismatch for '%s', got %d, expected %d", 0, 0
};
-static struct complaint dwarf2_unsupported_const_value_attr =
+static struct deprecated_complaint dwarf2_unsupported_const_value_attr =
{
"unsupported const value attribute form: '%s'", 0, 0
};
-static struct complaint dwarf2_misplaced_line_number =
+static struct deprecated_complaint dwarf2_misplaced_line_number =
{
"misplaced first line number at 0x%lx for '%s'", 0, 0
};
-static struct complaint dwarf2_line_header_too_long =
+static struct deprecated_complaint dwarf2_line_header_too_long =
{
"line number info header doesn't fit in `.debug_line' section", 0, 0
};
-static struct complaint dwarf2_missing_macinfo_section =
+static struct deprecated_complaint dwarf2_missing_macinfo_section =
{
"missing .debug_macinfo section", 0, 0
};
-static struct complaint dwarf2_macros_too_long =
+static struct deprecated_complaint dwarf2_macros_too_long =
{
"macro info runs off end of `.debug_macinfo' section", 0, 0
};
-static struct complaint dwarf2_macros_not_terminated =
+static struct deprecated_complaint dwarf2_macros_not_terminated =
{
"no terminating 0-type entry for macros in `.debug_macinfo' section", 0, 0
};
-static struct complaint dwarf2_macro_outside_file =
+static struct deprecated_complaint dwarf2_macro_outside_file =
{
"debug info gives macro %s outside of any file: %s", 0, 0
};
-static struct complaint dwarf2_macro_unmatched_end_file =
+static struct deprecated_complaint dwarf2_macro_unmatched_end_file =
{
"macro debug info has an unmatched `close_file' directive", 0, 0
};
-static struct complaint dwarf2_macro_malformed_definition =
+static struct deprecated_complaint dwarf2_macro_malformed_definition =
{
"macro debug info contains a malformed macro definition:\n`%s'", 0, 0
};
-static struct complaint dwarf2_macro_spaces_in_definition =
+static struct deprecated_complaint dwarf2_macro_spaces_in_definition =
{
"macro definition contains spaces in formal argument list:\n`%s'", 0, 0
};
-static struct complaint dwarf2_invalid_attrib_class =
+static struct deprecated_complaint dwarf2_invalid_attrib_class =
{
"invalid attribute class or form for '%s' in '%s'", 0, 0
};
+static struct deprecated_complaint dwarf2_invalid_pointer_size =
+{
+ "invalid pointer size %d", 0, 0
+};
/* local function prototypes */
@@ -686,11 +717,12 @@ static void psymtab_to_symtab_1 (struct partial_symtab *);
char *dwarf2_read_section (struct objfile *, file_ptr, unsigned int);
-static void dwarf2_read_abbrevs (bfd *, unsigned int);
+static void dwarf2_read_abbrevs (bfd *abfd, struct comp_unit_head *cu_header);
static void dwarf2_empty_abbrev_table (PTR);
-static struct abbrev_info *dwarf2_lookup_abbrev (unsigned int);
+static struct abbrev_info *dwarf2_lookup_abbrev (unsigned int,
+ const struct comp_unit_head *cu_header);
static char *read_partial_die (struct partial_die_info *,
bfd *, char *,
@@ -816,6 +848,9 @@ static void read_structure_scope (struct die_info *, struct objfile *,
static void read_common_block (struct die_info *, struct objfile *,
const struct comp_unit_head *);
+static void read_namespace (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header);
+
static void read_enumeration (struct die_info *, struct objfile *,
const struct comp_unit_head *);
@@ -1211,9 +1246,14 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
(long) (beg_of_comp_unit - dwarf_info_buffer));
return;
}
+ /* Complete the cu_header */
+ cu_header.offset = beg_of_comp_unit - dwarf_info_buffer;
+ cu_header.first_die_ptr = info_ptr;
+ cu_header.cu_head_ptr = beg_of_comp_unit;
+
/* Read the abbrevs for this compilation unit into a table */
- dwarf2_read_abbrevs (abfd, cu_header.abbrev_offset);
- make_cleanup (dwarf2_empty_abbrev_table, NULL);
+ dwarf2_read_abbrevs (abfd, &cu_header);
+ make_cleanup (dwarf2_empty_abbrev_table, cu_header.dwarf2_abbrevs);
/* Read the compilation unit die */
info_ptr = read_partial_die (&comp_unit_die, abfd, info_ptr,
@@ -1301,6 +1341,17 @@ scan_partial_symbols (char *info_ptr, struct objfile *objfile,
int nesting_level = 1;
+ /* We only want to read in symbols corresponding to variables or
+ other similar objects that are global or static. Normally, these
+ are all children of the DW_TAG_compile_unit die, so are all at
+ level 1. But C++ namespaces give ries to DW_TAG_namespace dies
+ whose children are global objects. So we keep track of what
+ level we currently think of as referring to file scope; this
+ should always equal 1 plus the number of namespaces that we are
+ currently nested within. */
+
+ int file_scope_level = 1;
+
*lowpc = ((CORE_ADDR) -1);
*highpc = ((CORE_ADDR) 0);
@@ -1323,7 +1374,7 @@ scan_partial_symbols (char *info_ptr, struct objfile *objfile,
{
*highpc = pdi.highpc;
}
- if ((pdi.is_external || nesting_level == 1)
+ if ((pdi.is_external || nesting_level == file_scope_level)
&& !pdi.is_declaration)
{
add_partial_symbol (&pdi, objfile, cu_header);
@@ -1336,46 +1387,65 @@ scan_partial_symbols (char *info_ptr, struct objfile *objfile,
case DW_TAG_structure_type:
case DW_TAG_union_type:
case DW_TAG_enumeration_type:
- if ((pdi.is_external || nesting_level == 1)
+ if ((pdi.is_external || nesting_level == file_scope_level)
&& !pdi.is_declaration)
{
add_partial_symbol (&pdi, objfile, cu_header);
}
break;
case DW_TAG_enumerator:
- /* File scope enumerators are added to the partial symbol
- table. */
- if (nesting_level == 2)
+ /* File scope enumerators are added to the partial
+ symbol table. They're children of the enumeration
+ type die, so they occur at a level one higher than we
+ normally look for. */
+ if (nesting_level == file_scope_level + 1)
add_partial_symbol (&pdi, objfile, cu_header);
break;
case DW_TAG_base_type:
/* File scope base type definitions are added to the partial
symbol table. */
- if (nesting_level == 1)
+ if (nesting_level == file_scope_level)
add_partial_symbol (&pdi, objfile, cu_header);
break;
+ case DW_TAG_namespace:
+ /* FIXME: carlton/2002-10-16: we're not yet doing
+ anything useful with this, but for now make sure that
+ these tags at least don't cause us to miss any
+ important symbols. */
+ if (pdi.has_children)
+ file_scope_level++;
default:
break;
}
}
- /* If the die has a sibling, skip to the sibling.
- Do not skip enumeration types, we want to record their
- enumerators. */
- if (pdi.sibling && pdi.tag != DW_TAG_enumeration_type)
+ /* If the die has a sibling, skip to the sibling. Do not skip
+ enumeration types, we want to record their enumerators. Do
+ not skip namespaces, we want to record symbols inside
+ them. */
+ if (pdi.sibling
+ && pdi.tag != DW_TAG_enumeration_type
+ && pdi.tag != DW_TAG_namespace)
{
info_ptr = pdi.sibling;
}
else if (pdi.has_children)
{
- /* Die has children, but the optional DW_AT_sibling attribute
- is missing. */
+ /* Die has children, but either the optional DW_AT_sibling
+ attribute is missing or we want to look at them. */
nesting_level++;
}
if (pdi.tag == 0)
{
nesting_level--;
+ /* If this is the end of a DW_TAG_namespace entry, then
+ decrease the file_scope_level, too. */
+ if (nesting_level < file_scope_level)
+ {
+ file_scope_level--;
+ gdb_assert (nesting_level == file_scope_level);
+ }
}
}
@@ -1560,8 +1630,8 @@ psymtab_to_symtab_1 (struct partial_symtab *pst)
info_ptr = read_comp_unit_head (&cu_header, info_ptr, abfd);
/* Read the abbrevs for this compilation unit */
- dwarf2_read_abbrevs (abfd, cu_header.abbrev_offset);
- make_cleanup (dwarf2_empty_abbrev_table, NULL);
+ dwarf2_read_abbrevs (abfd, &cu_header);
+ make_cleanup (dwarf2_empty_abbrev_table, cu_header.dwarf2_abbrevs);
dies = read_comp_unit (info_ptr, abfd, &cu_header);
@@ -1675,6 +1745,19 @@ process_die (struct die_info *die, struct objfile *objfile,
break;
case DW_TAG_common_inclusion:
break;
+ case DW_TAG_namespace:
+ read_namespace (die, objfile, cu_header);
+ break;
+ case DW_TAG_imported_declaration:
+ case DW_TAG_imported_module:
+ /* FIXME: carlton/2002-10-16: Eventually, we should use the
+ information contained in these. DW_TAG_imported_declaration
+ dies shouldn't have children; DW_TAG_imported_module dies
+ shouldn't in the C++ case, but conceivably could in the
+ Fortran case, so we'll have to replace this gdb_assert if
+ Fortran compilers start generating that info. */
+ gdb_assert (!die->has_children);
+ break;
default:
new_symbol (die, NULL, objfile, cu_header);
break;
@@ -1930,7 +2013,18 @@ read_func_scope (struct die_info *die, struct objfile *objfile,
/* Make a block for the local symbols within. */
finish_block (new->name, &local_symbols, new->old_blocks,
lowpc, highpc, objfile);
- list_in_scope = &file_symbols;
+
+ /* In C++, we can have functions nested inside functions (e.g., when
+ a function declares a class that has methods). This means that
+ when we finish processing a function scope, we may need to go
+ back to building a containing block's symbol lists. */
+ local_symbols = new->locals;
+ param_symbols = new->params;
+
+ /* If we've finished processing a top-level function, subsequent
+ symbols go in the file symbol list. */
+ if (outermost_context_p ())
+ list_in_scope = &file_symbols;
}
/* Process all the DIES contained within a lexical block scope. Start
@@ -2055,6 +2149,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
/* Get type of field. */
fp->type = die_type (die, objfile, cu_header);
+ FIELD_STATIC_KIND (*fp) = 0;
+
/* Get bit size of field (zero if none). */
attr = dwarf_attr (die, DW_AT_bit_size);
if (attr)
@@ -2163,6 +2259,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
FIELD_BITPOS (*fp) = (decode_locdesc (DW_BLOCK (attr), objfile, cu_header)
* bits_per_byte);
FIELD_BITSIZE (*fp) = 0;
+ FIELD_STATIC_KIND (*fp) = 0;
FIELD_TYPE (*fp) = die_type (die, objfile, cu_header);
FIELD_NAME (*fp) = type_name_no_tag (fp->type);
fip->nbaseclasses++;
@@ -2667,6 +2764,7 @@ read_enumeration (struct die_info *die, struct objfile *objfile,
FIELD_TYPE (fields[num_fields]) = NULL;
FIELD_BITPOS (fields[num_fields]) = SYMBOL_VALUE (sym);
FIELD_BITSIZE (fields[num_fields]) = 0;
+ FIELD_STATIC_KIND (fields[num_fields]) = 0;
num_fields++;
}
@@ -2890,6 +2988,27 @@ read_common_block (struct die_info *die, struct objfile *objfile,
}
}
+/* Read a C++ namespace. */
+
+/* FIXME: carlton/2002-10-16: For now, we don't actually do anything
+ useful with the namespace data: we just process its children. */
+
+static void
+read_namespace (struct die_info *die, struct objfile *objfile,
+ const struct comp_unit_head *cu_header)
+{
+ if (die->has_children)
+ {
+ struct die_info *child_die = die->next;
+
+ while (child_die && child_die->tag)
+ {
+ process_die (child_die, objfile, cu_header);
+ child_die = sibling_die (child_die);
+ }
+ }
+}
+
/* Extract all information from a DW_TAG_pointer_type DIE and add to
the user defined type vector. */
@@ -2898,7 +3017,9 @@ read_tag_pointer_type (struct die_info *die, struct objfile *objfile,
const struct comp_unit_head *cu_header)
{
struct type *type;
- struct attribute *attr;
+ struct attribute *attr_byte_size;
+ struct attribute *attr_address_class;
+ int byte_size, addr_class;
if (die->type)
{
@@ -2906,15 +3027,42 @@ read_tag_pointer_type (struct die_info *die, struct objfile *objfile,
}
type = lookup_pointer_type (die_type (die, objfile, cu_header));
- attr = dwarf_attr (die, DW_AT_byte_size);
- if (attr)
- {
- TYPE_LENGTH (type) = DW_UNSND (attr);
- }
+
+ attr_byte_size = dwarf_attr (die, DW_AT_byte_size);
+ if (attr_byte_size)
+ byte_size = DW_UNSND (attr_byte_size);
+ else
+ byte_size = cu_header->addr_size;
+
+ attr_address_class = dwarf_attr (die, DW_AT_address_class);
+ if (attr_address_class)
+ addr_class = DW_UNSND (attr_address_class);
else
+ addr_class = DW_ADDR_none;
+
+ /* If the pointer size or address class is different than the
+ default, create a type variant marked as such and set the
+ length accordingly. */
+ if (TYPE_LENGTH (type) != byte_size || addr_class != DW_ADDR_none)
{
- TYPE_LENGTH (type) = cu_header->addr_size;
+ if (ADDRESS_CLASS_TYPE_FLAGS_P ())
+ {
+ int type_flags;
+
+ type_flags = ADDRESS_CLASS_TYPE_FLAGS (byte_size, addr_class);
+ gdb_assert ((type_flags & ~TYPE_FLAG_ADDRESS_CLASS_ALL) == 0);
+ type = make_type_with_address_space (type, type_flags);
+ }
+ else if (TYPE_LENGTH (type) != byte_size)
+ {
+ complain (&dwarf2_invalid_pointer_size, byte_size);
+ }
+ else {
+ /* Should we also complain about unhandled address classes? */
+ }
}
+
+ TYPE_LENGTH (type) = byte_size;
die->type = type;
}
@@ -3345,17 +3493,18 @@ dwarf2_read_section (struct objfile *objfile, file_ptr offset,
in a hash table. */
static void
-dwarf2_read_abbrevs (bfd *abfd, unsigned int offset)
+dwarf2_read_abbrevs (bfd *abfd, struct comp_unit_head *cu_header)
{
char *abbrev_ptr;
struct abbrev_info *cur_abbrev;
unsigned int abbrev_number, bytes_read, abbrev_name;
unsigned int abbrev_form, hash_number;
- /* empty the table */
- dwarf2_empty_abbrev_table (NULL);
+ /* Initialize dwarf2 abbrevs */
+ memset (cu_header->dwarf2_abbrevs, 0,
+ ABBREV_HASH_SIZE*sizeof (struct abbrev_info *));
- abbrev_ptr = dwarf_abbrev_buffer + offset;
+ abbrev_ptr = dwarf_abbrev_buffer + cu_header->abbrev_offset;
abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
abbrev_ptr += bytes_read;
@@ -3394,8 +3543,8 @@ dwarf2_read_abbrevs (bfd *abfd, unsigned int offset)
}
hash_number = abbrev_number % ABBREV_HASH_SIZE;
- cur_abbrev->next = dwarf2_abbrevs[hash_number];
- dwarf2_abbrevs[hash_number] = cur_abbrev;
+ cur_abbrev->next = cu_header->dwarf2_abbrevs[hash_number];
+ cu_header->dwarf2_abbrevs[hash_number] = cur_abbrev;
/* Get next abbreviation.
Under Irix6 the abbreviations for a compilation unit are not
@@ -3409,7 +3558,7 @@ dwarf2_read_abbrevs (bfd *abfd, unsigned int offset)
break;
abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
abbrev_ptr += bytes_read;
- if (dwarf2_lookup_abbrev (abbrev_number) != NULL)
+ if (dwarf2_lookup_abbrev (abbrev_number, cu_header) != NULL)
break;
}
}
@@ -3418,15 +3567,18 @@ dwarf2_read_abbrevs (bfd *abfd, unsigned int offset)
/* ARGSUSED */
static void
-dwarf2_empty_abbrev_table (PTR ignore)
+dwarf2_empty_abbrev_table (PTR ptr_to_abbrevs_table)
{
int i;
struct abbrev_info *abbrev, *next;
+ struct abbrev_info **abbrevs;
+
+ abbrevs = (struct abbrev_info **)ptr_to_abbrevs_table;
for (i = 0; i < ABBREV_HASH_SIZE; ++i)
{
next = NULL;
- abbrev = dwarf2_abbrevs[i];
+ abbrev = abbrevs[i];
while (abbrev)
{
next = abbrev->next;
@@ -3434,20 +3586,20 @@ dwarf2_empty_abbrev_table (PTR ignore)
xfree (abbrev);
abbrev = next;
}
- dwarf2_abbrevs[i] = NULL;
+ abbrevs[i] = NULL;
}
}
/* Lookup an abbrev_info structure in the abbrev hash table. */
static struct abbrev_info *
-dwarf2_lookup_abbrev (unsigned int number)
+dwarf2_lookup_abbrev (unsigned int number, const struct comp_unit_head *cu_header)
{
unsigned int hash_number;
struct abbrev_info *abbrev;
hash_number = number % ABBREV_HASH_SIZE;
- abbrev = dwarf2_abbrevs[hash_number];
+ abbrev = cu_header->dwarf2_abbrevs[hash_number];
while (abbrev)
{
@@ -3479,7 +3631,7 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd,
if (!abbrev_number)
return info_ptr;
- abbrev = dwarf2_lookup_abbrev (abbrev_number);
+ abbrev = dwarf2_lookup_abbrev (abbrev_number, cu_header);
if (!abbrev)
{
error ("Dwarf Error: Could not find abbrev number %d.", abbrev_number);
@@ -3623,7 +3775,7 @@ read_full_die (struct die_info **diep, bfd *abfd, char *info_ptr,
return info_ptr;
}
- abbrev = dwarf2_lookup_abbrev (abbrev_number);
+ abbrev = dwarf2_lookup_abbrev (abbrev_number, cu_header);
if (!abbrev)
{
error ("Dwarf Error: could not find abbrev number %d.", abbrev_number);
@@ -4724,6 +4876,14 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
"external variable");
}
add_symbol_to_list (sym, &global_symbols);
+ if (is_thread_local)
+ {
+ /* SYMBOL_VALUE_ADDRESS contains at this point the
+ offset of the variable within the thread local
+ storage. */
+ SYMBOL_CLASS (sym) = LOC_THREAD_LOCAL_STATIC;
+ SYMBOL_OBJFILE (sym) = objfile;
+ }
/* In shared libraries the address of the variable
in the location descriptor might still be relocatable,
@@ -4732,7 +4892,7 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
value is zero, the address of the variable will then
be determined from the minimal symbol table whenever
the variable is referenced. */
- if (SYMBOL_VALUE_ADDRESS (sym))
+ else if (SYMBOL_VALUE_ADDRESS (sym))
{
fixup_symbol_section (sym, objfile);
SYMBOL_VALUE_ADDRESS (sym) +=
@@ -4782,6 +4942,11 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
{
SYMBOL_CLASS (sym) = LOC_LOCAL;
}
+ else if (is_thread_local)
+ {
+ SYMBOL_CLASS (sym) = LOC_THREAD_LOCAL_STATIC;
+ SYMBOL_OBJFILE (sym) = objfile;
+ }
else
{
fixup_symbol_section (sym, objfile);
@@ -5429,6 +5594,22 @@ dwarf_tag_name (register unsigned tag)
return "DW_TAG_variable";
case DW_TAG_volatile_type:
return "DW_TAG_volatile_type";
+ 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_MIPS_loop:
return "DW_TAG_MIPS_loop";
case DW_TAG_format_label:
@@ -5573,7 +5754,30 @@ dwarf_attr_name (register unsigned attr)
return "DW_AT_virtuality";
case DW_AT_vtable_elem_location:
return "DW_AT_vtable_elem_location";
-
+ 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";
#ifdef MIPS
case DW_AT_MIPS_fde:
return "DW_AT_MIPS_fde";
@@ -6010,6 +6214,8 @@ dwarf_type_encoding_name (register unsigned enc)
return "DW_ATE_unsigned";
case DW_ATE_unsigned_char:
return "DW_ATE_unsigned_char";
+ case DW_ATE_imaginary_float:
+ return "DW_ATE_imaginary_float";
default:
return "DW_ATE_<unknown>";
}
@@ -6294,6 +6500,7 @@ decode_locdesc (struct dwarf_block *blk, struct objfile *objfile,
offreg = 0;
isderef = 0;
islocal = 0;
+ is_thread_local = 0;
optimized_out = 1;
while (i < size)
@@ -6517,6 +6724,16 @@ decode_locdesc (struct dwarf_block *blk, struct objfile *objfile,
complain (&dwarf2_complex_location_expr);
break;
+ case DW_OP_GNU_push_tls_address:
+ is_thread_local = 1;
+ /* The top of the stack has the offset from the beginning
+ of the thread control block at which the variable is located. */
+ /* Nothing should follow this operator, so the top of stack would
+ be returned. */
+ if (i < size)
+ complain (&dwarf2_complex_location_expr);
+ break;
+
default:
complain (&dwarf2_unsupported_stack_op, dwarf_stack_op_name (op));
return (stack[stacki]);
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
index 9c4201de1c3..f8254c95068 100644
--- a/gdb/dwarfread.c
+++ b/gdb/dwarfread.c
@@ -62,112 +62,112 @@
/* Complaints that can be issued during DWARF debug info reading. */
-struct complaint no_bfd_get_N =
+struct deprecated_complaint no_bfd_get_N =
{
"DIE @ 0x%x \"%s\", no bfd support for %d byte data object", 0, 0
};
-struct complaint malformed_die =
+struct deprecated_complaint malformed_die =
{
"DIE @ 0x%x \"%s\", malformed DIE, bad length (%d bytes)", 0, 0
};
-struct complaint bad_die_ref =
+struct deprecated_complaint bad_die_ref =
{
"DIE @ 0x%x \"%s\", reference to DIE (0x%x) outside compilation unit", 0, 0
};
-struct complaint unknown_attribute_form =
+struct deprecated_complaint unknown_attribute_form =
{
"DIE @ 0x%x \"%s\", unknown attribute form (0x%x)", 0, 0
};
-struct complaint unknown_attribute_length =
+struct deprecated_complaint unknown_attribute_length =
{
"DIE @ 0x%x \"%s\", unknown attribute length, skipped remaining attributes", 0, 0
};
-struct complaint unexpected_fund_type =
+struct deprecated_complaint unexpected_fund_type =
{
"DIE @ 0x%x \"%s\", unexpected fundamental type 0x%x", 0, 0
};
-struct complaint unknown_type_modifier =
+struct deprecated_complaint unknown_type_modifier =
{
"DIE @ 0x%x \"%s\", unknown type modifier %u", 0, 0
};
-struct complaint volatile_ignored =
+struct deprecated_complaint volatile_ignored =
{
"DIE @ 0x%x \"%s\", type modifier 'volatile' ignored", 0, 0
};
-struct complaint const_ignored =
+struct deprecated_complaint const_ignored =
{
"DIE @ 0x%x \"%s\", type modifier 'const' ignored", 0, 0
};
-struct complaint botched_modified_type =
+struct deprecated_complaint botched_modified_type =
{
"DIE @ 0x%x \"%s\", botched modified type decoding (mtype 0x%x)", 0, 0
};
-struct complaint op_deref2 =
+struct deprecated_complaint op_deref2 =
{
"DIE @ 0x%x \"%s\", OP_DEREF2 address 0x%x not handled", 0, 0
};
-struct complaint op_deref4 =
+struct deprecated_complaint op_deref4 =
{
"DIE @ 0x%x \"%s\", OP_DEREF4 address 0x%x not handled", 0, 0
};
-struct complaint basereg_not_handled =
+struct deprecated_complaint basereg_not_handled =
{
"DIE @ 0x%x \"%s\", BASEREG %d not handled", 0, 0
};
-struct complaint dup_user_type_allocation =
+struct deprecated_complaint dup_user_type_allocation =
{
"DIE @ 0x%x \"%s\", internal error: duplicate user type allocation", 0, 0
};
-struct complaint dup_user_type_definition =
+struct deprecated_complaint dup_user_type_definition =
{
"DIE @ 0x%x \"%s\", internal error: duplicate user type definition", 0, 0
};
-struct complaint missing_tag =
+struct deprecated_complaint missing_tag =
{
"DIE @ 0x%x \"%s\", missing class, structure, or union tag", 0, 0
};
-struct complaint bad_array_element_type =
+struct deprecated_complaint bad_array_element_type =
{
"DIE @ 0x%x \"%s\", bad array element type attribute 0x%x", 0, 0
};
-struct complaint subscript_data_items =
+struct deprecated_complaint subscript_data_items =
{
"DIE @ 0x%x \"%s\", can't decode subscript data items", 0, 0
};
-struct complaint unhandled_array_subscript_format =
+struct deprecated_complaint unhandled_array_subscript_format =
{
"DIE @ 0x%x \"%s\", array subscript format 0x%x not handled yet", 0, 0
};
-struct complaint unknown_array_subscript_format =
+struct deprecated_complaint unknown_array_subscript_format =
{
"DIE @ 0x%x \"%s\", unknown array subscript format %x", 0, 0
};
-struct complaint not_row_major =
+struct deprecated_complaint not_row_major =
{
"DIE @ 0x%x \"%s\", array not row major; not handled correctly", 0, 0
};
-struct complaint missing_at_name =
+struct deprecated_complaint missing_at_name =
{
"DIE @ 0x%x, AT_name tag missing", 0, 0
};
@@ -1027,6 +1027,7 @@ struct_type (struct dieinfo *dip, char *thisdie, char *enddie,
&objfile->type_obstack);
FIELD_TYPE (list->field) = decode_die_type (&mbr);
FIELD_BITPOS (list->field) = 8 * locval (&mbr);
+ FIELD_STATIC_KIND (list->field) = 0;
/* Handle bit fields. */
FIELD_BITSIZE (list->field) = mbr.at_bit_size;
if (BITS_BIG_ENDIAN)
@@ -1694,6 +1695,7 @@ enum_type (struct dieinfo *dip, struct objfile *objfile)
list = new;
FIELD_TYPE (list->field) = NULL;
FIELD_BITSIZE (list->field) = 0;
+ FIELD_STATIC_KIND (list->field) = 0;
FIELD_BITPOS (list->field) =
target_to_host (scan, TARGET_FT_LONG_SIZE (objfile), GET_SIGNED,
objfile);
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 7d37297c5f4..a29a71b544d 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -54,16 +54,16 @@ struct elfinfo
/* Various things we might complain about... */
-struct complaint section_info_complaint =
+struct deprecated_complaint section_info_complaint =
{"elf/stab section information %s without a preceding file symbol", 0, 0};
-struct complaint section_info_dup_complaint =
+struct deprecated_complaint section_info_dup_complaint =
{"duplicated elf/stab section information for %s", 0, 0};
-struct complaint stab_info_mismatch_complaint =
+struct deprecated_complaint stab_info_mismatch_complaint =
{"elf/stab section information missing for %s", 0, 0};
-struct complaint stab_info_questionable_complaint =
+struct deprecated_complaint stab_info_questionable_complaint =
{"elf/stab section information questionable for %s", 0, 0};
static void free_elfinfo (void *);
diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index 0fa37c11f96..c8d12f925df 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -1,5 +1,5 @@
/* Event loop machinery for GDB, the GNU debugger.
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
This file is part of GDB.
@@ -397,6 +397,11 @@ start_event_loop (void)
gdb_result = catch_errors (gdb_do_one_event, 0, "", RETURN_MASK_ALL);
if (gdb_result < 0)
break;
+
+ /* If we long-jumped out of do_one_event, we probably
+ didn't get around to resetting the prompt, which leaves
+ readline in a messed-up state. Reset it here. */
+
if (gdb_result == 0)
{
/* FIXME: this should really be a call to a hook that is
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 9d871d65906..8f39998ed9b 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -1168,14 +1168,39 @@ gdb_setup_readline (void)
}
}
+/* Disable command input through the standard CLI channels. Used in
+ the suspend proc for interpreters that use the standard gdb readline
+ interface, like the cli & the mi. */
+void
+gdb_disable_readline (void)
+{
+ if (event_loop_p)
+ {
+ /* FIXME - It is too heavyweight to delete and remake these
+ every time you run an interpreter that needs readline.
+ It is probably better to have the interpreters cache these,
+ which in turn means that this needs to be moved into interpreter
+ specific code. */
+
+#if 0
+ ui_file_delete (gdb_stdout);
+ ui_file_delete (gdb_stderr);
+ gdb_stdlog = NULL;
+ gdb_stdtarg = NULL;
+#endif
+
+ rl_callback_handler_remove ();
+ delete_file_handler (input_fd);
+ }
+}
+
void
_initialize_event_loop (void)
{
gdb_setup_readline ();
+ /* Tell gdb to use the cli_command_loop as the main loop. */
if (event_loop_p && command_loop_hook == NULL)
- {
- /* Tell gdb to use the cli_command_loop as the main loop. */
- command_loop_hook = cli_command_loop;
- }
+ command_loop_hook = cli_command_loop;
}
+
diff --git a/gdb/expression.h b/gdb/expression.h
index 34e002f3a28..e7f9d4863e6 100644
--- a/gdb/expression.h
+++ b/gdb/expression.h
@@ -181,6 +181,12 @@ enum exp_opcode
making three exp_elements. */
OP_FUNCALL,
+ /* OP_MSGCALL is followed by a string in the next exp_element and then an
+ integer. The string is the selector string. The integer is the number
+ of arguments to the message call. That many plus one values are used,
+ the first one being the object pointer. This is an Objective C message */
+ OP_MSGCALL,
+
/* This is EXACTLY like OP_FUNCALL but is semantically different.
In F77, array subscript expressions, substring expressions
and function calls are all exactly the same syntactically. They may
@@ -273,11 +279,17 @@ enum exp_opcode
STRUCTOP_STRUCT,
STRUCTOP_PTR,
- /* C++ */
- /* OP_THIS is just a placeholder for the class instance variable.
+ /* C++: OP_THIS is just a placeholder for the class instance variable.
It just comes in a tight (OP_THIS, OP_THIS) pair. */
OP_THIS,
+ /* Objective-C: OP_SELF is just a placeholder for the class instance
+ variable. It just comes in a tight (OP_SELF, OP_SELF) pair. */
+ OP_SELF,
+
+ /* Objective C: "@selector" pseudo-operator */
+ OP_SELECTOR,
+
/* OP_SCOPE surrounds a type name and a field name. The type
name is encoded as one element, but the field name stays as
a string, which, of course, is variable length. */
@@ -305,7 +317,10 @@ enum exp_opcode
OP_NAME,
/* An unparsed expression. Used for Scheme (for now at least) */
- OP_EXPRSTRING
+ OP_EXPRSTRING,
+
+ /* An Objective C Foundation Class NSString constant */
+ OP_NSSTRING,
};
union exp_element
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index b9004264eec..56fd70af954 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -241,9 +241,11 @@ exp : '(' exp ')'
/* Expressions, not including the comma operator. */
exp : '*' exp %prec UNARY
{ write_exp_elt_opcode (UNOP_IND); }
+ ;
exp : '&' exp %prec UNARY
{ write_exp_elt_opcode (UNOP_ADDR); }
+ ;
exp : '-' exp %prec UNARY
{ write_exp_elt_opcode (UNOP_NEG); }
@@ -283,6 +285,7 @@ arglist : exp
arglist : substring
{ arglist_len = 2;}
+ ;
arglist : arglist ',' exp %prec ABOVE_COMMA
{ arglist_len++; }
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index 48c511377e8..4bd01cc9ab2 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -102,9 +102,9 @@ f77_get_dynamic_lowerbound (struct type *type, int *lower_bound)
if (current_frame_addr > 0)
{
ptr_to_lower_bound =
- read_memory_integer (current_frame_addr +
- TYPE_ARRAY_LOWER_BOUND_VALUE (type),
- 4);
+ read_memory_typed_address (current_frame_addr +
+ TYPE_ARRAY_LOWER_BOUND_VALUE (type),
+ builtin_type_void_data_ptr);
*lower_bound = read_memory_integer (ptr_to_lower_bound, 4);
}
else
@@ -165,9 +165,9 @@ f77_get_dynamic_upperbound (struct type *type, int *upper_bound)
if (current_frame_addr > 0)
{
ptr_to_upper_bound =
- read_memory_integer (current_frame_addr +
- TYPE_ARRAY_UPPER_BOUND_VALUE (type),
- 4);
+ read_memory_typed_address (current_frame_addr +
+ TYPE_ARRAY_UPPER_BOUND_VALUE (type),
+ builtin_type_void_data_ptr);
*upper_bound = read_memory_integer (ptr_to_upper_bound, 4);
}
else
diff --git a/gdb/findvar.c b/gdb/findvar.c
index d2591321d75..eeb7e297a1e 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -391,7 +391,7 @@ symbol_read_needs_frame (struct symbol *sym)
case LOC_LOCAL_ARG:
case LOC_BASEREG:
case LOC_BASEREG_ARG:
- case LOC_THREAD_LOCAL_STATIC:
+ case LOC_HP_THREAD_LOCAL_STATIC:
return 1;
case LOC_UNDEF:
@@ -529,7 +529,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
case LOC_BASEREG:
case LOC_BASEREG_ARG:
- case LOC_THREAD_LOCAL_STATIC:
+ case LOC_HP_THREAD_LOCAL_STATIC:
{
struct value *regval;
@@ -542,6 +542,20 @@ addresses have not been bound by the dynamic loader. Try again when executable i
break;
}
+ case LOC_THREAD_LOCAL_STATIC:
+ {
+ if (target_get_thread_local_address_p ())
+ addr = target_get_thread_local_address (inferior_ptid,
+ SYMBOL_OBJFILE (var),
+ SYMBOL_VALUE_ADDRESS (var));
+ /* It wouldn't be wrong here to try a gdbarch method, too;
+ finding TLS is an ABI-specific thing. But we don't do that
+ yet. */
+ else
+ error ("Cannot find thread-local variables on this target");
+ break;
+ }
+
case LOC_TYPEDEF:
error ("Cannot look up value of a typedef");
break;
diff --git a/gdb/frame.c b/gdb/frame.c
index 1ad3b09f3bd..bfefc776934 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -29,6 +29,10 @@
#include "gdb_assert.h"
#include "gdb_string.h"
#include "builtin-regs.h"
+#include "gdb_obstack.h"
+#include "dummy-frame.h"
+#include "gdbcore.h"
+#include "annotate.h"
/* Return a frame uniq ID that can be used to, later re-find the
frame. */
@@ -115,7 +119,7 @@ frame_register_unwind (struct frame_info *frame, int regnum,
available? */
*realnump = regnum;
if (bufferp)
- read_register_gen (regnum, bufferp);
+ deprecated_read_register_gen (regnum, bufferp);
return;
}
@@ -125,6 +129,66 @@ frame_register_unwind (struct frame_info *frame, int regnum,
}
void
+frame_register (struct frame_info *frame, int regnum,
+ int *optimizedp, enum lval_type *lvalp,
+ CORE_ADDR *addrp, int *realnump, void *bufferp)
+{
+ /* Require all but BUFFERP to be valid. A NULL BUFFERP indicates
+ that the value proper does not need to be fetched. */
+ gdb_assert (optimizedp != NULL);
+ gdb_assert (lvalp != NULL);
+ gdb_assert (addrp != NULL);
+ gdb_assert (realnump != NULL);
+ /* gdb_assert (bufferp != NULL); */
+
+ /* Ulgh! Old code that, for lval_register, sets ADDRP to the offset
+ of the register in the register cache. It should instead return
+ the REGNUM corresponding to that register. Translate the . */
+ if (GET_SAVED_REGISTER_P ())
+ {
+ GET_SAVED_REGISTER (bufferp, optimizedp, addrp, frame, regnum, lvalp);
+ /* Compute the REALNUM if the caller wants it. */
+ if (*lvalp == lval_register)
+ {
+ int regnum;
+ for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
+ {
+ if (*addrp == register_offset_hack (current_gdbarch, regnum))
+ {
+ *realnump = regnum;
+ return;
+ }
+ }
+ internal_error (__FILE__, __LINE__,
+ "Failed to compute the register number corresponding"
+ " to 0x%s", paddr_d (*addrp));
+ }
+ *realnump = -1;
+ return;
+ }
+
+ /* Reached the the bottom (youngest, inner most) of the frame chain
+ (youngest, inner most) frame, go direct to the hardware register
+ cache (do not pass go, do not try to cache the value, ...). The
+ unwound value would have been cached in frame->next but that
+ doesn't exist. This doesn't matter as the hardware register
+ cache is stopping any unnecessary accesses to the target. */
+
+ /* NOTE: cagney/2002-04-14: It would be nice if, instead of a
+ special case, there was always an inner frame dedicated to the
+ hardware registers. Unfortunatly, there is too much unwind code
+ around that looks up/down the frame chain while making the
+ assumption that each frame level is using the same unwind code. */
+
+ if (frame == NULL)
+ frame_register_unwind (NULL, regnum, optimizedp, lvalp, addrp, realnump,
+ bufferp);
+ else
+ frame_register_unwind (frame->next, regnum, optimizedp, lvalp, addrp,
+ realnump, bufferp);
+}
+
+void
frame_unwind_signed_register (struct frame_info *frame, int regnum,
LONGEST *val)
{
@@ -153,6 +217,40 @@ frame_unwind_unsigned_register (struct frame_info *frame, int regnum,
}
void
+frame_read_unsigned_register (struct frame_info *frame, int regnum,
+ ULONGEST *val)
+{
+ /* NOTE: cagney/2002-10-31: There is a bit of dogma here - there is
+ always a frame. Both this, and the equivalent
+ frame_read_signed_register() function, can only be called with a
+ valid frame. If, for some reason, this function is called
+ without a frame then the problem isn't here, but rather in the
+ caller. It should of first created a frame and then passed that
+ in. */
+ /* NOTE: cagney/2002-10-31: As a side bar, keep in mind that the
+ ``current_frame'' should not be treated as a special case. While
+ ``get_next_frame (current_frame) == NULL'' currently holds, it
+ should, as far as possible, not be relied upon. In the future,
+ ``get_next_frame (current_frame)'' may instead simply return a
+ normal frame object that simply always gets register values from
+ the register cache. Consequently, frame code should try to avoid
+ tests like ``if get_next_frame() == NULL'' and instead just rely
+ on recursive frame calls (like the below code) when manipulating
+ a frame chain. */
+ gdb_assert (frame != NULL);
+ frame_unwind_unsigned_register (get_next_frame (frame), regnum, val);
+}
+
+void
+frame_read_signed_register (struct frame_info *frame, int regnum,
+ LONGEST *val)
+{
+ /* See note in frame_read_unsigned_register(). */
+ gdb_assert (frame != NULL);
+ frame_unwind_signed_register (get_next_frame (frame), regnum, val);
+}
+
+void
generic_unwind_get_saved_register (char *raw_buffer,
int *optimizedp,
CORE_ADDR *addrp,
@@ -206,7 +304,13 @@ get_saved_register (char *raw_buffer,
int regnum,
enum lval_type *lval)
{
- GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval);
+ if (GET_SAVED_REGISTER_P ())
+ {
+ GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval);
+ return;
+ }
+ generic_unwind_get_saved_register (raw_buffer, optimized, addrp, frame,
+ regnum, lval);
}
/* frame_register_read ()
@@ -219,9 +323,11 @@ get_saved_register (char *raw_buffer,
int
frame_register_read (struct frame_info *frame, int regnum, void *myaddr)
{
- int optim;
- get_saved_register (myaddr, &optim, (CORE_ADDR *) NULL, frame,
- regnum, (enum lval_type *) NULL);
+ int optimized;
+ enum lval_type lval;
+ CORE_ADDR addr;
+ int realnum;
+ frame_register (frame, regnum, &optimized, &lval, &addr, &realnum, myaddr);
/* FIXME: cagney/2002-05-15: This test, is just bogus.
@@ -233,7 +339,7 @@ frame_register_read (struct frame_info *frame, int regnum, void *myaddr)
if (register_cached (regnum) < 0)
return 0; /* register value not available */
- return !optim;
+ return !optimized;
}
@@ -276,3 +382,583 @@ frame_map_regnum_to_name (int regnum)
return REGISTER_NAME (regnum);
return builtin_reg_map_regnum_to_name (regnum);
}
+
+/* Info about the innermost stack frame (contents of FP register) */
+
+static struct frame_info *current_frame;
+
+/* Cache for frame addresses already read by gdb. Valid only while
+ inferior is stopped. Control variables for the frame cache should
+ be local to this module. */
+
+static struct obstack frame_cache_obstack;
+
+void *
+frame_obstack_alloc (unsigned long size)
+{
+ return obstack_alloc (&frame_cache_obstack, size);
+}
+
+void
+frame_saved_regs_zalloc (struct frame_info *fi)
+{
+ fi->saved_regs = (CORE_ADDR *)
+ frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
+ memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
+}
+
+
+/* Return the innermost (currently executing) stack frame. */
+
+struct frame_info *
+get_current_frame (void)
+{
+ if (current_frame == NULL)
+ {
+ if (target_has_stack)
+ current_frame = create_new_frame (read_fp (), read_pc ());
+ else
+ error ("No stack.");
+ }
+ return current_frame;
+}
+
+void
+set_current_frame (struct frame_info *frame)
+{
+ current_frame = frame;
+}
+
+/* Return the register saved in the simplistic ``saved_regs'' cache.
+ If the value isn't here AND a value is needed, try the next inner
+ most frame. */
+
+static void
+frame_saved_regs_register_unwind (struct frame_info *frame, void **cache,
+ int regnum, int *optimizedp,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnump, void *bufferp)
+{
+ /* There is always a frame at this point. And THIS is the frame
+ we're interested in. */
+ gdb_assert (frame != NULL);
+ /* If we're using generic dummy frames, we'd better not be in a call
+ dummy. (generic_call_dummy_register_unwind ought to have been called
+ instead.) */
+ gdb_assert (!(USE_GENERIC_DUMMY_FRAMES
+ && PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)));
+
+ /* Load the saved_regs register cache. */
+ if (frame->saved_regs == NULL)
+ FRAME_INIT_SAVED_REGS (frame);
+
+ if (frame->saved_regs != NULL
+ && frame->saved_regs[regnum] != 0)
+ {
+ if (regnum == SP_REGNUM)
+ {
+ /* SP register treated specially. */
+ *optimizedp = 0;
+ *lvalp = not_lval;
+ *addrp = 0;
+ *realnump = -1;
+ if (bufferp != NULL)
+ store_address (bufferp, REGISTER_RAW_SIZE (regnum),
+ frame->saved_regs[regnum]);
+ }
+ else
+ {
+ /* Any other register is saved in memory, fetch it but cache
+ a local copy of its value. */
+ *optimizedp = 0;
+ *lvalp = lval_memory;
+ *addrp = frame->saved_regs[regnum];
+ *realnump = -1;
+ if (bufferp != NULL)
+ {
+#if 1
+ /* Save each register value, as it is read in, in a
+ frame based cache. */
+ void **regs = (*cache);
+ if (regs == NULL)
+ {
+ int sizeof_cache = ((NUM_REGS + NUM_PSEUDO_REGS)
+ * sizeof (void *));
+ regs = frame_obstack_alloc (sizeof_cache);
+ memset (regs, 0, sizeof_cache);
+ (*cache) = regs;
+ }
+ if (regs[regnum] == NULL)
+ {
+ regs[regnum]
+ = frame_obstack_alloc (REGISTER_RAW_SIZE (regnum));
+ read_memory (frame->saved_regs[regnum], regs[regnum],
+ REGISTER_RAW_SIZE (regnum));
+ }
+ memcpy (bufferp, regs[regnum], REGISTER_RAW_SIZE (regnum));
+#else
+ /* Read the value in from memory. */
+ read_memory (frame->saved_regs[regnum], bufferp,
+ REGISTER_RAW_SIZE (regnum));
+#endif
+ }
+ }
+ return;
+ }
+
+ /* No luck, assume this and the next frame have the same register
+ value. If a value is needed, pass the request on down the chain;
+ otherwise just return an indication that the value is in the same
+ register as the next frame. */
+ if (bufferp == NULL)
+ {
+ *optimizedp = 0;
+ *lvalp = lval_register;
+ *addrp = 0;
+ *realnump = regnum;
+ }
+ else
+ {
+ frame_register_unwind (frame->next, regnum, optimizedp, lvalp, addrp,
+ realnump, bufferp);
+ }
+}
+
+/* Function: get_saved_register
+ Find register number REGNUM relative to FRAME and put its (raw,
+ target format) contents in *RAW_BUFFER.
+
+ Set *OPTIMIZED if the variable was optimized out (and thus can't be
+ fetched). Note that this is never set to anything other than zero
+ in this implementation.
+
+ Set *LVAL to lval_memory, lval_register, or not_lval, depending on
+ whether the value was fetched from memory, from a register, or in a
+ strange and non-modifiable way (e.g. a frame pointer which was
+ calculated rather than fetched). We will use not_lval for values
+ fetched from generic dummy frames.
+
+ Set *ADDRP to the address, either in memory or as a REGISTER_BYTE
+ offset into the registers array. If the value is stored in a dummy
+ frame, set *ADDRP to zero.
+
+ To use this implementation, define a function called
+ "get_saved_register" in your target code, which simply passes all
+ of its arguments to this function.
+
+ The argument RAW_BUFFER must point to aligned memory. */
+
+void
+deprecated_generic_get_saved_register (char *raw_buffer, int *optimized,
+ CORE_ADDR *addrp,
+ struct frame_info *frame, int regnum,
+ enum lval_type *lval)
+{
+ if (!target_has_registers)
+ error ("No registers.");
+
+ /* Normal systems don't optimize out things with register numbers. */
+ if (optimized != NULL)
+ *optimized = 0;
+
+ if (addrp) /* default assumption: not found in memory */
+ *addrp = 0;
+
+ /* Note: since the current frame's registers could only have been
+ saved by frames INTERIOR TO the current frame, we skip examining
+ the current frame itself: otherwise, we would be getting the
+ previous frame's registers which were saved by the current frame. */
+
+ while (frame && ((frame = frame->next) != NULL))
+ {
+ if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ {
+ if (lval) /* found it in a CALL_DUMMY frame */
+ *lval = not_lval;
+ if (raw_buffer)
+ /* FIXME: cagney/2002-06-26: This should be via the
+ gdbarch_register_read() method so that it, on the fly,
+ constructs either a raw or pseudo register from the raw
+ register cache. */
+ regcache_raw_read (generic_find_dummy_frame (frame->pc,
+ frame->frame),
+ regnum, raw_buffer);
+ return;
+ }
+
+ FRAME_INIT_SAVED_REGS (frame);
+ if (frame->saved_regs != NULL
+ && frame->saved_regs[regnum] != 0)
+ {
+ if (lval) /* found it saved on the stack */
+ *lval = lval_memory;
+ if (regnum == SP_REGNUM)
+ {
+ if (raw_buffer) /* SP register treated specially */
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ frame->saved_regs[regnum]);
+ }
+ else
+ {
+ if (addrp) /* any other register */
+ *addrp = frame->saved_regs[regnum];
+ if (raw_buffer)
+ read_memory (frame->saved_regs[regnum], raw_buffer,
+ REGISTER_RAW_SIZE (regnum));
+ }
+ return;
+ }
+ }
+
+ /* If we get thru the loop to this point, it means the register was
+ not saved in any frame. Return the actual live-register value. */
+
+ if (lval) /* found it in a live register */
+ *lval = lval_register;
+ if (addrp)
+ *addrp = REGISTER_BYTE (regnum);
+ if (raw_buffer)
+ deprecated_read_register_gen (regnum, raw_buffer);
+}
+
+/* Using the PC, select a mechanism for unwinding a frame returning
+ the previous frame. The register unwind function should, on
+ demand, initialize the ->context object. */
+
+static void
+set_unwind_by_pc (CORE_ADDR pc, CORE_ADDR fp,
+ frame_register_unwind_ftype **unwind)
+{
+ if (!USE_GENERIC_DUMMY_FRAMES)
+ /* Still need to set this to something. The ``info frame'' code
+ calls this function to find out where the saved registers are.
+ Hopefully this is robust enough to stop any core dumps and
+ return vaguely correct values.. */
+ *unwind = frame_saved_regs_register_unwind;
+ else if (PC_IN_CALL_DUMMY (pc, fp, fp))
+ *unwind = dummy_frame_register_unwind;
+ else
+ *unwind = frame_saved_regs_register_unwind;
+}
+
+/* Create an arbitrary (i.e. address specified by user) or innermost frame.
+ Always returns a non-NULL value. */
+
+struct frame_info *
+create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
+{
+ struct frame_info *fi;
+ char *name;
+
+ fi = (struct frame_info *)
+ obstack_alloc (&frame_cache_obstack,
+ sizeof (struct frame_info));
+
+ /* Zero all fields by default. */
+ memset (fi, 0, sizeof (struct frame_info));
+
+ fi->frame = addr;
+ fi->pc = pc;
+ find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
+ fi->signal_handler_caller = PC_IN_SIGTRAMP (fi->pc, name);
+
+ if (INIT_EXTRA_FRAME_INFO_P ())
+ INIT_EXTRA_FRAME_INFO (0, fi);
+
+ /* Select/initialize an unwind function. */
+ set_unwind_by_pc (fi->pc, fi->frame, &fi->register_unwind);
+
+ return fi;
+}
+
+/* Return the frame that FRAME calls (NULL if FRAME is the innermost
+ frame). */
+
+struct frame_info *
+get_next_frame (struct frame_info *frame)
+{
+ return frame->next;
+}
+
+/* Flush the entire frame cache. */
+
+void
+flush_cached_frames (void)
+{
+ /* Since we can't really be sure what the first object allocated was */
+ obstack_free (&frame_cache_obstack, 0);
+ obstack_init (&frame_cache_obstack);
+
+ current_frame = NULL; /* Invalidate cache */
+ select_frame (NULL);
+ annotate_frames_invalid ();
+}
+
+/* Flush the frame cache, and start a new one if necessary. */
+
+void
+reinit_frame_cache (void)
+{
+ flush_cached_frames ();
+
+ /* FIXME: The inferior_ptid test is wrong if there is a corefile. */
+ if (PIDGET (inferior_ptid) != 0)
+ {
+ select_frame (get_current_frame ());
+ }
+}
+
+/* Return a structure containing various interesting information
+ about the frame that called NEXT_FRAME. Returns NULL
+ if there is no such frame. */
+
+struct frame_info *
+get_prev_frame (struct frame_info *next_frame)
+{
+ CORE_ADDR address = 0;
+ struct frame_info *prev;
+ int fromleaf;
+ char *name;
+
+ /* Return the inner-most frame, when the caller passes in NULL. */
+ /* NOTE: cagney/2002-11-09: Not sure how this would happen. The
+ caller should have previously obtained a valid frame using
+ get_selected_frame() and then called this code - only possibility
+ I can think of is code behaving badly. */
+ if (next_frame == NULL)
+ {
+ /* NOTE: cagney/2002-11-09: There was a code segment here that
+ would error out when CURRENT_FRAME was NULL. The comment
+ that went with it made the claim ...
+
+ ``This screws value_of_variable, which just wants a nice
+ clean NULL return from block_innermost_frame if there are no
+ frames. I don't think I've ever seen this message happen
+ otherwise. And returning NULL here is a perfectly legitimate
+ thing to do.''
+
+ Per the above, this code shouldn't even be called with a NULL
+ NEXT_FRAME. */
+ return current_frame;
+ }
+
+ /* Only try to do the unwind once. */
+ if (next_frame->prev_p)
+ return next_frame->prev;
+ next_frame->prev_p = 1;
+
+ /* On some machines it is possible to call a function without
+ setting up a stack frame for it. On these machines, we
+ define this macro to take two args; a frameinfo pointer
+ identifying a frame and a variable to set or clear if it is
+ or isn't leafless. */
+
+ /* Still don't want to worry about this except on the innermost
+ frame. This macro will set FROMLEAF if NEXT_FRAME is a frameless
+ function invocation. */
+ if (next_frame->next == NULL)
+ /* FIXME: 2002-11-09: Frameless functions can occure anywhere in
+ the frame chain, not just the inner most frame! The generic,
+ per-architecture, frame code should handle this and the below
+ should simply be removed. */
+ fromleaf = FRAMELESS_FUNCTION_INVOCATION (next_frame);
+ else
+ fromleaf = 0;
+
+ if (fromleaf)
+ /* A frameless inner-most frame. The `FP' (which isn't an
+ architecture frame-pointer register!) of the caller is the same
+ as the callee. */
+ /* FIXME: 2002-11-09: There isn't any reason to special case this
+ edge condition. Instead the per-architecture code should hande
+ it locally. */
+ address = FRAME_FP (next_frame);
+ else
+ {
+ /* Two macros defined in tm.h specify the machine-dependent
+ actions to be performed here.
+
+ First, get the frame's chain-pointer.
+
+ If that is zero, the frame is the outermost frame or a leaf
+ called by the outermost frame. This means that if start
+ calls main without a frame, we'll return 0 (which is fine
+ anyway).
+
+ Nope; there's a problem. This also returns when the current
+ routine is a leaf of main. This is unacceptable. We move
+ this to after the ffi test; I'd rather have backtraces from
+ start go curfluy than have an abort called from main not show
+ main. */
+ address = FRAME_CHAIN (next_frame);
+
+ /* FIXME: cagney/2002-06-08: There should be two tests here.
+ The first would check for a valid frame chain based on a user
+ selectable policy. The default being ``stop at main'' (as
+ implemented by generic_func_frame_chain_valid()). Other
+ policies would be available - stop at NULL, .... The second
+ test, if provided by the target architecture, would check for
+ more exotic cases - most target architectures wouldn't bother
+ with this second case. */
+ if (!FRAME_CHAIN_VALID (address, next_frame))
+ return 0;
+ }
+ if (address == 0)
+ return 0;
+
+ /* Create an initially zero previous frame. */
+ prev = (struct frame_info *)
+ obstack_alloc (&frame_cache_obstack,
+ sizeof (struct frame_info));
+ memset (prev, 0, sizeof (struct frame_info));
+
+ /* Link it in. */
+ next_frame->prev = prev;
+ prev->next = next_frame;
+ prev->frame = address;
+ prev->level = next_frame->level + 1;
+
+ /* This change should not be needed, FIXME! We should determine
+ whether any targets *need* INIT_FRAME_PC to happen after
+ INIT_EXTRA_FRAME_INFO and come up with a simple way to express
+ what goes on here.
+
+ INIT_EXTRA_FRAME_INFO is called from two places: create_new_frame
+ (where the PC is already set up) and here (where it isn't).
+ INIT_FRAME_PC is only called from here, always after
+ INIT_EXTRA_FRAME_INFO.
+
+ The catch is the MIPS, where INIT_EXTRA_FRAME_INFO requires the
+ PC value (which hasn't been set yet). Some other machines appear
+ to require INIT_EXTRA_FRAME_INFO before they can do
+ INIT_FRAME_PC. Phoo.
+
+ We shouldn't need INIT_FRAME_PC_FIRST to add more complication to
+ an already overcomplicated part of GDB. gnu@cygnus.com, 15Sep92.
+
+ Assuming that some machines need INIT_FRAME_PC after
+ INIT_EXTRA_FRAME_INFO, one possible scheme:
+
+ SETUP_INNERMOST_FRAME(): Default version is just create_new_frame
+ (read_fp ()), read_pc ()). Machines with extra frame info would
+ do that (or the local equivalent) and then set the extra fields.
+
+ SETUP_ARBITRARY_FRAME(argc, argv): Only change here is that
+ create_new_frame would no longer init extra frame info;
+ SETUP_ARBITRARY_FRAME would have to do that.
+
+ INIT_PREV_FRAME(fromleaf, prev) Replace INIT_EXTRA_FRAME_INFO and
+ INIT_FRAME_PC. This should also return a flag saying whether to
+ keep the new frame, or whether to discard it, because on some
+ machines (e.g. mips) it is really awkward to have
+ FRAME_CHAIN_VALID called *before* INIT_EXTRA_FRAME_INFO (there is
+ no good way to get information deduced in FRAME_CHAIN_VALID into
+ the extra fields of the new frame). std_frame_pc(fromleaf, prev)
+
+ This is the default setting for INIT_PREV_FRAME. It just does
+ what the default INIT_FRAME_PC does. Some machines will call it
+ from INIT_PREV_FRAME (either at the beginning, the end, or in the
+ middle). Some machines won't use it.
+
+ kingdon@cygnus.com, 13Apr93, 31Jan94, 14Dec94. */
+
+ /* NOTE: cagney/2002-11-09: Just ignore the above! There is no
+ reason for things to be this complicated.
+
+ The trick is to assume that there is always a frame. Instead of
+ special casing the inner-most frame, create fake frame
+ (containing the hardware registers) that is inner to the
+ user-visible inner-most frame (...) and then unwind from that.
+ That way architecture code can use use the standard
+ frame_XX_unwind() functions and not differentiate between the
+ inner most and any other case.
+
+ Since there is always a frame to unwind from, there is always
+ somewhere (NEXT_FRAME) to store all the info needed to construct
+ a new (previous) frame without having to first create it. This
+ means that the convolution below - needing to carefully order a
+ frame's initialization - isn't needed.
+
+ The irony here though, is that FRAME_CHAIN(), at least for a more
+ up-to-date architecture, always calls FRAME_SAVED_PC(), and
+ FRAME_SAVED_PC() computes the PC but without first needing the
+ frame! Instead of the convolution below, we could have simply
+ called FRAME_SAVED_PC() and been done with it! Note that
+ FRAME_SAVED_PC() is being superseed by frame_pc_unwind() and that
+ function does have somewhere to cache that PC value. */
+
+ INIT_FRAME_PC_FIRST (fromleaf, prev);
+
+ if (INIT_EXTRA_FRAME_INFO_P ())
+ INIT_EXTRA_FRAME_INFO (fromleaf, prev);
+
+ /* This entry is in the frame queue now, which is good since
+ FRAME_SAVED_PC may use that queue to figure out its value (see
+ tm-sparc.h). We want the pc saved in the inferior frame. */
+ INIT_FRAME_PC (fromleaf, prev);
+
+ /* If ->frame and ->pc are unchanged, we are in the process of
+ getting ourselves into an infinite backtrace. Some architectures
+ check this in FRAME_CHAIN or thereabouts, but it seems like there
+ is no reason this can't be an architecture-independent check. */
+ if (prev->frame == next_frame->frame
+ && prev->pc == next_frame->pc)
+ {
+ next_frame->prev = NULL;
+ obstack_free (&frame_cache_obstack, prev);
+ return NULL;
+ }
+
+ /* Initialize the code used to unwind the frame PREV based on the PC
+ (and probably other architectural information). The PC lets you
+ check things like the debug info at that point (dwarf2cfi?) and
+ use that to decide how the frame should be unwound. */
+ set_unwind_by_pc (prev->pc, prev->frame, &prev->register_unwind);
+
+ find_pc_partial_function (prev->pc, &name,
+ (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
+ if (PC_IN_SIGTRAMP (prev->pc, name))
+ prev->signal_handler_caller = 1;
+
+ return prev;
+}
+
+CORE_ADDR
+get_frame_pc (struct frame_info *frame)
+{
+ return frame->pc;
+}
+
+#ifdef FRAME_FIND_SAVED_REGS
+/* XXX - deprecated. This is a compatibility function for targets
+ that do not yet implement FRAME_INIT_SAVED_REGS. */
+/* Find the addresses in which registers are saved in FRAME. */
+
+void
+get_frame_saved_regs (struct frame_info *frame,
+ struct frame_saved_regs *saved_regs_addr)
+{
+ if (frame->saved_regs == NULL)
+ {
+ frame->saved_regs = (CORE_ADDR *)
+ frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
+ }
+ if (saved_regs_addr == NULL)
+ {
+ struct frame_saved_regs saved_regs;
+ FRAME_FIND_SAVED_REGS (frame, saved_regs);
+ memcpy (frame->saved_regs, &saved_regs, SIZEOF_FRAME_SAVED_REGS);
+ }
+ else
+ {
+ FRAME_FIND_SAVED_REGS (frame, *saved_regs_addr);
+ memcpy (frame->saved_regs, saved_regs_addr, SIZEOF_FRAME_SAVED_REGS);
+ }
+}
+#endif
+
+void
+_initialize_frame (void)
+{
+ obstack_init (&frame_cache_obstack);
+}
diff --git a/gdb/frame.h b/gdb/frame.h
index 849566bd8b6..70d85f13c9c 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -23,6 +23,123 @@
#if !defined (FRAME_H)
#define FRAME_H 1
+/* The frame object. */
+
+struct frame_info;
+
+/* The frame object's ID. This provides a per-frame unique identifier
+ that can be used to relocate a `struct frame_info' after a target
+ resume or a frame cache destruct (assuming the target hasn't
+ unwound the stack past that frame - a problem handled elsewhere). */
+
+struct frame_id
+{
+ /* The frame's address. This should be constant through out the
+ lifetime of a frame. */
+ /* NOTE: cagney/2002-11-16: The ia64 has two stacks and hence two
+ frame bases. This will need to be expanded to accomodate that. */
+ CORE_ADDR base;
+ /* The frame's current PC. While the PC within the function may
+ change, the function that contains the PC does not. Should this
+ instead be the frame's function? */
+ CORE_ADDR pc;
+};
+
+/* For every stopped thread, GDB tracks two frames: current and
+ selected. Current frame is the inner most frame of the selected
+ thread. Selected frame is the frame currently being examined via
+ the GDB CLI (selected using `up', `down', ...). The frames are
+ created on-demand (via get_prev_frame()) and then held in a frame
+ cache. Provide mechanims for controlling these frames. */
+/* FIXME: cagney/2002-11-14: At any time, only one thread's selected
+ and current frame can be active. Switching threads causes gdb to
+ discard all that cached frame information. Ulgh! Instead, current
+ and selected frame should be bound to a thread. */
+
+extern struct frame_info *selected_frame;
+extern void select_frame (struct frame_info *);
+extern void set_current_frame (struct frame_info *);
+extern struct frame_info *get_current_frame (void);
+
+/* Invalidates the frame cache. */
+extern void flush_cached_frames (void);
+
+/* Flushes the frame cache and then selects the inner most (aka
+ current) frame - it changes selected frame. */
+/* FIXME: cagney/2002-11-14: Should this re-select the selected frame
+ from before the flush? */
+extern void reinit_frame_cache (void);
+
+/* Given a FRAME, return the next (more inner, younger) or previous
+ (more outer, older) frame. */
+extern struct frame_info *get_prev_frame (struct frame_info *);
+extern struct frame_info *get_next_frame (struct frame_info *);
+
+/* Given a frame's ID, relocate the frame. Returns NULL if the frame
+ is not found. */
+extern struct frame_info *frame_find_by_id (struct frame_id id);
+
+/* Base attributes of a frame: */
+
+/* The frame's `resume' address. Where the program will resume in
+ this frame. */
+extern CORE_ADDR get_frame_pc (struct frame_info *);
+
+/* Return the per-frame unique identifer. Can be used to relocate a
+ frame after a frame cache flush (and other similar operations). */
+extern void get_frame_id (struct frame_info *fi, struct frame_id *id);
+
+/* The frame's level: 0 for innermost, 1 for its caller, ...; or -1
+ for an invalid frame). */
+extern int frame_relative_level (struct frame_info *fi);
+
+/* Unwind the stack frame so that the value of REGNUM, in the previous
+ (up, older) frame is returned. If VALUEP is NULL, don't
+ fetch/compute the value. Instead just return the location of the
+ value. */
+extern void frame_register_unwind (struct frame_info *frame, int regnum,
+ int *optimizedp, enum lval_type *lvalp,
+ CORE_ADDR *addrp, int *realnump,
+ void *valuep);
+
+/* More convenient interface to frame_register_unwind(). */
+/* NOTE: cagney/2002-09-13: Return void as one day these functions may
+ be changed to return an indication that the read succeeded. */
+
+extern void frame_unwind_signed_register (struct frame_info *frame,
+ int regnum, LONGEST *val);
+
+extern void frame_unwind_unsigned_register (struct frame_info *frame,
+ int regnum, ULONGEST *val);
+
+/* Get the value of the register that belongs to this FRAME. This
+ function is a wrapper to the call sequence ``frame_unwind_register
+ (get_next_frame (FRAME))''. As per frame_register_unwind(), if
+ VALUEP is NULL, the registers value is not fetched/computed. */
+
+extern void frame_register (struct frame_info *frame, int regnum,
+ int *optimizedp, enum lval_type *lvalp,
+ CORE_ADDR *addrp, int *realnump,
+ void *valuep);
+
+/* More convenient interface to frame_register(). */
+/* NOTE: cagney/2002-09-13: Return void as one day these functions may
+ be changed to return an indication that the read succeeded. */
+
+extern void frame_read_signed_register (struct frame_info *frame,
+ int regnum, LONGEST *val);
+
+extern void frame_read_unsigned_register (struct frame_info *frame,
+ int regnum, ULONGEST *val);
+
+/* Map between a frame register number and its name. A frame register
+ space is a superset of the cooked register space --- it also
+ includes builtin registers. */
+
+extern int frame_map_name_to_regnum (const char *name, int strlen);
+extern const char *frame_map_regnum_to_name (int regnum);
+
+
/* Return the location (and possibly value) of REGNUM for the previous
(older, up) frame. All parameters except VALUEP can be assumed to
be non NULL. When VALUEP is NULL, just the location of the
@@ -140,10 +257,11 @@ struct frame_info
frame_register_unwind_ftype *register_unwind;
void *register_unwind_cache;
- /* Pointers to the next (down, inner) and previous (up, outer)
- frame_info's in the frame cache. */
- struct frame_info *next; /* down, inner */
- struct frame_info *prev; /* up, outer */
+ /* Pointers to the next (down, inner, younger) and previous (up,
+ outer, older) frame_info's in the frame cache. */
+ struct frame_info *next; /* down, inner, younger */
+ int prev_p;
+ struct frame_info *prev; /* up, outer, older */
};
/* Values for the source flag to be used in print_frame_info_base(). */
@@ -188,11 +306,6 @@ extern void frame_saved_regs_zalloc (struct frame_info *);
#define FRAME_FP(fi) ((fi)->frame)
-/* Level of the frame: 0 for innermost, 1 for its caller, ...; or -1
- for an invalid frame. */
-
-extern int frame_relative_level (struct frame_info *fi);
-
/* Define a default FRAME_CHAIN_VALID, in the form that is suitable for most
targets. If FRAME_CHAIN_VALID returns zero it means that the given frame
is the outermost one and has no caller.
@@ -208,21 +321,8 @@ extern int generic_file_frame_chain_valid (CORE_ADDR, struct frame_info *);
extern int generic_func_frame_chain_valid (CORE_ADDR, struct frame_info *);
extern void generic_save_dummy_frame_tos (CORE_ADDR sp);
-/* The stack frame that the user has specified for commands to act on.
- Note that one cannot assume this is the address of valid data. */
-
-extern struct frame_info *selected_frame;
-
-/* Level of the selected frame:
- 0 for innermost, 1 for its caller, ...
- or -1 for frame specified by address with no defined level. */
-
extern struct frame_info *create_new_frame (CORE_ADDR, CORE_ADDR);
-extern void flush_cached_frames (void);
-
-extern void reinit_frame_cache (void);
-
#ifdef FRAME_FIND_SAVED_REGS
/* XXX - deprecated */
@@ -231,14 +331,6 @@ extern void get_frame_saved_regs (struct frame_info *,
struct frame_saved_regs *);
#endif
-extern void set_current_frame (struct frame_info *);
-
-extern struct frame_info *get_prev_frame (struct frame_info *);
-
-extern struct frame_info *get_current_frame (void);
-
-extern struct frame_info *get_next_frame (struct frame_info *);
-
extern struct block *get_frame_block (struct frame_info *,
CORE_ADDR *addr_in_block);
@@ -248,8 +340,6 @@ extern struct block *get_selected_block (CORE_ADDR *addr_in_block);
extern struct symbol *get_frame_function (struct frame_info *);
-extern CORE_ADDR get_frame_pc (struct frame_info *);
-
extern CORE_ADDR frame_address_in_block (struct frame_info *);
extern CORE_ADDR get_pc_function_start (CORE_ADDR);
@@ -274,24 +364,6 @@ extern void print_only_stack_frame (struct frame_info *, int, int);
extern void show_stack_frame (struct frame_info *);
-extern void select_frame (struct frame_info *);
-
-/* Return an ID that can be used to re-find a frame. */
-
-struct frame_id
-{
- /* The frame's address. This should be constant through out the
- lifetime of a frame. */
- CORE_ADDR base;
- /* The frame's current PC. While this changes, the function that
- the PC falls into, does not. */
- CORE_ADDR pc;
-};
-
-extern void get_frame_id (struct frame_info *fi, struct frame_id *id);
-
-extern struct frame_info *frame_find_by_id (struct frame_id id);
-
extern void print_frame_info (struct frame_info *, int, int, int);
extern void show_frame_info (struct frame_info *, int, int, int);
@@ -325,9 +397,14 @@ extern void generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
int nargs, struct value **args,
struct type *type, int gcc_p);
-extern void generic_get_saved_register (char *, int *, CORE_ADDR *,
- struct frame_info *, int,
- enum lval_type *);
+/* The function generic_get_saved_register() has been made obsolete.
+ GET_SAVED_REGISTER now defaults to the recursive equivalent -
+ generic_unwind_get_saved_register() - so there is no need to even
+ set GET_SAVED_REGISTER. Architectures that need to override the
+ register unwind mechanism should modify frame->unwind(). */
+extern void deprecated_generic_get_saved_register (char *, int *, CORE_ADDR *,
+ struct frame_info *, int,
+ enum lval_type *);
extern void generic_unwind_get_saved_register (char *raw_buffer,
int *optimized,
@@ -336,24 +413,6 @@ extern void generic_unwind_get_saved_register (char *raw_buffer,
int regnum,
enum lval_type *lval);
-/* Unwind the stack frame so that the value of REGNUM, in the previous
- frame is returned. If VALUEP is NULL, don't fetch/compute the
- value. Instead just return the location of the value. */
-
-extern void frame_register_unwind (struct frame_info *frame, int regnum,
- int *optimizedp, enum lval_type *lvalp,
- CORE_ADDR *addrp, int *realnump,
- void *valuep);
-
-/* Unwind FRAME so that the value of register REGNUM, in the previous
- frame is returned. Simplified versions of frame_register_unwind. */
-/* NOTE: cagney/2002-09-13: Return void as one day these functions may
- be changed to return an indication that the read succeeded. */
-extern void frame_unwind_signed_register (struct frame_info *frame,
- int regnum, LONGEST *val);
-extern void frame_unwind_unsigned_register (struct frame_info *frame,
- int regnum, ULONGEST *val);
-
extern void generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi);
extern void get_saved_register (char *raw_buffer, int *optimized,
@@ -361,18 +420,9 @@ extern void get_saved_register (char *raw_buffer, int *optimized,
struct frame_info *frame,
int regnum, enum lval_type *lval);
-/* Return the register as found on the FRAME. Return zero if the
- register could not be found. */
extern int frame_register_read (struct frame_info *frame, int regnum,
void *buf);
-/* Map between a frame register number and its name. A frame register
- space is a superset of the cooked register space --- it also
- includes builtin registers. */
-
-extern int frame_map_name_to_regnum (const char *name, int strlen);
-extern const char *frame_map_regnum_to_name (int regnum);
-
/* From stack.c. */
extern void args_info (char *, int);
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index 933faa13612..48576cbd17d 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -904,9 +904,10 @@ frv_store_return_value (struct type *type, char *valbuf)
int reg8_offset = frv_register_byte (8);
if (length <= 4)
- write_register_bytes (reg8_offset + (4 - length), valbuf, length);
+ deprecated_write_register_bytes (reg8_offset + (4 - length), valbuf,
+ length);
else if (length == 8)
- write_register_bytes (reg8_offset, valbuf, length);
+ deprecated_write_register_bytes (reg8_offset, valbuf, length);
else
internal_error (__FILE__, __LINE__,
"Don't know how to return a %d-byte value.", length);
diff --git a/gdb/gdb_indent.sh b/gdb/gdb_indent.sh
index 0d0829a4a13..c47ef95828d 100755
--- a/gdb/gdb_indent.sh
+++ b/gdb/gdb_indent.sh
@@ -37,7 +37,7 @@ fi
# Different indent versions give different indentation.
case `${indent} --version 2>/dev/null < /dev/null` in
- GNU*2.2.6 ) ;;
+ GNU*2.2* ) ;;
*GNU* ) echo "Incorrect version of GNU indent" 1>&2 ;;
* ) echo "Indent is not GNU" 1>&2 ;;
esac
diff --git a/gdb/gdb_thread_db.h b/gdb/gdb_thread_db.h
index 8088da0da69..c47c424588c 100644
--- a/gdb/gdb_thread_db.h
+++ b/gdb/gdb_thread_db.h
@@ -63,7 +63,8 @@ typedef enum
TD_NOTSD, /* No thread-specific data available. */
TD_MALLOC, /* Out of memory. */
TD_PARTIALREG, /* Not entire register set was read or written. */
- TD_NOXREGS /* X register set not available for given thread. */
+ TD_NOXREGS, /* X register set not available for given thread. */
+ TD_NOTALLOC /* TLS memory not yet allocated. */
} td_err_e;
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index c0c4f9f0f0d..468726d63f7 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -64,6 +64,7 @@
#include "gdb_assert.h"
#include "gdb_string.h"
#include "gdb-events.h"
+#include "reggroups.h"
/* Static function declarations */
@@ -171,7 +172,7 @@ struct gdbarch
gdbarch_register_virtual_size_ftype *register_virtual_size;
int max_register_virtual_size;
gdbarch_register_virtual_type_ftype *register_virtual_type;
- gdbarch_do_registers_info_ftype *do_registers_info;
+ gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info;
gdbarch_print_registers_info_ftype *print_registers_info;
gdbarch_print_float_info_ftype *print_float_info;
gdbarch_print_vector_info_ftype *print_vector_info;
@@ -270,6 +271,11 @@ struct gdbarch
gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
const char * name_of_malloc;
int cannot_step_breakpoint;
+ int have_nonsteppable_watchpoint;
+ gdbarch_address_class_type_flags_ftype *address_class_type_flags;
+ gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
+ gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
+ gdbarch_register_reggroup_p_ftype *register_reggroup_p;
};
@@ -429,6 +435,11 @@ struct gdbarch startup_gdbarch =
0,
"malloc",
0,
+ 0,
+ 0,
+ 0,
+ 0,
+ default_register_reggroup_p,
/* startup_gdbarch() */
};
@@ -523,7 +534,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->init_frame_pc_first = init_frame_pc_noop;
current_gdbarch->init_frame_pc = init_frame_pc_default;
current_gdbarch->coerce_float_to_double = default_coerce_float_to_double;
- current_gdbarch->get_saved_register = generic_unwind_get_saved_register;
current_gdbarch->register_convertible = generic_register_convertible_not;
current_gdbarch->convert_register_p = legacy_convert_register_p;
current_gdbarch->register_to_value = legacy_register_to_value;
@@ -560,6 +570,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
current_gdbarch->name_of_malloc = "malloc";
+ current_gdbarch->register_reggroup_p = default_register_reggroup_p;
/* gdbarch_alloc() */
return current_gdbarch;
@@ -656,7 +667,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->register_virtual_type == 0))
fprintf_unfiltered (log, "\n\tregister_virtual_type");
- /* Skip verify of do_registers_info, has predicate */
+ /* Skip verify of deprecated_do_registers_info, has predicate */
/* Skip verify of print_registers_info, invalid_p == 0 */
/* Skip verify of print_float_info, has predicate */
/* Skip verify of print_vector_info, has predicate */
@@ -706,7 +717,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of init_frame_pc_first, invalid_p == 0 */
/* Skip verify of init_frame_pc, invalid_p == 0 */
/* Skip verify of coerce_float_to_double, invalid_p == 0 */
- /* Skip verify of get_saved_register, invalid_p == 0 */
+ /* Skip verify of get_saved_register, has predicate */
/* Skip verify of register_convertible, invalid_p == 0 */
/* Skip verify of register_convert_to_virtual, invalid_p == 0 */
/* Skip verify of register_convert_to_raw, invalid_p == 0 */
@@ -807,6 +818,11 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
/* Skip verify of name_of_malloc, invalid_p == 0 */
/* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
+ /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
+ /* Skip verify of address_class_type_flags, has predicate */
+ /* Skip verify of address_class_type_flags_to_name, has predicate */
+ /* Skip verify of address_class_name_to_type_flags, has predicate */
+ /* Skip verify of register_reggroup_p, invalid_p == 0 */
buf = ui_file_xstrdup (log, &dummy);
make_cleanup (xfree, buf);
if (strlen (buf) > 0)
@@ -841,12 +857,35 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->in_function_epilogue_p);
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
+ "gdbarch_dump: register_reggroup_p = 0x%08lx\n",
+ (long) current_gdbarch->register_reggroup_p);
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
"gdbarch_dump: pseudo_register_read = 0x%08lx\n",
(long) current_gdbarch->pseudo_register_read);
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
"gdbarch_dump: pseudo_register_write = 0x%08lx\n",
(long) current_gdbarch->pseudo_register_write);
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: address_class_name_to_type_flags = 0x%08lx\n",
+ (long) current_gdbarch->address_class_name_to_type_flags);
+#ifdef ADDRESS_CLASS_TYPE_FLAGS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
+ XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS = 0x%08lx\n",
+ (long) current_gdbarch->address_class_type_flags
+ /*ADDRESS_CLASS_TYPE_FLAGS ()*/);
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: address_class_type_flags_to_name = 0x%08lx\n",
+ (long) current_gdbarch->address_class_type_flags_to_name);
#ifdef ADDRESS_TO_POINTER
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -1074,6 +1113,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
(long) DECR_PC_AFTER_BREAK);
#endif
+#ifdef DEPRECATED_DO_REGISTERS_INFO
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs)",
+ XSTRING (DEPRECATED_DO_REGISTERS_INFO (reg_nr, fpregs)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO = 0x%08lx\n",
+ (long) current_gdbarch->deprecated_do_registers_info
+ /*DEPRECATED_DO_REGISTERS_INFO ()*/);
+#endif
#ifdef DEPRECATED_EXTRACT_RETURN_VALUE
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -1113,20 +1166,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->deprecated_store_return_value
/*DEPRECATED_STORE_RETURN_VALUE ()*/);
#endif
-#ifdef DO_REGISTERS_INFO
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "DO_REGISTERS_INFO(reg_nr, fpregs)",
- XSTRING (DO_REGISTERS_INFO (reg_nr, fpregs)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DO_REGISTERS_INFO = 0x%08lx\n",
- (long) current_gdbarch->do_registers_info
- /*DO_REGISTERS_INFO ()*/);
-#endif
#ifdef DWARF2_BUILD_FRAME_INFO
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -1383,6 +1422,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->get_saved_register
/*GET_SAVED_REGISTER ()*/);
#endif
+#ifdef HAVE_NONSTEPPABLE_WATCHPOINT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
+ XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT = %d\n",
+ HAVE_NONSTEPPABLE_WATCHPOINT);
+#endif
#ifdef INIT_EXTRA_FRAME_INFO
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -3074,29 +3121,29 @@ set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
}
int
-gdbarch_do_registers_info_p (struct gdbarch *gdbarch)
+gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- return gdbarch->do_registers_info != 0;
+ return gdbarch->deprecated_do_registers_info != 0;
}
void
-gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
+gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
{
gdb_assert (gdbarch != NULL);
- if (gdbarch->do_registers_info == 0)
+ if (gdbarch->deprecated_do_registers_info == 0)
internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_do_registers_info invalid");
+ "gdbarch: gdbarch_deprecated_do_registers_info invalid");
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_do_registers_info called\n");
- gdbarch->do_registers_info (reg_nr, fpregs);
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_do_registers_info called\n");
+ gdbarch->deprecated_do_registers_info (reg_nr, fpregs);
}
void
-set_gdbarch_do_registers_info (struct gdbarch *gdbarch,
- gdbarch_do_registers_info_ftype do_registers_info)
+set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch,
+ gdbarch_deprecated_do_registers_info_ftype deprecated_do_registers_info)
{
- gdbarch->do_registers_info = do_registers_info;
+ gdbarch->deprecated_do_registers_info = deprecated_do_registers_info;
}
void
@@ -3630,6 +3677,13 @@ set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch,
gdbarch->coerce_float_to_double = coerce_float_to_double;
}
+int
+gdbarch_get_saved_register_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->get_saved_register != 0;
+}
+
void
gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)
{
@@ -5052,6 +5106,120 @@ set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
}
+int
+gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
+ return gdbarch->have_nonsteppable_watchpoint;
+}
+
+void
+set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
+ int have_nonsteppable_watchpoint)
+{
+ gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
+}
+
+int
+gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->address_class_type_flags != 0;
+}
+
+int
+gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->address_class_type_flags == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_address_class_type_flags invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
+ return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
+}
+
+void
+set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
+ gdbarch_address_class_type_flags_ftype address_class_type_flags)
+{
+ gdbarch->address_class_type_flags = address_class_type_flags;
+}
+
+int
+gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->address_class_type_flags_to_name != 0;
+}
+
+char *
+gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->address_class_type_flags_to_name == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_address_class_type_flags_to_name invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
+ return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
+}
+
+void
+set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
+ gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
+{
+ gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
+}
+
+int
+gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->address_class_name_to_type_flags != 0;
+}
+
+int
+gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, char *name, int *type_flags_ptr)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->address_class_name_to_type_flags == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_address_class_name_to_type_flags invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
+ return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
+}
+
+void
+set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
+ gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
+{
+ gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
+}
+
+int
+gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->register_reggroup_p == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_register_reggroup_p invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
+ return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
+}
+
+void
+set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
+ gdbarch_register_reggroup_p_ftype register_reggroup_p)
+{
+ gdbarch->register_reggroup_p = register_reggroup_p;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index b14d3c17692..a2fa46532c8 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -47,6 +47,7 @@ struct value;
struct objfile;
struct minimal_symbol;
struct regcache;
+struct reggroup;
extern struct gdbarch *current_gdbarch;
@@ -778,40 +779,40 @@ extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_
#endif
#endif
-#if defined (DO_REGISTERS_INFO)
-/* Legacy for systems yet to multi-arch DO_REGISTERS_INFO */
-#if !defined (DO_REGISTERS_INFO_P)
-#define DO_REGISTERS_INFO_P() (1)
+#if defined (DEPRECATED_DO_REGISTERS_INFO)
+/* Legacy for systems yet to multi-arch DEPRECATED_DO_REGISTERS_INFO */
+#if !defined (DEPRECATED_DO_REGISTERS_INFO_P)
+#define DEPRECATED_DO_REGISTERS_INFO_P() (1)
#endif
#endif
/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO_P)
-#define DO_REGISTERS_INFO_P() (0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DO_REGISTERS_INFO_P)
+#define DEPRECATED_DO_REGISTERS_INFO_P() (0)
#endif
-extern int gdbarch_do_registers_info_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DO_REGISTERS_INFO_P)
-#error "Non multi-arch definition of DO_REGISTERS_INFO"
+extern int gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO_P)
+#error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO"
#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DO_REGISTERS_INFO_P)
-#define DO_REGISTERS_INFO_P() (gdbarch_do_registers_info_p (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DO_REGISTERS_INFO_P)
+#define DEPRECATED_DO_REGISTERS_INFO_P() (gdbarch_deprecated_do_registers_info_p (current_gdbarch))
#endif
/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO)
-#define DO_REGISTERS_INFO(reg_nr, fpregs) (internal_error (__FILE__, __LINE__, "DO_REGISTERS_INFO"), 0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DO_REGISTERS_INFO)
+#define DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs) (internal_error (__FILE__, __LINE__, "DEPRECATED_DO_REGISTERS_INFO"), 0)
#endif
-typedef void (gdbarch_do_registers_info_ftype) (int reg_nr, int fpregs);
-extern void gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs);
-extern void set_gdbarch_do_registers_info (struct gdbarch *gdbarch, gdbarch_do_registers_info_ftype *do_registers_info);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DO_REGISTERS_INFO)
-#error "Non multi-arch definition of DO_REGISTERS_INFO"
+typedef void (gdbarch_deprecated_do_registers_info_ftype) (int reg_nr, int fpregs);
+extern void gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs);
+extern void set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO)
+#error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO"
#endif
#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DO_REGISTERS_INFO)
-#define DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_do_registers_info (current_gdbarch, reg_nr, fpregs))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DO_REGISTERS_INFO)
+#define DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_deprecated_do_registers_info (current_gdbarch, reg_nr, fpregs))
#endif
#endif
@@ -1209,9 +1210,29 @@ extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch
#endif
#endif
+#if defined (GET_SAVED_REGISTER)
+/* Legacy for systems yet to multi-arch GET_SAVED_REGISTER */
+#if !defined (GET_SAVED_REGISTER_P)
+#define GET_SAVED_REGISTER_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (GET_SAVED_REGISTER_P)
+#define GET_SAVED_REGISTER_P() (0)
+#endif
+
+extern int gdbarch_get_saved_register_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER_P)
+#error "Non multi-arch definition of GET_SAVED_REGISTER"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER_P)
+#define GET_SAVED_REGISTER_P() (gdbarch_get_saved_register_p (current_gdbarch))
+#endif
+
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (GET_SAVED_REGISTER)
-#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (generic_unwind_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval))
+#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (internal_error (__FILE__, __LINE__, "GET_SAVED_REGISTER"), 0)
#endif
typedef void (gdbarch_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
@@ -2595,6 +2616,77 @@ extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int can
#endif
#endif
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (HAVE_NONSTEPPABLE_WATCHPOINT)
+#define HAVE_NONSTEPPABLE_WATCHPOINT (0)
+#endif
+
+extern int gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch);
+extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, int have_nonsteppable_watchpoint);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (HAVE_NONSTEPPABLE_WATCHPOINT)
+#error "Non multi-arch definition of HAVE_NONSTEPPABLE_WATCHPOINT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (HAVE_NONSTEPPABLE_WATCHPOINT)
+#define HAVE_NONSTEPPABLE_WATCHPOINT (gdbarch_have_nonsteppable_watchpoint (current_gdbarch))
+#endif
+#endif
+
+#if defined (ADDRESS_CLASS_TYPE_FLAGS)
+/* Legacy for systems yet to multi-arch ADDRESS_CLASS_TYPE_FLAGS */
+#if !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
+#define ADDRESS_CLASS_TYPE_FLAGS_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
+#define ADDRESS_CLASS_TYPE_FLAGS_P() (0)
+#endif
+
+extern int gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS_P)
+#error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
+#define ADDRESS_CLASS_TYPE_FLAGS_P() (gdbarch_address_class_type_flags_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_TYPE_FLAGS)
+#define ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class) (internal_error (__FILE__, __LINE__, "ADDRESS_CLASS_TYPE_FLAGS"), 0)
+#endif
+
+typedef int (gdbarch_address_class_type_flags_ftype) (int byte_size, int dwarf2_addr_class);
+extern int gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class);
+extern void set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_ftype *address_class_type_flags);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS)
+#error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_TYPE_FLAGS)
+#define ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class) (gdbarch_address_class_type_flags (current_gdbarch, byte_size, dwarf2_addr_class))
+#endif
+#endif
+
+extern int gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch);
+
+typedef char * (gdbarch_address_class_type_flags_to_name_ftype) (struct gdbarch *gdbarch, int type_flags);
+extern char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags);
+extern void set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name);
+
+extern int gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_address_class_name_to_type_flags_ftype) (struct gdbarch *gdbarch, char *name, int *type_flags_ptr);
+extern int gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, char *name, int *type_flags_ptr);
+extern void set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags);
+
+/* Is a register in a group */
+
+typedef int (gdbarch_register_reggroup_p_ftype) (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
+extern int gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
+extern void set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype *register_reggroup_p);
+
extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 79c7fe512ad..f7f9a661d8e 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -468,7 +468,7 @@ f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::generic_r
v:2:MAX_REGISTER_VIRTUAL_SIZE:int:max_register_virtual_size::::0:-1
f:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0
#
-F:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs
+F:2:DEPRECATED_DO_REGISTERS_INFO:void:deprecated_do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs
m:2:PRINT_REGISTERS_INFO:void:print_registers_info:struct ui_file *file, struct frame_info *frame, int regnum, int all:file, frame, regnum, all:::default_print_registers_info::0
M:2:PRINT_FLOAT_INFO:void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
M:2:PRINT_VECTOR_INFO:void:print_vector_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
@@ -508,7 +508,7 @@ f:2:INIT_FRAME_PC:void:init_frame_pc:int fromleaf, struct frame_info *prev:froml
v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type:::::::
f:2:COERCE_FLOAT_TO_DOUBLE:int:coerce_float_to_double:struct type *formal, struct type *actual:formal, actual:::default_coerce_float_to_double::0
-f:2:GET_SAVED_REGISTER:void:get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval:::generic_unwind_get_saved_register::0
+F:2:GET_SAVED_REGISTER:void:get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval
#
f:2:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr:::generic_register_convertible_not::0
f:2:REGISTER_CONVERT_TO_VIRTUAL:void:register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0
@@ -663,6 +663,12 @@ f:2:ELF_MAKE_MSYMBOL_SPECIAL:void:elf_make_msymbol_special:asymbol *sym, struct
f:2:COFF_MAKE_MSYMBOL_SPECIAL:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym:::default_coff_make_msymbol_special::0
v::NAME_OF_MALLOC:const char *:name_of_malloc::::"malloc":"malloc"::0
v::CANNOT_STEP_BREAKPOINT:int:cannot_step_breakpoint::::0:0::0
+v::HAVE_NONSTEPPABLE_WATCHPOINT:int:have_nonsteppable_watchpoint::::0:0::0
+F:2:ADDRESS_CLASS_TYPE_FLAGS:int:address_class_type_flags:int byte_size, int dwarf2_addr_class:byte_size, dwarf2_addr_class
+M:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:char *:address_class_type_flags_to_name:int type_flags:type_flags:
+M:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:char *name, int *type_flags_ptr:name, type_flags_ptr
+# Is a register in a group
+m:::int:register_reggroup_p:int regnum, struct reggroup *reggroup:regnum, reggroup:::default_register_reggroup_p::0
EOF
}
@@ -774,6 +780,7 @@ struct value;
struct objfile;
struct minimal_symbol;
struct regcache;
+struct reggroup;
extern struct gdbarch *current_gdbarch;
@@ -1249,6 +1256,7 @@ cat <<EOF
#include "gdb_assert.h"
#include "gdb_string.h"
#include "gdb-events.h"
+#include "reggroups.h"
/* Static function declarations */
diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h
index 88594554080..5c10c589e50 100644
--- a/gdb/gdbcore.h
+++ b/gdb/gdbcore.h
@@ -64,8 +64,15 @@ extern ULONGEST read_memory_unsigned_integer (CORE_ADDR memaddr, int len);
/* Read a null-terminated string from the debuggee's memory, given address,
* a buffer into which to place the string, and the maximum available space */
+
extern void read_memory_string (CORE_ADDR, char *, int);
+/* Read the pointer of type TYPE at ADDR, and return the address it
+ represents. */
+
+CORE_ADDR
+read_memory_typed_address (CORE_ADDR addr, struct type *type);
+
/* This takes a char *, not void *. This is probably right, because
passing in an int * or whatever is wrong with respect to
byteswapping, alignment, different sizes for host vs. target types,
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 3ef1828cd40..c9cae4cda8d 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -397,11 +397,18 @@ lookup_function_type (struct type *type)
extern int
address_space_name_to_int (char *space_identifier)
{
+ struct gdbarch *gdbarch = current_gdbarch;
+ int type_flags;
/* Check for known address space delimiters. */
if (!strcmp (space_identifier, "code"))
return TYPE_FLAG_CODE_SPACE;
else if (!strcmp (space_identifier, "data"))
return TYPE_FLAG_DATA_SPACE;
+ else if (gdbarch_address_class_name_to_type_flags_p (gdbarch)
+ && gdbarch_address_class_name_to_type_flags (gdbarch,
+ space_identifier,
+ &type_flags))
+ return type_flags;
else
error ("Unknown address space specifier: \"%s\"", space_identifier);
}
@@ -412,10 +419,14 @@ address_space_name_to_int (char *space_identifier)
extern char *
address_space_int_to_name (int space_flag)
{
+ struct gdbarch *gdbarch = current_gdbarch;
if (space_flag & TYPE_FLAG_CODE_SPACE)
return "code";
else if (space_flag & TYPE_FLAG_DATA_SPACE)
return "data";
+ else if ((space_flag & TYPE_FLAG_ADDRESS_CLASS_ALL)
+ && gdbarch_address_class_type_flags_to_name_p (gdbarch))
+ return gdbarch_address_class_type_flags_to_name (gdbarch, space_flag);
else
return NULL;
}
@@ -465,14 +476,17 @@ make_qualified_type (struct type *type, int new_flags,
is identical to the one supplied except that it has an address
space attribute attached to it (such as "code" or "data").
- This is for Harvard architectures. */
+ The space attributes "code" and "data" are for Harvard architectures.
+ The address space attributes are for architectures which have
+ alternately sized pointers or pointers with alternate representations. */
struct type *
make_type_with_address_space (struct type *type, int space_flag)
{
struct type *ntype;
int new_flags = ((TYPE_INSTANCE_FLAGS (type)
- & ~(TYPE_FLAG_CODE_SPACE | TYPE_FLAG_DATA_SPACE))
+ & ~(TYPE_FLAG_CODE_SPACE | TYPE_FLAG_DATA_SPACE
+ | TYPE_FLAG_ADDRESS_CLASS_ALL))
| space_flag);
return make_qualified_type (type, new_flags, NULL);
@@ -1327,7 +1341,7 @@ get_destructor_fn_field (struct type *t, int *method_indexp, int *field_indexp)
This used to be coded as a macro, but I don't think it is called
often enough to merit such treatment. */
-struct complaint stub_noname_complaint =
+struct deprecated_complaint stub_noname_complaint =
{"stub type has NULL name", 0, 0};
struct type *
@@ -1498,7 +1512,7 @@ add_mangled_type (struct extra *pextras, struct type *t)
default:
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"Bad int type code length x%x\n", 0, 0};
complain (&msg, tlen);
@@ -1520,7 +1534,7 @@ add_mangled_type (struct extra *pextras, struct type *t)
break;
default:
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"Bad float type code length x%x\n", 0, 0};
complain (&msg, tlen);
}
@@ -1536,7 +1550,7 @@ add_mangled_type (struct extra *pextras, struct type *t)
break;
case TYPE_CODE_TYPEDEF:
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"Typedefs in overloaded functions not yet supported\n", 0, 0};
complain (&msg);
}
@@ -1576,7 +1590,7 @@ add_mangled_type (struct extra *pextras, struct type *t)
case TYPE_CODE_ERROR:
default:
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"Unknown type code x%x\n", 0, 0};
complain (&msg, tcode);
}
@@ -3140,6 +3154,14 @@ recursive_dump_type (struct type *type, int spaces)
{
puts_filtered (" TYPE_FLAG_DATA_SPACE");
}
+ if (TYPE_ADDRESS_CLASS_1 (type))
+ {
+ puts_filtered (" TYPE_FLAG_ADDRESS_CLASS_1");
+ }
+ if (TYPE_ADDRESS_CLASS_2 (type))
+ {
+ puts_filtered (" TYPE_FLAG_ADDRESS_CLASS_2");
+ }
puts_filtered ("\n");
printfi_filtered (spaces, "flags 0x%x", TYPE_FLAGS (type));
if (TYPE_UNSIGNED (type))
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index a0b754aa928..fe4b0f12bdc 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -253,6 +253,22 @@ enum type_code
#define TYPE_FLAG_VECTOR (1 << 12)
#define TYPE_VECTOR(t) (TYPE_FLAGS (t) & TYPE_FLAG_VECTOR)
+/* Address class flags. Some environments provide for pointers whose
+ size is different from that of a normal pointer or address types
+ where the bits are interpreted differently than normal addresses. The
+ TYPE_FLAG_ADDRESS_CLASS_n flags may be used in target specific
+ ways to represent these different types of address classes. */
+#define TYPE_FLAG_ADDRESS_CLASS_1 (1 << 13)
+#define TYPE_ADDRESS_CLASS_1(t) (TYPE_INSTANCE_FLAGS(t) \
+ & TYPE_FLAG_ADDRESS_CLASS_1)
+#define TYPE_FLAG_ADDRESS_CLASS_2 (1 << 14)
+#define TYPE_ADDRESS_CLASS_2(t) (TYPE_INSTANCE_FLAGS(t) \
+ & TYPE_FLAG_ADDRESS_CLASS_2)
+#define TYPE_FLAG_ADDRESS_CLASS_ALL (TYPE_FLAG_ADDRESS_CLASS_1 \
+ | TYPE_FLAG_ADDRESS_CLASS_2)
+#define TYPE_ADDRESS_CLASS_ALL(t) (TYPE_INSTANCE_FLAGS(t) \
+ & TYPE_FLAG_ADDRESS_CLASS_ALL)
+
struct main_type
{
/* Code for kind of type */
@@ -381,22 +397,25 @@ struct main_type
CORE_ADDR physaddr;
char *physname;
-
- /* For a function or member type, this is 1 if the argument is marked
- artificial. Artificial arguments should not be shown to the
- user. */
- int artificial;
}
loc;
+ /* For a function or member type, this is 1 if the argument is marked
+ artificial. Artificial arguments should not be shown to the
+ user. */
+ unsigned int artificial : 1;
+
+ /* This flag is zero for non-static fields, 1 for fields whose location
+ is specified by the label loc.physname, and 2 for fields whose location
+ is specified by loc.physaddr. */
+
+ unsigned int static_kind : 2;
+
/* Size of this field, in bits, or zero if not packed.
For an unpacked field, the field's type's length
- says how many bytes the field occupies.
- A value of -1 or -2 indicates a static field; -1 means the location
- is specified by the label loc.physname; -2 means that loc.physaddr
- specifies the actual address. */
+ says how many bytes the field occupies. */
- int bitsize;
+ unsigned int bitsize : 29;
/* In a struct or union type, type of this field.
In a function or member type, type of this argument.
@@ -793,14 +812,15 @@ extern void allocate_cplus_struct_type (struct type *);
#define FIELD_TYPE(thisfld) ((thisfld).type)
#define FIELD_NAME(thisfld) ((thisfld).name)
#define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos)
-#define FIELD_ARTIFICIAL(thisfld) ((thisfld).loc.artificial)
+#define FIELD_ARTIFICIAL(thisfld) ((thisfld).artificial)
#define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
+#define FIELD_STATIC_KIND(thisfld) ((thisfld).static_kind)
#define FIELD_PHYSNAME(thisfld) ((thisfld).loc.physname)
#define FIELD_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
#define SET_FIELD_PHYSNAME(thisfld, name) \
- ((thisfld).bitsize = -1, FIELD_PHYSNAME(thisfld) = (name))
+ ((thisfld).static_kind = 1, FIELD_PHYSNAME(thisfld) = (name))
#define SET_FIELD_PHYSADDR(thisfld, name) \
- ((thisfld).bitsize = -2, FIELD_PHYSADDR(thisfld) = (name))
+ ((thisfld).static_kind = 2, FIELD_PHYSADDR(thisfld) = (name))
#define TYPE_FIELD(thistype, n) TYPE_MAIN_TYPE(thistype)->fields[n]
#define TYPE_FIELD_TYPE(thistype, n) FIELD_TYPE(TYPE_FIELD(thistype, n))
#define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n))
@@ -840,8 +860,9 @@ extern void allocate_cplus_struct_type (struct type *);
(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (n)))
-#define TYPE_FIELD_STATIC(thistype, n) (TYPE_MAIN_TYPE (thistype)->fields[n].bitsize < 0)
-#define TYPE_FIELD_STATIC_HAS_ADDR(thistype, n) (TYPE_MAIN_TYPE (thistype)->fields[n].bitsize == -2)
+#define TYPE_FIELD_STATIC(thistype, n) (TYPE_MAIN_TYPE (thistype)->fields[n].static_kind != 0)
+#define TYPE_FIELD_STATIC_KIND(thistype, n) TYPE_MAIN_TYPE (thistype)->fields[n].static_kind
+#define TYPE_FIELD_STATIC_HAS_ADDR(thistype, n) (TYPE_MAIN_TYPE (thistype)->fields[n].static_kind == 2)
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_PHYSNAME(TYPE_FIELD(thistype, n))
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_PHYSADDR(TYPE_FIELD(thistype, n))
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index e332dba3f3d..8be456f7ea1 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -2592,21 +2592,15 @@ init_gnu_ops (void)
gnu_ops.to_longname = "GNU Hurd process"; /* to_longname */
gnu_ops.to_doc = "GNU Hurd process"; /* to_doc */
gnu_ops.to_open = gnu_open; /* to_open */
- gnu_ops.to_close = 0; /* to_close */
gnu_ops.to_attach = gnu_attach; /* to_attach */
- gnu_ops.to_post_attach = NULL;
- gnu_ops.to_require_attach = NULL; /* to_require_attach */
gnu_ops.to_detach = gnu_detach; /* to_detach */
- gnu_ops.to_require_detach = NULL; /* to_require_detach */
gnu_ops.to_resume = gnu_resume; /* to_resume */
gnu_ops.to_wait = gnu_wait; /* to_wait */
- gnu_ops.to_post_wait = NULL; /* to_post_wait */
gnu_ops.to_fetch_registers = gnu_fetch_registers; /* to_fetch_registers */
gnu_ops.to_store_registers = gnu_store_registers; /* to_store_registers */
gnu_ops.to_prepare_to_store = gnu_prepare_to_store; /* to_prepare_to_store */
gnu_ops.to_xfer_memory = gnu_xfer_memory; /* to_xfer_memory */
gnu_ops.to_find_memory_regions = gnu_find_memory_regions;
- gnu_ops.to_files_info = 0; /* to_files_info */
gnu_ops.to_insert_breakpoint = memory_insert_breakpoint;
gnu_ops.to_remove_breakpoint = memory_remove_breakpoint;
gnu_ops.to_terminal_init = gnu_terminal_init_inferior;
@@ -2616,45 +2610,19 @@ init_gnu_ops (void)
gnu_ops.to_terminal_ours = terminal_ours;
gnu_ops.to_terminal_info = child_terminal_info;
gnu_ops.to_kill = gnu_kill_inferior; /* to_kill */
- gnu_ops.to_load = 0; /* to_load */
- gnu_ops.to_lookup_symbol = 0; /* to_lookup_symbol */
gnu_ops.to_create_inferior = gnu_create_inferior; /* to_create_inferior */
- gnu_ops.to_post_startup_inferior = NULL; /* to_post_startup_inferior */
- /* to_acknowledge_created_inferior */
- gnu_ops.to_acknowledge_created_inferior = NULL;
- /* to_clone_and_follow_inferior */
- gnu_ops.to_clone_and_follow_inferior = NULL;
- /* to_post_follow_inferior_by_clone */
- gnu_ops.to_post_follow_inferior_by_clone = NULL;
- gnu_ops.to_insert_fork_catchpoint = NULL;
- gnu_ops.to_remove_fork_catchpoint = NULL;
- gnu_ops.to_insert_vfork_catchpoint = NULL;
- gnu_ops.to_remove_vfork_catchpoint = NULL;
- gnu_ops.to_has_forked = NULL; /* to_has_forked */
- gnu_ops.to_has_vforked = NULL; /* to_has_vforked */
- gnu_ops.to_can_follow_vfork_prior_to_exec = NULL;
- gnu_ops.to_post_follow_vfork = NULL; /* to_post_follow_vfork */
- gnu_ops.to_insert_exec_catchpoint = NULL;
- gnu_ops.to_remove_exec_catchpoint = NULL;
- gnu_ops.to_has_execd = NULL;
- gnu_ops.to_reported_exec_events_per_exec_call = NULL;
- gnu_ops.to_has_exited = NULL;
gnu_ops.to_mourn_inferior = gnu_mourn_inferior; /* to_mourn_inferior */
gnu_ops.to_can_run = gnu_can_run; /* to_can_run */
- gnu_ops.to_notice_signals = 0; /* to_notice_signals */
gnu_ops.to_thread_alive = gnu_thread_alive; /* to_thread_alive */
gnu_ops.to_pid_to_str = gnu_pid_to_str; /* to_pid_to_str */
gnu_ops.to_stop = gnu_stop; /* to_stop */
gnu_ops.to_pid_to_exec_file = gnu_pid_to_exec_file; /* to_pid_to_exec_file */
gnu_ops.to_stratum = process_stratum; /* to_stratum */
- gnu_ops.DONT_USE = 0; /* to_next */
gnu_ops.to_has_all_memory = 1; /* to_has_all_memory */
gnu_ops.to_has_memory = 1; /* to_has_memory */
gnu_ops.to_has_stack = 1; /* to_has_stack */
gnu_ops.to_has_registers = 1; /* to_has_registers */
gnu_ops.to_has_execution = 1; /* to_has_execution */
- gnu_ops.to_sections = 0; /* sections */
- gnu_ops.to_sections_end = 0; /* sections_end */
gnu_ops.to_magic = OPS_MAGIC; /* to_magic */
} /* init_gnu_ops */
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index a16b1b37295..6ff2710c22d 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -467,7 +467,7 @@ fetch_register (int regno)
{
if (regno < FP0_REGNUM)
supply_register (regno, (char *) &a_tss + regno_mapping[regno].tss_ofs);
- else if (FP_REGNUM_P (regno) || FPC_REGNUM_P (regno))
+ else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
i387_supply_register (regno, (char *) &npx);
else
internal_error (__FILE__, __LINE__,
@@ -492,7 +492,7 @@ store_register (int regno)
{
if (regno < FP0_REGNUM)
regcache_collect (regno, (char *) &a_tss + regno_mapping[regno].tss_ofs);
- else if (FP_REGNUM_P (regno) || FPC_REGNUM_P (regno))
+ else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
i387_fill_fsave ((char *) &npx, regno);
else
internal_error (__FILE__, __LINE__,
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index affd8dd58ec..0b0578c5fe7 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -34,6 +34,7 @@
#include "gdbcore.h"
#include "objfiles.h"
#include "gdbcmd.h"
+#include "gdb_assert.h"
/* Extra info which is saved in each frame_info. */
struct frame_extra_info
@@ -864,28 +865,38 @@ h8300_register_name (int regno)
}
static void
-h8300_print_register (int regno)
+h8300_print_register (struct gdbarch *gdbarch, struct ui_file *file,
+ struct frame_info *frame, int regno)
{
- long val = read_register (regno);
+ ULONGEST rval;
+ long val;
const char *name = h8300_register_name (regno);
if (!name || !*name)
return;
- printf_filtered ("%-14s ", name);
+ /* FIXME: cagney/2002-10-22: The code below assumes that VAL is at
+ least 4 bytes (32 bits) in size and hence is large enough to hold
+ the largest h8300 register. Should instead be using ULONGEST and
+ the phex() functions. */
+ gdb_assert (sizeof (val) >= 4);
+ frame_read_unsigned_register (frame, regno, &rval);
+ val = rval;
+
+ fprintf_filtered (file, "%-14s ", name);
if (h8300hmode)
{
if (val)
- printf_filtered ("0x%08lx %-8ld", val, val);
+ fprintf_filtered (file, "0x%08lx %-8ld", val, val);
else
- printf_filtered ("0x%-8lx %-8ld", val, val);
+ fprintf_filtered (file, "0x%-8lx %-8ld", val, val);
}
else
{
if (val)
- printf_filtered ("0x%04lx %-4ld", val, val);
+ fprintf_filtered (file, "0x%04lx %-4ld", val, val);
else
- printf_filtered ("0x%-4lx %-4ld", val, val);
+ fprintf_filtered (file, "0x%-4lx %-4ld", val, val);
}
if (regno == E_CCR_REGNUM)
{
@@ -895,39 +906,39 @@ h8300_print_register (int regno)
unsigned char l;
frame_register_read (selected_frame, regno, b);
l = b[REGISTER_VIRTUAL_SIZE (E_CCR_REGNUM) - 1];
- printf_unfiltered ("\t");
- printf_unfiltered ("I-%d ", (l & 0x80) != 0);
- printf_unfiltered ("UI-%d ", (l & 0x40) != 0);
- printf_unfiltered ("H-%d ", (l & 0x20) != 0);
- printf_unfiltered ("U-%d ", (l & 0x10) != 0);
+ fprintf_filtered (file, "\t");
+ fprintf_filtered (file, "I-%d ", (l & 0x80) != 0);
+ fprintf_filtered (file, "UI-%d ", (l & 0x40) != 0);
+ fprintf_filtered (file, "H-%d ", (l & 0x20) != 0);
+ fprintf_filtered (file, "U-%d ", (l & 0x10) != 0);
N = (l & 0x8) != 0;
Z = (l & 0x4) != 0;
V = (l & 0x2) != 0;
C = (l & 0x1) != 0;
- printf_unfiltered ("N-%d ", N);
- printf_unfiltered ("Z-%d ", Z);
- printf_unfiltered ("V-%d ", V);
- printf_unfiltered ("C-%d ", C);
+ fprintf_filtered (file, "N-%d ", N);
+ fprintf_filtered (file, "Z-%d ", Z);
+ fprintf_filtered (file, "V-%d ", V);
+ fprintf_filtered (file, "C-%d ", C);
if ((C | Z) == 0)
- printf_unfiltered ("u> ");
+ fprintf_filtered (file, "u> ");
if ((C | Z) == 1)
- printf_unfiltered ("u<= ");
+ fprintf_filtered (file, "u<= ");
if ((C == 0))
- printf_unfiltered ("u>= ");
+ fprintf_filtered (file, "u>= ");
if (C == 1)
- printf_unfiltered ("u< ");
+ fprintf_filtered (file, "u< ");
if (Z == 0)
- printf_unfiltered ("!= ");
+ fprintf_filtered (file, "!= ");
if (Z == 1)
- printf_unfiltered ("== ");
+ fprintf_filtered (file, "== ");
if ((N ^ V) == 0)
- printf_unfiltered (">= ");
+ fprintf_filtered (file, ">= ");
if ((N ^ V) == 1)
- printf_unfiltered ("< ");
+ fprintf_filtered (file, "< ");
if ((Z | (N ^ V)) == 0)
- printf_unfiltered ("> ");
+ fprintf_filtered (file, "> ");
if ((Z | (N ^ V)) == 1)
- printf_unfiltered ("<= ");
+ fprintf_filtered (file, "<= ");
}
else if (regno == E_EXR_REGNUM && h8300smode)
{
@@ -936,23 +947,24 @@ h8300_print_register (int regno)
unsigned char l;
frame_register_read (selected_frame, regno, b);
l = b[REGISTER_VIRTUAL_SIZE (E_EXR_REGNUM) - 1];
- printf_unfiltered ("\t");
- printf_unfiltered ("T-%d - - - ", (l & 0x80) != 0);
- printf_unfiltered ("I2-%d ", (l & 4) != 0);
- printf_unfiltered ("I1-%d ", (l & 2) != 0);
- printf_unfiltered ("I0-%d", (l & 1) != 0);
+ fprintf_filtered (file, "\t");
+ fprintf_filtered (file, "T-%d - - - ", (l & 0x80) != 0);
+ fprintf_filtered (file, "I2-%d ", (l & 4) != 0);
+ fprintf_filtered (file, "I1-%d ", (l & 2) != 0);
+ fprintf_filtered (file, "I0-%d", (l & 1) != 0);
}
- printf_filtered ("\n");
+ fprintf_filtered (file, "\n");
}
static void
-h8300_do_registers_info (int regno, int cpregs)
+h8300_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
+ struct frame_info *frame, int regno, int cpregs)
{
if (regno < 0)
for (regno = 0; regno < E_NUM_REGS; ++regno)
- h8300_print_register (regno);
+ h8300_print_register (gdbarch, file, frame, regno);
else
- h8300_print_register (regno);
+ h8300_print_register (gdbarch, file, frame, regno);
}
static CORE_ADDR
@@ -1085,7 +1097,7 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_virtual_size (gdbarch, h8300_register_raw_size);
set_gdbarch_max_register_virtual_size (gdbarch, h8300h_reg_size);
set_gdbarch_register_virtual_type (gdbarch, h8300_register_virtual_type);
- set_gdbarch_do_registers_info (gdbarch, h8300_do_registers_info);
+ set_gdbarch_print_registers_info (gdbarch, h8300_print_registers_info);
set_gdbarch_print_float_info (gdbarch, h8300_print_float_info);
/*
diff --git a/gdb/h8500-tdep.c b/gdb/h8500-tdep.c
index 0696c4ea540..0bfae7a7624 100644
--- a/gdb/h8500-tdep.c
+++ b/gdb/h8500-tdep.c
@@ -175,8 +175,8 @@ h8500_pop_frame (void)
}
}
-void
-print_register_hook (int regno)
+static void
+h8500_print_register_hook (int regno)
{
if (regno == CCR_REGNUM)
{
@@ -221,6 +221,117 @@ print_register_hook (int regno)
}
}
+static void
+h8500_print_registers_info (struct gdbarch *gdbarch,
+ struct ui_file *file,
+ struct frame_info *frame,
+ int regnum, int print_all)
+{
+ int i;
+ const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
+
+ for (i = 0; i < numregs; i++)
+ {
+ /* Decide between printing all regs, non-float / vector regs, or
+ specific reg. */
+ if (regnum == -1)
+ {
+ if (!print_all)
+ {
+ if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
+ continue;
+ if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)))
+ continue;
+ }
+ }
+ else
+ {
+ if (i != regnum)
+ continue;
+ }
+
+ /* If the register name is empty, it is undefined for this
+ processor, so don't display anything. */
+ if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0')
+ continue;
+
+ fputs_filtered (REGISTER_NAME (i), file);
+ print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), file);
+
+ /* Get the data in raw format. */
+ if (! frame_register_read (frame, i, raw_buffer))
+ {
+ fprintf_filtered (file, "*value not available*\n");
+ continue;
+ }
+
+ /* FIXME: cagney/2002-08-03: This code shouldn't be necessary.
+ The function frame_register_read() should have returned the
+ pre-cooked register so no conversion is necessary. */
+ /* Convert raw data to virtual format if necessary. */
+ if (REGISTER_CONVERTIBLE (i))
+ {
+ REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i),
+ raw_buffer, virtual_buffer);
+ }
+ else
+ {
+ memcpy (virtual_buffer, raw_buffer,
+ REGISTER_VIRTUAL_SIZE (i));
+ }
+
+ /* If virtual format is floating, print it that way, and in raw
+ hex. */
+ if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
+ {
+ int j;
+
+ val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ file, 0, 1, 0, Val_pretty_default);
+
+ fprintf_filtered (file, "\t(raw 0x");
+ for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
+ {
+ int idx;
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ idx = j;
+ else
+ idx = REGISTER_RAW_SIZE (i) - 1 - j;
+ fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[idx]);
+ }
+ fprintf_filtered (file, ")");
+ }
+ else
+ {
+ /* Print the register in hex. */
+ val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ file, 'x', 1, 0, Val_pretty_default);
+ /* If not a vector register, print it also according to its
+ natural format. */
+ if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)) == 0)
+ {
+ fprintf_filtered (file, "\t");
+ val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ file, 0, 1, 0, Val_pretty_default);
+ }
+ }
+
+ /* Some h8500 specific info. */
+ h8500_print_register_hook (i);
+
+ fprintf_filtered (file, "\n");
+ }
+}
+
+void
+h8500_do_registers_info (int regnum, int all)
+{
+ h8500_print_registers_info (current_gdbarch, gdb_stdout, selected_frame,
+ regnum, all);
+}
+
int
h8500_register_size (int regno)
{
diff --git a/gdb/hp300ux-nat.c b/gdb/hp300ux-nat.c
index ecb8a35295b..7ef3e34c9e9 100644
--- a/gdb/hp300ux-nat.c
+++ b/gdb/hp300ux-nat.c
@@ -161,7 +161,7 @@ store_inferior_register (register int regno, register unsigned int regaddr)
{
store_inferior_register_1
(regno, regaddr,
- (*(int *) &registers[(REGISTER_BYTE (regno)) + i]));
+ (*(int *) &deprecated_registers[(REGISTER_BYTE (regno)) + i]));
regaddr += sizeof (int);
}
}
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 3890fc2f773..a3f95610d51 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -30,6 +30,7 @@
#include "value.h"
#include "regcache.h"
#include "completer.h"
+#include "language.h"
/* For argument passing to the inferior */
#include "symtab.h"
@@ -130,6 +131,21 @@ static void pa_register_look_aside (char *, int, long *);
static void pa_print_fp_reg (int);
static void pa_strcat_fp_reg (int, struct ui_file *, enum precision_type);
static void record_text_segment_lowaddr (bfd *, asection *, void *);
+/* FIXME: brobecker 2002-11-07: We will likely be able to make the
+ following functions static, once we hppa is partially multiarched. */
+int hppa_reg_struct_has_addr (int gcc_p, struct type *type);
+int hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs);
+CORE_ADDR hppa_stack_align (CORE_ADDR sp);
+int hppa_pc_requires_run_before_use (CORE_ADDR pc);
+int hppa_instruction_nullified (void);
+int hppa_register_byte (int reg_nr);
+struct type * hppa_register_virtual_type (int reg_nr);
+void hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
+int hppa_cannot_store_register (int regnum);
+CORE_ADDR hppa_frame_args_address (struct frame_info *fi);
+CORE_ADDR hppa_frame_locals_address (struct frame_info *fi);
+CORE_ADDR hppa_smash_text_address (CORE_ADDR addr);
+int hppa_coerce_float_to_double (struct type *formal, struct type *actual);
typedef struct
{
@@ -149,10 +165,8 @@ extern int hp_som_som_object_present;
/* In breakpoint.c */
extern int exception_catchpoints_are_fragile;
-/* This is defined in valops.c. */
-extern struct value *find_function_in_inferior (char *);
-
/* Should call_function allocate stack space for a struct return? */
+
int
hppa_use_struct_convention (int gcc_p, struct type *type)
{
@@ -300,7 +314,7 @@ static CORE_ADDR low_text_segment_address;
static void
record_text_segment_lowaddr (bfd *abfd, asection *section, void *ignored)
{
- if ((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)
+ if (((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
== (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
&& section->vma < low_text_segment_address)
low_text_segment_address = section->vma;
@@ -813,6 +827,11 @@ frameless_function_invocation (struct frame_info *frame)
return (u->Total_frame_size == 0 && u->stub_unwind.stub_type == 0);
}
+/* Immediately after a function call, return the saved pc.
+ Can't go through the frames for this because on some machines
+ the new frame is not set up until the new function executes
+ some instructions. */
+
CORE_ADDR
saved_pc_after_call (struct frame_info *frame)
{
@@ -1450,7 +1469,8 @@ push_dummy_frame (struct inferior_status *inf_status)
for (regnum = FP0_REGNUM; regnum < NUM_REGS; regnum++)
{
- read_register_bytes (REGISTER_BYTE (regnum), (char *) &freg_buffer, 8);
+ deprecated_read_register_bytes (REGISTER_BYTE (regnum),
+ (char *) &freg_buffer, 8);
sp = push_bytes (sp, (char *) &freg_buffer, 8);
}
sp = push_word (sp, read_register (IPSW_REGNUM));
@@ -1529,7 +1549,8 @@ hppa_pop_frame (void)
if (fsr.regs[regnum])
{
read_memory (fsr.regs[regnum], (char *) &freg_buffer, 8);
- write_register_bytes (REGISTER_BYTE (regnum), (char *) &freg_buffer, 8);
+ deprecated_write_register_bytes (REGISTER_BYTE (regnum),
+ (char *) &freg_buffer, 8);
}
if (fsr.regs[IPSW_REGNUM])
@@ -4426,7 +4447,7 @@ child_enable_exception_callback (enum exception_event_kind kind, int enable)
{
break_callback_sal = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line));
}
- INIT_SAL (break_callback_sal);
+ init_sal (break_callback_sal);
break_callback_sal->symtab = NULL;
break_callback_sal->pc = eh_break_addr;
break_callback_sal->line = 0;
@@ -4677,6 +4698,221 @@ hppa_skip_permanent_breakpoint (void)
/* We can leave the tail's space the same, since there's no jump. */
}
+/* Copy the function value from VALBUF into the proper location
+ for a function return.
+
+ Called only in the context of the "return" command. */
+
+void
+hppa_store_return_value (struct type *type, char *valbuf)
+{
+ /* For software floating point, the return value goes into the
+ integer registers. But we do not have any flag to key this on,
+ so we always store the value into the integer registers.
+
+ If its a float value, then we also store it into the floating
+ point registers. */
+ deprecated_write_register_bytes (REGISTER_BYTE (28)
+ + (TYPE_LENGTH (type) > 4
+ ? (8 - TYPE_LENGTH (type))
+ : (4 - TYPE_LENGTH (type))),
+ valbuf, TYPE_LENGTH (type));
+ if (! SOFT_FLOAT && TYPE_CODE (type) == TYPE_CODE_FLT)
+ deprecated_write_register_bytes (REGISTER_BYTE (FP4_REGNUM),
+ valbuf, TYPE_LENGTH (type));
+}
+
+/* Copy the function's return value into VALBUF.
+
+ This function is called only in the context of "target function calls",
+ ie. when the debugger forces a function to be called in the child, and
+ when the debugger forces a fucntion to return prematurely via the
+ "return" command. */
+
+void
+hppa_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+{
+ if (! SOFT_FLOAT && TYPE_CODE (type) == TYPE_CODE_FLT)
+ memcpy (valbuf,
+ (char *)regbuf + REGISTER_BYTE (FP4_REGNUM),
+ TYPE_LENGTH (type));
+ else
+ memcpy (valbuf,
+ ((char *)regbuf
+ + REGISTER_BYTE (28)
+ + (TYPE_LENGTH (type) > 4
+ ? (8 - TYPE_LENGTH (type))
+ : (4 - TYPE_LENGTH (type)))),
+ TYPE_LENGTH (type));
+}
+
+int
+hppa_reg_struct_has_addr (int gcc_p, struct type *type)
+{
+ /* On the PA, any pass-by-value structure > 8 bytes is actually passed
+ via a pointer regardless of its type or the compiler used. */
+ return (TYPE_LENGTH (type) > 8);
+}
+
+int
+hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs)
+{
+ /* Stack grows upward */
+ return (lhs > rhs);
+}
+
+CORE_ADDR
+hppa_stack_align (CORE_ADDR sp)
+{
+ /* elz: adjust the quantity to the next highest value which is
+ 64-bit aligned. This is used in valops.c, when the sp is adjusted.
+ On hppa the sp must always be kept 64-bit aligned */
+ return ((sp % 8) ? (sp + 7) & -8 : sp);
+}
+
+int
+hppa_pc_requires_run_before_use (CORE_ADDR pc)
+{
+ /* Sometimes we may pluck out a minimal symbol that has a negative address.
+
+ An example of this occurs when an a.out is linked against a foo.sl.
+ The foo.sl defines a global bar(), and the a.out declares a signature
+ for bar(). However, the a.out doesn't directly call bar(), but passes
+ its address in another call.
+
+ If you have this scenario and attempt to "break bar" before running,
+ gdb will find a minimal symbol for bar() in the a.out. But that
+ symbol's address will be negative. What this appears to denote is
+ an index backwards from the base of the procedure linkage table (PLT)
+ into the data linkage table (DLT), the end of which is contiguous
+ with the start of the PLT. This is clearly not a valid address for
+ us to set a breakpoint on.
+
+ Note that one must be careful in how one checks for a negative address.
+ 0xc0000000 is a legitimate address of something in a shared text
+ segment, for example. Since I don't know what the possible range
+ is of these "really, truly negative" addresses that come from the
+ minimal symbols, I'm resorting to the gross hack of checking the
+ top byte of the address for all 1's. Sigh. */
+
+ return (!target_has_stack && (pc & 0xFF000000));
+}
+
+int
+hppa_instruction_nullified (void)
+{
+ /* brobecker 2002/11/07: Couldn't we use a ULONGEST here? It would
+ avoid the type cast. I'm leaving it as is for now as I'm doing
+ semi-mechanical multiarching-related changes. */
+ const int ipsw = (int) read_register (IPSW_REGNUM);
+ const int flags = (int) read_register (FLAGS_REGNUM);
+
+ return ((ipsw & 0x00200000) && !(flags & 0x2));
+}
+
+/* Index within the register vector of the first byte of the space i
+ used for register REG_NR. */
+
+int
+hppa_register_byte (int reg_nr)
+{
+ return reg_nr * 4;
+}
+
+/* Return the GDB type object for the "standard" data type of data
+ in register N. */
+
+struct type *
+hppa_register_virtual_type (int reg_nr)
+{
+ if (reg_nr < FP4_REGNUM)
+ return builtin_type_int;
+ else
+ return builtin_type_float;
+}
+
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function. */
+
+void
+hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ write_register (28, addr);
+}
+
+/* Return True if REGNUM is not a register available to the user
+ through ptrace(). */
+
+int
+hppa_cannot_store_register (int regnum)
+{
+ return (regnum == 0
+ || regnum == PCSQ_HEAD_REGNUM
+ || (regnum >= PCSQ_TAIL_REGNUM && regnum < IPSW_REGNUM)
+ || (regnum > IPSW_REGNUM && regnum < FP4_REGNUM));
+
+}
+
+CORE_ADDR
+hppa_frame_args_address (struct frame_info *fi)
+{
+ return fi->frame;
+}
+
+CORE_ADDR
+hppa_frame_locals_address (struct frame_info *fi)
+{
+ return fi->frame;
+}
+
+CORE_ADDR
+hppa_smash_text_address (CORE_ADDR addr)
+{
+ /* The low two bits of the PC on the PA contain the privilege level.
+ Some genius implementing a (non-GCC) compiler apparently decided
+ this means that "addresses" in a text section therefore include a
+ privilege level, and thus symbol tables should contain these bits.
+ This seems like a bonehead thing to do--anyway, it seems to work
+ for our purposes to just ignore those bits. */
+
+ return (addr &= ~0x3);
+}
+
+int
+hppa_coerce_float_to_double (struct type *formal, struct type *actual)
+{
+ /* FIXME: For the pa, it appears that the debug info marks the
+ parameters as floats regardless of whether the function is
+ prototyped, but the actual values are passed as doubles for the
+ non-prototyped case and floats for the prototyped case. Thus we
+ choose to make the non-prototyped case work for C and break the
+ prototyped case, since the non-prototyped case is probably much
+ more common. */
+ return (current_language -> la_language == language_c);
+}
+
+static struct gdbarch *
+hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+ struct gdbarch *gdbarch;
+
+ /* find a candidate among the list of pre-declared architectures. */
+ arches = gdbarch_list_lookup_by_info (arches, &info);
+ if (arches != NULL)
+ return (arches->gdbarch);
+
+ /* If none found, then allocate and initialize one. */
+ gdbarch = gdbarch_alloc (&info, NULL);
+
+ return gdbarch;
+}
+
+static void
+hppa_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
+{
+ /* Nothing to print for the moment. */
+}
+
void
_initialize_hppa_tdep (void)
{
@@ -4685,6 +4921,7 @@ _initialize_hppa_tdep (void)
void tbreak_at_finish_command (char *arg, int from_tty);
void break_at_finish_at_depth_command (char *arg, int from_tty);
+ gdbarch_register (bfd_arch_hppa, hppa_gdbarch_init, hppa_dump_tdep);
tm_print_insn = print_insn_hppa;
add_cmd ("unwind", class_maintenance, unwind_command,
@@ -4722,52 +4959,3 @@ be no argument or the argument must be a depth.\n"), NULL);
be no argument or the argument must be a depth.\n"), NULL);
}
-/* Copy the function value from VALBUF into the proper location
- for a function return.
-
- Called only in the context of the "return" command. */
-
-void
-hppa_store_return_value (struct type *type, char *valbuf)
-{
- /* For software floating point, the return value goes into the
- integer registers. But we do not have any flag to key this on,
- so we always store the value into the integer registers.
-
- If its a float value, then we also store it into the floating
- point registers. */
- write_register_bytes (REGISTER_BYTE (28)
- + (TYPE_LENGTH (type) > 4
- ? (8 - TYPE_LENGTH (type))
- : (4 - TYPE_LENGTH (type))),
- valbuf,
- TYPE_LENGTH (type));
- if (! SOFT_FLOAT && TYPE_CODE (type) == TYPE_CODE_FLT)
- write_register_bytes (REGISTER_BYTE (FP4_REGNUM),
- valbuf,
- TYPE_LENGTH (type));
-}
-
-/* Copy the function's return value into VALBUF.
-
- This function is called only in the context of "target function calls",
- ie. when the debugger forces a function to be called in the child, and
- when the debugger forces a fucntion to return prematurely via the
- "return" command. */
-
-void
-hppa_extract_return_value (struct type *type, char *regbuf, char *valbuf)
-{
- if (! SOFT_FLOAT && TYPE_CODE (type) == TYPE_CODE_FLT)
- memcpy (valbuf,
- (char *)regbuf + REGISTER_BYTE (FP4_REGNUM),
- TYPE_LENGTH (type));
- else
- memcpy (valbuf,
- ((char *)regbuf
- + REGISTER_BYTE (28)
- + (TYPE_LENGTH (type) > 4
- ? (8 - TYPE_LENGTH (type))
- : (4 - TYPE_LENGTH (type)))),
- TYPE_LENGTH (type));
-}
diff --git a/gdb/hppab-nat.c b/gdb/hppab-nat.c
index 51dde60508e..d8595875c90 100644
--- a/gdb/hppab-nat.c
+++ b/gdb/hppab-nat.c
@@ -118,7 +118,7 @@ store_inferior_registers (int regno)
errno = 0;
if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM)
{
- scratch = *(int *) &registers[REGISTER_BYTE (regno)] | 0x3;
+ scratch = *(int *) &deprecated_registers[REGISTER_BYTE (regno)] | 0x3;
ptrace (PT_WUREGS, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr,
scratch);
if (errno != 0)
@@ -135,7 +135,7 @@ store_inferior_registers (int regno)
errno = 0;
ptrace (PT_WUREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) regaddr,
- *(int *) &registers[REGISTER_BYTE (regno) + i]);
+ *(int *) &deprecated_registers[REGISTER_BYTE (regno) + i]);
if (errno != 0)
{
/* Warning, not error, in case we are attached; sometimes the
diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c
index aab5e96ccf3..f10eb5a2bae 100644
--- a/gdb/hppah-nat.c
+++ b/gdb/hppah-nat.c
@@ -121,7 +121,7 @@ store_inferior_registers (int regno)
{
CORE_ADDR temp;
- temp = *(CORE_ADDR *)&registers[REGISTER_BYTE (regno)];
+ temp = *(CORE_ADDR *)&deprecated_registers[REGISTER_BYTE (regno)];
/* Set the priv level (stored in the low two bits of the PC. */
temp |= 0x3;
@@ -146,7 +146,7 @@ store_inferior_registers (int regno)
the high part of IPSW. What will it take for HP to catch a
clue about building sensible interfaces? */
if (regno == IPSW_REGNUM && len == 8)
- *(int *)&registers[REGISTER_BYTE (regno)] = 0;
+ *(int *)&deprecated_registers[REGISTER_BYTE (regno)] = 0;
#endif
for (i = 0; i < len; i += sizeof (int))
@@ -154,7 +154,7 @@ store_inferior_registers (int regno)
errno = 0;
call_ptrace (PT_WUREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) addr + i,
- *(int *) &registers[REGISTER_BYTE (regno) + i]);
+ *(int *) &deprecated_registers[REGISTER_BYTE (regno) + i]);
if (errno != 0)
{
/* Warning, not error, in case we are attached; sometimes
diff --git a/gdb/hppam3-nat.c b/gdb/hppam3-nat.c
index ee67f1b4dcf..349df39dfb3 100644
--- a/gdb/hppam3-nat.c
+++ b/gdb/hppam3-nat.c
@@ -113,15 +113,15 @@ store_inferior_registers (int regno)
*/
if (regno > 0 && regno < NUM_REGS)
{
- memcpy (&state[regno], &registers[REGISTER_BYTE (regno)],
+ memcpy (&state[regno], &deprecated_registers[REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
}
else
{
for (index = 0; index < NUM_REGS; index++)
- memcpy (&state[index], &registers[REGISTER_BYTE (index)],
+ memcpy (&state[index], &deprecated_registers[REGISTER_BYTE (index)],
REGISTER_RAW_SIZE (index));
-/* state[index] = registers[REGISTER_BYTE (index)]; */
+/* state[index] = deprecated_registers[REGISTER_BYTE (index)]; */
}
diff --git a/gdb/hpread.c b/gdb/hpread.c
index 4cc5f18c477..0011c31d7a6 100644
--- a/gdb/hpread.c
+++ b/gdb/hpread.c
@@ -129,52 +129,52 @@ struct symloc
/* FIXME: Shouldn't this stuff be in a .h file somewhere? */
/* Complaints about the symbols we have encountered. */
-extern struct complaint string_table_offset_complaint;
-extern struct complaint lbrac_unmatched_complaint;
-extern struct complaint lbrac_mismatch_complaint;
+extern struct deprecated_complaint string_table_offset_complaint;
+extern struct deprecated_complaint lbrac_unmatched_complaint;
+extern struct deprecated_complaint lbrac_mismatch_complaint;
-static struct complaint hpread_unhandled_end_common_complaint =
+static struct deprecated_complaint hpread_unhandled_end_common_complaint =
{
"unhandled symbol in hp-symtab-read.c: DNTT_TYPE_COMMON/DNTT_TYPE_END.\n", 0, 0
};
-static struct complaint hpread_unhandled_type_complaint =
+static struct deprecated_complaint hpread_unhandled_type_complaint =
{
"hpread_type_translate: unhandled type code.", 0, 0
};
-static struct complaint hpread_struct_complaint =
+static struct deprecated_complaint hpread_struct_complaint =
{
"hpread_read_struct_type: expected SVAR type...", 0, 0
};
-static struct complaint hpread_array_complaint =
+static struct deprecated_complaint hpread_array_complaint =
{
"error in hpread_array_type.", 0, 0
};
-static struct complaint hpread_type_lookup_complaint =
+static struct deprecated_complaint hpread_type_lookup_complaint =
{
"error in hpread_type_lookup().", 0, 0
};
-static struct complaint hpread_unexpected_end_complaint =
+static struct deprecated_complaint hpread_unexpected_end_complaint =
{
"internal error in hp-symtab-read.c: Unexpected DNTT_TYPE_END kind.", 0, 0
};
-static struct complaint hpread_tagdef_complaint =
+static struct deprecated_complaint hpread_tagdef_complaint =
{
"error processing class tagdef", 0, 0
};
-static struct complaint hpread_unhandled_common_complaint =
+static struct deprecated_complaint hpread_unhandled_common_complaint =
{
"unhandled symbol in hp-symtab-read.c: DNTT_TYPE_COMMON.", 0, 0
};
-static struct complaint hpread_unhandled_blockdata_complaint =
+static struct deprecated_complaint hpread_unhandled_blockdata_complaint =
{
"unhandled symbol in hp-symtab-read.c: DNTT_TYPE_BLOCKDATA.", 0, 0
};
@@ -3186,6 +3186,7 @@ hpread_read_enum_type (dnttpointer hp_type, union dnttentry *dn_bufp,
TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym);
TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym);
TYPE_FIELD_BITSIZE (type, n) = 0;
+ TYPE_FIELD_STATIC_KIND (type, n) = 0;
}
if (syms == osyms)
break;
@@ -3347,6 +3348,7 @@ hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
TYPE_FIELD_TYPE (type, n) = SYMBOL_TYPE (xsym);
TYPE_FIELD_ARTIFICIAL (type, n) = 0;
TYPE_FIELD_BITSIZE (type, n) = 0;
+ TYPE_FIELD_STATIC_KIND (type, n) = 0;
}
}
/* Mark it as having been processed */
@@ -3520,6 +3522,7 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
TYPE_FIELD_TYPE (type, n) = SYMBOL_TYPE (xsym);
TYPE_FIELD_ARTIFICIAL (type, n) = 0;
TYPE_FIELD_BITSIZE (type, n) = 0;
+ TYPE_FIELD_STATIC_KIND (type, n) = 0;
}
}
@@ -3704,6 +3707,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
list = new;
FIELD_BITSIZE (list->field) = 0;
+ FIELD_STATIC_KIND (list->field) = 0;
/* The "classname" field is actually a DNTT pointer to the base class */
baseclass = hpread_type_lookup (parentp->dinheritance.classname,
@@ -4101,6 +4105,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
list->field.name = VT (objfile) + fn_fieldp->dsvar.name;
FIELD_BITPOS (list->field) = 0; /* FIXME is this always true? */
FIELD_BITSIZE (list->field) = 0; /* use length from type */
+ FIELD_STATIC_KIND (list->field) = 0;
memtype = hpread_type_lookup (fn_fieldp->dsvar.type, objfile);
list->field.type = memtype;
list->attributes = 0;
@@ -4120,6 +4125,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
list->field.name = VT (objfile) + fn_fieldp->ddvar.name;
FIELD_BITPOS (list->field) = 0; /* FIXME is this always true? */
FIELD_BITSIZE (list->field) = 0; /* use length from type */
+ FIELD_STATIC_KIND (list->field) = 0;
memtype = hpread_type_lookup (fn_fieldp->ddvar.type, objfile);
list->field.type = memtype;
list->attributes = 0;
@@ -4168,6 +4174,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
/* A FIELD by itself (without a GENFIELD) can also be a static member */
+ FIELD_STATIC_KIND (list->field) = 0;
if (fieldp->dfield.staticmem)
{
FIELD_BITPOS (list->field) = -1;
@@ -5742,7 +5749,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
{
/* Thread-local variable.
*/
- SYMBOL_CLASS (sym) = LOC_THREAD_LOCAL_STATIC;
+ SYMBOL_CLASS (sym) = LOC_HP_THREAD_LOCAL_STATIC;
SYMBOL_BASEREG (sym) = CR27_REGNUM;
if (objfile->flags & OBJF_SHARED)
diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c
index 981bb9d5feb..26d57ba2586 100644
--- a/gdb/hpux-thread.c
+++ b/gdb/hpux-thread.c
@@ -357,18 +357,19 @@ hpux_thread_store_registers (int regno)
else if (regno == SP_REGNUM)
{
write_memory ((CORE_ADDR) & tcb_ptr->static_ctx.sp,
- registers + REGISTER_BYTE (regno),
+ &deprecated_registers[REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
tcb_ptr->static_ctx.sp = (cma__t_hppa_regs *)
- (extract_address (registers + REGISTER_BYTE (regno), REGISTER_RAW_SIZE (regno)) + 160);
+ (extract_address (&deprecated_registers[REGISTER_BYTE (regno)],
+ REGISTER_RAW_SIZE (regno)) + 160);
}
else if (regno == PC_REGNUM)
write_memory (sp - 20,
- registers + REGISTER_BYTE (regno),
+ &deprecated_registers[REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
else
write_memory (sp + regmap[regno],
- registers + REGISTER_BYTE (regno),
+ &deprecated_registers[REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
}
}
diff --git a/gdb/i386-interix-nat.c b/gdb/i386-interix-nat.c
new file mode 100644
index 00000000000..9c4daeda422
--- /dev/null
+++ b/gdb/i386-interix-nat.c
@@ -0,0 +1,190 @@
+/* Native-dependent code for Interix running on i386's, for GDB.
+ Copyright 2002 Free Software Foundation, Inc.
+
+This file is part of GDB.
+
+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 "defs.h"
+
+#include <sys/procfs.h>
+#include <inferior.h>
+#include <fcntl.h>
+
+#include <i386-tdep.h>
+#include "gdb_string.h"
+#include "gdbcore.h"
+#include "gregset.h"
+#include "regcache.h"
+
+typedef unsigned long greg_t;
+
+/* This is a duplicate of the table in i386-linux-nat.c. */
+
+static int regmap[] = {
+ EAX, ECX, EDX, EBX,
+ UESP, EBP, ESI, EDI,
+ EIP, EFL, CS, SS,
+ DS, ES, FS, GS,
+};
+
+/* Forward declarations. */
+extern void _initialize_core_interix (void);
+extern initialize_file_ftype _initialize_core_interix;
+
+/* Given a pointer to a general register set in /proc format (gregset_t *),
+ unpack the register contents and supply them as gdb's idea of the current
+ register values. */
+
+void
+supply_gregset (gregset_t *gregsetp)
+{
+ int regi;
+ greg_t *regp = (greg_t *) & gregsetp->gregs;
+
+ for (regi = 0; regi < I386_NUM_GREGS; regi++)
+ {
+ supply_register (regi, (char *) (regp + regmap[regi]));
+ }
+}
+
+/* Store GDB's value for REGNO in *GREGSETP. If REGNO is -1, do all
+ of them. */
+
+void
+fill_gregset (gregset_t *gregsetp, int regno)
+{
+ int regi;
+ greg_t *regp = (greg_t *) gregsetp->gregs;
+
+ for (regi = 0; regi < I386_NUM_GREGS; regi++)
+ if (regno == -1 || regi == regno)
+ regcache_collect (regi, (void *) (regp + regmap[regi]));
+}
+
+/* Fill GDB's register file with the floating-point register values in
+ *FPREGSETP. */
+
+void
+supply_fpregset (fpregset_t *fpregsetp)
+{
+ i387_supply_fsave ((char *) fpregsetp);
+}
+
+/* Given a pointer to a floating point register set in (fpregset_t *)
+ format, update all of the registers from gdb's idea of the current
+ floating point register set. */
+
+void
+fill_fpregset (fpregset_t *fpregsetp, int regno)
+{
+ i387_fill_fsave ((char *) fpregsetp, regno);
+}
+
+/* Read the values of either the general register set (WHICH equals 0)
+ or the floating point register set (WHICH equals 2) from the core
+ file data (pointed to by CORE_REG_SECT), and update gdb's idea of
+ their current values. The CORE_REG_SIZE parameter is compared to
+ the size of the gregset or fpgregset structures (as appropriate) to
+ validate the size of the structure from the core file. The
+ REG_ADDR parameter is ignored. */
+
+static void
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
+ CORE_ADDR reg_addr)
+{
+ gdb_gregset_t gregset;
+ gdb_fpregset_t fpregset;
+
+ if (which == 0)
+ {
+ if (core_reg_size != sizeof (gregset))
+ {
+ warning ("wrong size gregset struct in core file");
+ }
+ else
+ {
+ memcpy ((char *) &gregset, core_reg_sect, sizeof (gregset));
+ supply_gregset (&gregset);
+ }
+ }
+ else if (which == 2)
+ {
+ if (core_reg_size != sizeof (fpregset))
+ {
+ warning ("wrong size fpregset struct in core file");
+ }
+ else
+ {
+ memcpy ((char *) &fpregset, core_reg_sect, sizeof (fpregset));
+ supply_fpregset (&fpregset);
+ }
+ }
+}
+
+#include <setjmp.h>
+
+static struct core_fns interix_core_fns =
+{
+ bfd_target_coff_flavour, /* core_flavour (more or less) */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_core_registers, /* core_read_registers */
+ NULL /* next */
+};
+
+void
+_initialize_core_interix (void)
+{
+ add_core_fns (&interix_core_fns);
+}
+
+/* We don't have a /proc/pid/file or /proc/pid/exe to read a link from,
+ so read it from the same place ps gets the name. */
+
+char *
+child_pid_to_exec_file (int pid)
+{
+ char *path;
+ char *buf;
+ int fd, c;
+ char *p;
+
+ xasprintf (&path, "/proc/%d/stat", pid);
+ buf = xcalloc (MAXPATHLEN + 1, sizeof (char));
+ make_cleanup (xfree, path);
+ make_cleanup (xfree, buf);
+
+ fd = open (path, O_RDONLY);
+
+ if (fd < 0)
+ return NULL;
+
+ /* Skip over "Argv0\t". */
+ lseek (fd, 6, SEEK_SET);
+
+ c = read (fd, buf, MAXPATHLEN);
+ close (fd);
+
+ if (c < 0)
+ return NULL;
+
+ buf[c] = '\0'; /* Ensure null termination. */
+ p = strchr (buf, '\n');
+ if (p != NULL)
+ *p = '\0';
+
+ return buf;
+}
diff --git a/gdb/i386-interix-tdep.c b/gdb/i386-interix-tdep.c
new file mode 100644
index 00000000000..ff310ecad35
--- /dev/null
+++ b/gdb/i386-interix-tdep.c
@@ -0,0 +1,365 @@
+/* Target-dependent code for Interix running on i386's, for GDB.
+ Copyright 2002 Free Software Foundation, Inc.
+
+This file is part of GDB.
+
+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 "defs.h"
+#include "arch-utils.h"
+
+#include "frame.h"
+#include "gdb_string.h"
+#include "gdb-stabs.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "i386-tdep.h"
+#include "inferior.h"
+#include "libbfd.h"
+#include "objfiles.h"
+#include "osabi.h"
+#include "regcache.h"
+
+/* offsetof (mcontext_t, gregs.gregs[EBP]) */
+static const int mcontext_EBP_greg_offset = 180;
+
+/* offsetof (mcontext_t, gregs.gregs[EIP]) */
+static const int mcontext_EIP_greg_offset = 184;
+
+/* offsetof (mcontext_t, gregs.gregs[UESP]) */
+static const int mcontext_UESP_greg_offset = 196;
+
+/* offsetof (mcontext_t, gregs.reserved[1]) */
+static const int mcontext_syscall_greg_offset = 4;
+
+/* offsetof (_JUMP_BUFFER, Eip) */
+static const int jump_buffer_Eip_offset = 20;
+
+/* See procfs.c and *interix*.h in config/[alpha,i386]. */
+/* ??? These should be static, but this needs a bit of work before this
+ can be done. */
+CORE_ADDR tramp_start;
+CORE_ADDR tramp_end;
+CORE_ADDR null_start;
+CORE_ADDR null_end;
+int winver; /* Windows NT version number */
+
+/* Forward declarations. */
+extern void _initialize_i386_interix_tdep (void);
+extern initialize_file_ftype _initialize_i386_interix_tdep;
+
+/* Adjust the section offsets in an objfile structure so that it's correct
+ for the type of symbols being read (or undo it with the _restore
+ arguments).
+
+ If main programs ever start showing up at other than the default Image
+ Base, this is where that would likely be applied. */
+
+void
+pei_adjust_objfile_offsets (struct objfile *objfile,
+ enum objfile_adjusts type)
+{
+ int i;
+ CORE_ADDR symbols_offset;
+
+ switch (type)
+ {
+ case adjust_for_symtab:
+ symbols_offset = NONZERO_LINK_BASE (objfile->obfd);
+ break;
+ case adjust_for_symtab_restore:
+ symbols_offset = -NONZERO_LINK_BASE (objfile->obfd);
+ break;
+ case adjust_for_stabs:
+ case adjust_for_stabs_restore:
+ case adjust_for_dwarf:
+ case adjust_for_dwarf_restore:
+ default:
+ return;
+ }
+
+ for (i = 0; i < SECT_OFF_MAX; i++)
+ {
+ (objfile->section_offsets)->offsets[i] += symbols_offset;
+ }
+}
+
+static int
+i386_interix_pc_in_sigtramp (CORE_ADDR pc, char *name)
+{
+ /* This is sufficient, where used, but is NOT a complete test; There
+ is more in INIT_EXTRA_FRAME_INFO (a.k.a. interix_back_one_frame). */
+ return ((pc >= tramp_start && pc < tramp_end)
+ || (pc >= null_start && pc < null_end));
+}
+
+static int
+i386_interix_in_solib_call_trampoline (CORE_ADDR pc, char *name)
+{
+ return i386_pe_skip_trampoline_code (pc, name);
+}
+
+static CORE_ADDR
+i386_interix_skip_trampoline_code (CORE_ADDR pc)
+{
+ return i386_pe_skip_trampoline_code (pc, 0);
+}
+
+static void
+i386_interix_init_frame_pc (int fromleaf, struct frame_info *prev)
+{
+ /* Nothing to do on Interix. */
+}
+
+static int
+i386_interix_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
+{
+ /* In the context where this is used, we get the saved PC before we've
+ successfully unwound far enough to be sure what we've got (it may
+ be a signal handler caller). If we're dealing with a signal
+ handler caller, this will return valid, which is fine. If not,
+ it'll make the correct test. */
+ return (thisframe->signal_handler_caller
+ || (chain != 0
+ && !inside_entry_file (read_memory_integer
+ (thisframe->frame + 4, 4))));
+}
+
+/* We want to find the previous frame, which on Interix is tricky when signals
+ are involved; set frame->frame appropriately, and also get the pc
+ and tweak signal_handler_caller; this replaces a boatload of nested
+ macros, as well. */
+static void
+i386_interix_back_one_frame (int fromleaf, struct frame_info *frame)
+{
+ CORE_ADDR ra;
+ CORE_ADDR fm;
+ CORE_ADDR context;
+ long t;
+
+ if (frame == NULL)
+ internal_error (__FILE__, __LINE__, "unexpected NULL frame");
+
+ if (fromleaf)
+ {
+ frame->pc = SAVED_PC_AFTER_CALL (frame->next);
+ return;
+ }
+
+ if (!frame->next)
+ {
+ frame->pc = read_pc ();
+
+ /* Part of the signal stuff... See below. */
+ if (stopped_by_random_signal)
+ {
+ /* We know we're in a system call mini-frame; was it
+ NullApi or something else? */
+ ra = SAVED_PC_AFTER_CALL (frame);
+ if (ra >= null_start && ra < null_end)
+ frame->signal_handler_caller = 1;
+ /* There might also be an indirect call to the mini-frame,
+ putting one more return address on the stack. (XP only,
+ I think?) This can't (reasonably) return the address of the
+ signal handler caller unless it's that situation, so this
+ is safe. */
+ ra = read_memory_unsigned_integer (read_register (SP_REGNUM) + 4, 4);
+ if (ra >= null_start && ra < null_end)
+ frame->signal_handler_caller = 1;
+ }
+ return;
+ }
+
+ if (!frame->next->signal_handler_caller)
+ {
+ frame->pc = read_memory_integer (frame->next->frame + 4, 4);
+ return;
+ }
+
+ /* This is messy (actually AWFUL)... The "trampoline" might be 2, 3
+ or all 5 entities on the frame.
+
+ Chunk 1 will be present when we're actually in a signal handler.
+ Chunk 2 will be present when an asynchronous signal (one that
+ didn't come in with a system call) is present.
+ We may not (yet) be in the handler, if we're just returning
+ from the call.
+ When we're actually in a handler taken from an asynchronous
+ signal, both will be present.
+
+ Chunk 1:
+ PdxSignalDeliverer's frame
+ + Context struct -- not accounted for in any frame
+
+ Chunk 2:
+ + PdxNullPosixApi's frame
+ + PdxNullApiCaller's frame
+ + Context struct = 0x230 not accounted for in any frame
+
+ The symbol names come from examining objdumps of psxdll.dll;
+ they don't appear in the runtime image.
+
+ For gdb's purposes, we can pile all this into one frame. */
+
+ ra = frame->next->pc;
+ /* Are we already pointing at PdxNullPosixApi? We are if
+ this is a signal frame, we're at next-to-top, and were stopped
+ by a random signal (if it wasn't the right address under
+ these circumstances, we wouldn't be here at all by tests above
+ on the prior frame). */
+ if (frame->next->next == NULL && stopped_by_random_signal)
+ {
+ /* We're pointing at the frame FOR PdxNullApi. */
+ fm = frame->frame;
+ }
+ else
+ {
+ /* No... We must be pointing at the frame that was called
+ by PdxSignalDeliverer; back up across the whole mess. */
+
+ /* Extract the frame for PdxSignalDeliverer.
+ Note: FRAME_CHAIN used the "old" frame pointer because we were
+ a deliverer. Get the address of the context record that's on
+ here frameless. */
+ context = read_memory_integer (frame->frame, 4); /* an Arg */
+
+ /* Now extract the frame pointer contained in the context. */
+ fm = read_memory_integer (context + mcontext_EBP_greg_offset, 4);
+
+ ra = read_memory_integer (context + mcontext_EIP_greg_offset, 4);
+
+ /* We need to know if we're in a system call because we'll be
+ in a syscall mini-frame, if so, and the rules are different. */
+ t = (long) read_memory_integer (context + mcontext_syscall_greg_offset,
+ 4);
+ /* t contains 0 if running free, 1 if blocked on a system call,
+ and 2 if blocked on an exception message (e.g. a trap);
+ we don't expect to get here with a 2. */
+ if (t != 1)
+ {
+ /* Not at a system call, therefore it can't be NullApi. */
+ frame->pc = ra;
+ frame->frame = fm;
+ return;
+ }
+
+ /* It's a system call... Mini frame, then look for NullApi. */
+ /* Get the RA (on the stack) associated with this... It's
+ a system call mini-frame. */
+ ra = read_memory_integer (context + mcontext_UESP_greg_offset, 4);
+
+ if (winver >= 51)
+ {
+ /* Newer versions of Windows NT interpose another return
+ address (but no other "stack frame" stuff) that we need
+ to simply ignore here. */
+ ra += 4;
+ }
+
+ ra = read_memory_integer (ra, 4);
+
+ if (!(ra >= null_start && ra < null_end))
+ {
+ /* No Null API present; we're done. */
+ frame->pc = ra;
+ frame->frame = fm;
+ return;
+ }
+ }
+
+ /* At this point, we're looking at the frame for PdxNullPosixApi,
+ in either case.
+
+ PdxNullPosixApi is called by PdxNullApiCaller (which in turn
+ is called by _PdxNullApiCaller (note the _).)
+ PdxNullPosixApiCaller (no _) is a frameless function.
+
+ The saved frame pointer is as fm, but it's not of interest
+ to us because it skips us over the saved context, which is
+ the wrong thing to do, because it skips the interrrupted
+ routine! PdxNullApiCaller takes as its only argument the
+ address of the context of the interrupded function (which
+ is really in no frame, but jammed on the stack by the system)
+
+ So: fm+0: saved bp
+ fm+4: return address to _PdxNullApiCaller
+ fm+8: arg to PdxNullApiCaller pushed by _Pdx... */
+
+ fm = read_memory_integer (fm + 0x8, 4);
+
+ /* Extract the second context record. */
+
+ ra = read_memory_integer (fm + mcontext_EIP_greg_offset, 4);
+ fm = read_memory_integer (fm + mcontext_EBP_greg_offset, 4);
+
+ frame->frame = fm;
+ frame->pc = ra;
+
+ return;
+}
+
+static CORE_ADDR
+i386_interix_frame_saved_pc (struct frame_info *fi)
+{
+ /* Assume that we've already unwound enough to have the caller's address
+ if we're dealing with a signal handler caller (And if that fails,
+ return 0). */
+ if (fi->signal_handler_caller)
+ return fi->next ? fi->next->pc : 0;
+ else
+ return read_memory_integer (fi->frame + 4, 4);
+}
+
+static void
+i386_interix_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ tdep->struct_return = reg_struct_return;
+ tdep->jb_pc_offset = jump_buffer_Eip_offset;
+
+ set_gdbarch_decr_pc_after_break (gdbarch, 0);
+ set_gdbarch_pc_in_sigtramp (gdbarch, i386_interix_pc_in_sigtramp);
+ set_gdbarch_in_solib_call_trampoline (gdbarch,
+ i386_interix_in_solib_call_trampoline);
+ set_gdbarch_skip_trampoline_code (gdbarch,
+ i386_interix_skip_trampoline_code);
+ set_gdbarch_init_extra_frame_info (gdbarch, i386_interix_back_one_frame);
+ set_gdbarch_init_frame_pc (gdbarch, i386_interix_init_frame_pc);
+ set_gdbarch_frame_chain_valid (gdbarch, i386_interix_frame_chain_valid);
+ set_gdbarch_frame_saved_pc (gdbarch, i386_interix_frame_saved_pc);
+ set_gdbarch_name_of_malloc (gdbarch, "_malloc");
+}
+
+static enum gdb_osabi
+i386_interix_osabi_sniffer (bfd * abfd)
+{
+ char *target_name = bfd_get_target (abfd);
+
+ if (strcmp (target_name, "pei-i386") == 0)
+ return GDB_OSABI_INTERIX;
+
+ return GDB_OSABI_UNKNOWN;
+}
+
+void
+_initialize_i386_interix_tdep (void)
+{
+ gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour,
+ i386_interix_osabi_sniffer);
+
+ gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_INTERIX,
+ i386_interix_init_abi);
+}
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 84588795699..5ea78026095 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -34,6 +34,10 @@
#include <sys/reg.h>
#endif
+#ifndef ORIG_EAX
+#define ORIG_EAX -1
+#endif
+
#ifdef HAVE_SYS_DEBUGREG_H
#include <sys/debugreg.h>
#endif
@@ -90,7 +94,15 @@ static int regmap[] =
EAX, ECX, EDX, EBX,
UESP, EBP, ESI, EDI,
EIP, EFL, CS, SS,
- DS, ES, FS, GS
+ DS, ES, FS, GS,
+ -1, -1, -1, -1, /* st0, st1, st2, st3 */
+ -1, -1, -1, -1, /* st4, st5, st6, st7 */
+ -1, -1, -1, -1, /* fctrl, fstat, ftag, fiseg */
+ -1, -1, -1, -1, /* fioff, foseg, fooff, fop */
+ -1, -1, -1, -1, /* xmm0, xmm1, xmm2, xmm3 */
+ -1, -1, -1, -1, /* xmm4, xmm5, xmm6, xmm6 */
+ -1, /* mxcsr */
+ ORIG_EAX
};
/* Which ptrace request retrieves which registers?
@@ -148,155 +160,58 @@ kernel_u_size (void)
}
-/* Fetching registers directly from the U area, one at a time. */
-
-/* FIXME: kettenis/2000-03-05: This duplicates code from `inptrace.c'.
- The problem is that we define FETCH_INFERIOR_REGISTERS since we
- want to use our own versions of {fetch,store}_inferior_registers
- that use the GETREGS request. This means that the code in
- `infptrace.c' is #ifdef'd out. But we need to fall back on that
- code when GDB is running on top of a kernel that doesn't support
- the GETREGS request. I want to avoid changing `infptrace.c' right
- now. */
-
-#ifndef PT_READ_U
-#define PT_READ_U PTRACE_PEEKUSR
-#endif
-#ifndef PT_WRITE_U
-#define PT_WRITE_U PTRACE_POKEUSR
-#endif
-
-/* Default the type of the ptrace transfer to int. */
-#ifndef PTRACE_XFER_TYPE
-#define PTRACE_XFER_TYPE int
-#endif
-
-/* Registers we shouldn't try to fetch. */
-#define OLD_CANNOT_FETCH_REGISTER(regno) ((regno) >= I386_NUM_GREGS)
+/* Accessing registers through the U area, one at a time. */
/* Fetch one register. */
static void
fetch_register (int regno)
{
- /* This isn't really an address. But ptrace thinks of it as one. */
- CORE_ADDR regaddr;
- char mess[128]; /* For messages */
- register int i;
- unsigned int offset; /* Offset of registers within the u area. */
- char buf[MAX_REGISTER_RAW_SIZE];
int tid;
+ int val;
- if (OLD_CANNOT_FETCH_REGISTER (regno))
+ gdb_assert (!have_ptrace_getregs);
+ if (cannot_fetch_register (regno))
{
- memset (buf, '\0', REGISTER_RAW_SIZE (regno)); /* Supply zeroes */
- supply_register (regno, buf);
+ supply_register (regno, NULL);
return;
}
- /* Overload thread id onto process id */
+ /* GNU/Linux LWP ID's are process ID's. */
if ((tid = TIDGET (inferior_ptid)) == 0)
- tid = PIDGET (inferior_ptid); /* no thread id, just use process id */
-
- offset = U_REGS_OFFSET;
-
- regaddr = register_addr (regno, offset);
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
- {
- errno = 0;
- *(PTRACE_XFER_TYPE *) & buf[i] = ptrace (PT_READ_U, tid,
- (PTRACE_ARG3_TYPE) regaddr, 0);
- regaddr += sizeof (PTRACE_XFER_TYPE);
- if (errno != 0)
- {
- sprintf (mess, "reading register %s (#%d)",
- REGISTER_NAME (regno), regno);
- perror_with_name (mess);
- }
- }
- supply_register (regno, buf);
-}
+ tid = PIDGET (inferior_ptid); /* Not a threaded program. */
-/* Fetch register values from the inferior.
- If REGNO is negative, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
+ errno = 0;
+ val = ptrace (PTRACE_PEEKUSER, tid, register_addr (regno, 0), 0);
+ if (errno != 0)
+ error ("Couldn't read register %s (#%d): %s.", REGISTER_NAME (regno),
+ regno, safe_strerror (errno));
-void
-old_fetch_inferior_registers (int regno)
-{
- if (regno >= 0)
- {
- fetch_register (regno);
- }
- else
- {
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- fetch_register (regno);
- }
- }
+ supply_register (regno, &val);
}
-/* Registers we shouldn't try to store. */
-#define OLD_CANNOT_STORE_REGISTER(regno) ((regno) >= I386_NUM_GREGS)
-
/* Store one register. */
static void
store_register (int regno)
{
- /* This isn't really an address. But ptrace thinks of it as one. */
- CORE_ADDR regaddr;
- char mess[128]; /* For messages */
- register int i;
- unsigned int offset; /* Offset of registers within the u area. */
int tid;
+ int val;
- if (OLD_CANNOT_STORE_REGISTER (regno))
- {
- return;
- }
+ gdb_assert (!have_ptrace_getregs);
+ if (cannot_store_register (regno))
+ return;
- /* Overload thread id onto process id */
+ /* GNU/Linux LWP ID's are process ID's. */
if ((tid = TIDGET (inferior_ptid)) == 0)
- tid = PIDGET (inferior_ptid); /* no thread id, just use process id */
-
- offset = U_REGS_OFFSET;
-
- regaddr = register_addr (regno, offset);
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
- {
- errno = 0;
- ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) regaddr,
- *(PTRACE_XFER_TYPE *) & registers[REGISTER_BYTE (regno) + i]);
- regaddr += sizeof (PTRACE_XFER_TYPE);
- if (errno != 0)
- {
- sprintf (mess, "writing register %s (#%d)",
- REGISTER_NAME (regno), regno);
- perror_with_name (mess);
- }
- }
-}
-
-/* Store our register values back into the inferior.
- If REGNO is negative, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
+ tid = PIDGET (inferior_ptid); /* Not a threaded program. */
-void
-old_store_inferior_registers (int regno)
-{
- if (regno >= 0)
- {
- store_register (regno);
- }
- else
- {
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- store_register (regno);
- }
- }
+ errno = 0;
+ regcache_collect (regno, &val);
+ ptrace (PTRACE_POKEUSER, tid, register_addr (regno, 0), val);
+ if (errno != 0)
+ error ("Couldn't read register %s (#%d): %s.", REGISTER_NAME (regno),
+ regno, safe_strerror (errno));
}
@@ -573,16 +488,15 @@ static void dummy_sse_values (void) {}
int
cannot_fetch_register (int regno)
{
- if (! have_ptrace_getregs)
- return OLD_CANNOT_FETCH_REGISTER (regno);
- return 0;
+ gdb_assert (regno >= 0 && regno < NUM_REGS);
+ return (!have_ptrace_getregs && regmap[regno] == -1);
}
+
int
cannot_store_register (int regno)
{
- if (! have_ptrace_getregs)
- return OLD_CANNOT_STORE_REGISTER (regno);
- return 0;
+ gdb_assert (regno >= 0 && regno < NUM_REGS);
+ return (!have_ptrace_getregs && regmap[regno] == -1);
}
/* Fetch register REGNO from the child process. If REGNO is -1, do
@@ -596,9 +510,14 @@ fetch_inferior_registers (int regno)
/* Use the old method of peeking around in `struct user' if the
GETREGS request isn't available. */
- if (! have_ptrace_getregs)
+ if (!have_ptrace_getregs)
{
- old_fetch_inferior_registers (regno);
+ int i;
+
+ for (i = 0; i < NUM_REGS; i++)
+ if (regno == -1 || regno == i)
+ fetch_register (i);
+
return;
}
@@ -615,9 +534,9 @@ fetch_inferior_registers (int regno)
fetch_regs (tid);
/* The call above might reset `have_ptrace_getregs'. */
- if (! have_ptrace_getregs)
+ if (!have_ptrace_getregs)
{
- old_fetch_inferior_registers (-1);
+ fetch_inferior_registers (regno);
return;
}
@@ -662,9 +581,14 @@ store_inferior_registers (int regno)
/* Use the old method of poking around in `struct user' if the
SETREGS request isn't available. */
- if (! have_ptrace_getregs)
+ if (!have_ptrace_getregs)
{
- old_store_inferior_registers (regno);
+ int i;
+
+ for (i = 0; i < NUM_REGS; i++)
+ if (regno == -1 || regno == i)
+ store_register (i);
+
return;
}
@@ -724,7 +648,7 @@ i386_linux_dr_get (int regnum)
stuff to the target vectore. For now, just return zero if the
ptrace call fails. */
errno = 0;
- value = ptrace (PT_READ_U, tid,
+ value = ptrace (PTRACE_PEEKUSER, tid,
offsetof (struct user, u_debugreg[regnum]), 0);
if (errno != 0)
#if 0
@@ -747,7 +671,7 @@ i386_linux_dr_set (int regnum, unsigned long value)
tid = PIDGET (inferior_ptid);
errno = 0;
- ptrace (PT_WRITE_U, tid,
+ ptrace (PTRACE_POKEUSER, tid,
offsetof (struct user, u_debugreg[regnum]), value);
if (errno != 0)
perror_with_name ("Couldn't write debug register");
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index a833fb59838..f35c4ff9f87 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -25,6 +25,7 @@
#include "value.h"
#include "regcache.h"
#include "inferior.h"
+#include "reggroups.h"
/* For i386_linux_skip_solib_resolver. */
#include "symtab.h"
@@ -47,6 +48,20 @@ i386_linux_register_name (int reg)
return i386_register_name (reg);
}
+
+/* Return non-zero, when the register is in the corresponding register
+ group. Put the LINUX_ORIG_EAX register in the system group. */
+static int
+i386_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
+ struct reggroup *group)
+{
+ if (regnum == I386_LINUX_ORIG_EAX_REGNUM)
+ return (group == system_reggroup
+ || group == save_reggroup
+ || group == restore_reggroup);
+ return i386_register_reggroup_p (gdbarch, regnum, group);
+}
+
/* Recognizing signal handler frames. */
@@ -209,11 +224,17 @@ i386_linux_rt_sigtramp_start (CORE_ADDR pc)
static int
i386_linux_pc_in_sigtramp (CORE_ADDR pc, char *name)
{
- if (name)
- return STREQ ("__restore", name) || STREQ ("__restore_rt", name);
-
- return (i386_linux_sigtramp_start (pc) != 0
- || i386_linux_rt_sigtramp_start (pc) != 0);
+ /* If we have NAME, we can optimize the search. The trampolines are
+ named __restore and __restore_rt. However, they aren't dynamically
+ exported from the shared C library, so the trampoline may appear to
+ be part of the preceding function. This should always be sigaction,
+ __sigaction, or __libc_sigaction (all aliases to the same function). */
+ if (name == NULL || strstr (name, "sigaction") != NULL)
+ return (i386_linux_sigtramp_start (pc) != 0
+ || i386_linux_rt_sigtramp_start (pc) != 0);
+
+ return (strcmp ("__restore", name) == 0
+ || strcmp ("__restore_rt", name) == 0);
}
/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
@@ -436,6 +457,7 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_write_pc (gdbarch, i386_linux_write_pc);
set_gdbarch_num_regs (gdbarch, I386_SSE_NUM_REGS + 1);
set_gdbarch_register_name (gdbarch, i386_linux_register_name);
+ set_gdbarch_register_reggroup_p (gdbarch, i386_linux_register_reggroup_p);
set_gdbarch_register_bytes (gdbarch, I386_SSE_SIZEOF_REGS + 4);
tdep->jb_pc_offset = 20; /* From <bits/setjmp.h>. */
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 5a19308294f..d658e3ab26b 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -37,6 +37,7 @@
#include "doublest.h"
#include "value.h"
#include "gdb_assert.h"
+#include "reggroups.h"
#include "i386-tdep.h"
#include "i387-tdep.h"
@@ -70,11 +71,43 @@ static const int mmx_num_regs = (sizeof (i386_mmx_names)
#define MM0_REGNUM (NUM_REGS)
static int
-mmx_regnum_p (int reg)
+i386_mmx_regnum_p (int reg)
{
return (reg >= MM0_REGNUM && reg < MM0_REGNUM + mmx_num_regs);
}
+/* FP register? */
+
+int
+i386_fp_regnum_p (int regnum)
+{
+ return (regnum < NUM_REGS
+ && (FP0_REGNUM && FP0_REGNUM <= (regnum) && (regnum) < FPC_REGNUM));
+}
+
+int
+i386_fpc_regnum_p (int regnum)
+{
+ return (regnum < NUM_REGS
+ && (FPC_REGNUM <= (regnum) && (regnum) < XMM0_REGNUM));
+}
+
+/* SSE register? */
+
+int
+i386_sse_regnum_p (int regnum)
+{
+ return (regnum < NUM_REGS
+ && (XMM0_REGNUM <= (regnum) && (regnum) < MXCSR_REGNUM));
+}
+
+int
+i386_mxcsr_regnum_p (int regnum)
+{
+ return (regnum < NUM_REGS
+ && (regnum == MXCSR_REGNUM));
+}
+
/* Return the name of register REG. */
const char *
@@ -82,7 +115,7 @@ i386_register_name (int reg)
{
if (reg < 0)
return NULL;
- if (mmx_regnum_p (reg))
+ if (i386_mmx_regnum_p (reg))
return i386_mmx_names[reg - MM0_REGNUM];
if (reg >= sizeof (i386_register_names) / sizeof (*i386_register_names))
return NULL;
@@ -462,7 +495,7 @@ i386_get_frame_setup (CORE_ADDR pc)
/* Return non-zero if we're dealing with a frameless signal, that is,
a signal trampoline invoked from a frameless function. */
-static int
+int
i386_frameless_signal_p (struct frame_info *frame)
{
return (frame->next && frame->next->signal_handler_caller
@@ -535,8 +568,12 @@ static CORE_ADDR
i386_frame_saved_pc (struct frame_info *frame)
{
if (PC_IN_CALL_DUMMY (frame->pc, 0, 0))
- return deprecated_read_register_dummy (frame->pc, frame->frame,
- PC_REGNUM);
+ {
+ ULONGEST pc;
+
+ frame_unwind_unsigned_register (frame, PC_REGNUM, &pc);
+ return pc;
+ }
if (frame->signal_handler_caller)
return i386_sigtramp_saved_pc (frame);
@@ -834,7 +871,7 @@ i386_do_pop_frame (struct frame_info *frame)
if (addr)
{
read_memory (addr, regbuf, REGISTER_RAW_SIZE (regnum));
- write_register_gen (regnum, regbuf);
+ deprecated_write_register_gen (regnum, regbuf);
}
}
write_register (FP_REGNUM, read_memory_integer (fp, 4));
@@ -1039,25 +1076,17 @@ i386_store_return_value (struct type *type, struct regcache *regcache,
}
}
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR. */
+/* Extract from REGCACHE, which contains the (raw) register state, the
+ address in which a function should return its structure value, as a
+ CORE_ADDR. */
static CORE_ADDR
i386_extract_struct_value_address (struct regcache *regcache)
{
- /* NOTE: cagney/2002-08-12: Replaced a call to
- regcache_raw_read_as_address() with a call to
- regcache_cooked_read_unsigned(). The old, ...as_address function
- was eventually calling extract_unsigned_integer (via
- extract_address) to unpack the registers value. The below is
- doing an unsigned extract so that it is functionally equivalent.
- The read needs to be cooked as, otherwise, it will never
- correctly return the value of a register in the [NUM_REGS
- .. NUM_REGS+NUM_PSEUDO_REGS) range. */
- ULONGEST val;
- regcache_cooked_read_unsigned (regcache, LOW_RETURN_REGNUM, &val);
- return val;
+ ULONGEST addr;
+
+ regcache_raw_read_unsigned (regcache, LOW_RETURN_REGNUM, &addr);
+ return addr;
}
@@ -1102,13 +1131,13 @@ i386_register_virtual_type (int regnum)
if (regnum == PC_REGNUM || regnum == FP_REGNUM || regnum == SP_REGNUM)
return lookup_pointer_type (builtin_type_void);
- if (FP_REGNUM_P (regnum))
+ if (i386_fp_regnum_p (regnum))
return builtin_type_i387_ext;
- if (SSE_REGNUM_P (regnum))
+ if (i386_sse_regnum_p (regnum))
return builtin_type_vec128i;
- if (mmx_regnum_p (regnum))
+ if (i386_mmx_regnum_p (regnum))
return builtin_type_vec64i;
return builtin_type_int;
@@ -1135,7 +1164,7 @@ static void
i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
int regnum, void *buf)
{
- if (mmx_regnum_p (regnum))
+ if (i386_mmx_regnum_p (regnum))
{
char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
int fpnum = mmx_regnum_to_fp_regnum (regcache, regnum);
@@ -1151,7 +1180,7 @@ static void
i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int regnum, const void *buf)
{
- if (mmx_regnum_p (regnum))
+ if (i386_mmx_regnum_p (regnum))
{
char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
int fpnum = mmx_regnum_to_fp_regnum (regcache, regnum);
@@ -1175,7 +1204,7 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
static int
i386_register_convertible (int regnum)
{
- return FP_REGNUM_P (regnum);
+ return i386_fp_regnum_p (regnum);
}
/* Convert data from raw format for register REGNUM in buffer FROM to
@@ -1185,7 +1214,7 @@ static void
i386_register_convert_to_virtual (int regnum, struct type *type,
char *from, char *to)
{
- gdb_assert (FP_REGNUM_P (regnum));
+ gdb_assert (i386_fp_regnum_p (regnum));
/* We only support floating-point values. */
if (TYPE_CODE (type) != TYPE_CODE_FLT)
@@ -1208,7 +1237,7 @@ static void
i386_register_convert_to_raw (struct type *type, int regnum,
char *from, char *to)
{
- gdb_assert (FP_REGNUM_P (regnum));
+ gdb_assert (i386_fp_regnum_p (regnum));
/* We only support floating-point values. */
if (TYPE_CODE (type) != TYPE_CODE_FLT)
@@ -1415,6 +1444,56 @@ i386_nw_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
}
+/* i386 register groups. In addition to the normal groups, add "mmx"
+ and "sse". */
+
+static struct reggroup *i386_sse_reggroup;
+static struct reggroup *i386_mmx_reggroup;
+
+static void
+i386_init_reggroups (void)
+{
+ i386_sse_reggroup = reggroup_new ("sse", USER_REGGROUP);
+ i386_mmx_reggroup = reggroup_new ("mmx", USER_REGGROUP);
+}
+
+static void
+i386_add_reggroups (struct gdbarch *gdbarch)
+{
+ reggroup_add (gdbarch, i386_sse_reggroup);
+ reggroup_add (gdbarch, i386_mmx_reggroup);
+ reggroup_add (gdbarch, general_reggroup);
+ reggroup_add (gdbarch, float_reggroup);
+ reggroup_add (gdbarch, all_reggroup);
+ reggroup_add (gdbarch, save_reggroup);
+ reggroup_add (gdbarch, restore_reggroup);
+ reggroup_add (gdbarch, vector_reggroup);
+ reggroup_add (gdbarch, system_reggroup);
+}
+
+int
+i386_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
+ struct reggroup *group)
+{
+ int sse_regnum_p = (i386_sse_regnum_p (regnum)
+ || i386_mxcsr_regnum_p (regnum));
+ int fp_regnum_p = (i386_fp_regnum_p (regnum)
+ || i386_fpc_regnum_p (regnum));
+ int mmx_regnum_p = (i386_mmx_regnum_p (regnum));
+ if (group == i386_mmx_reggroup)
+ return mmx_regnum_p;
+ if (group == i386_sse_reggroup)
+ return sse_regnum_p;
+ if (group == vector_reggroup)
+ return (mmx_regnum_p || sse_regnum_p);
+ if (group == float_reggroup)
+ return fp_regnum_p;
+ if (group == general_reggroup)
+ return (!fp_regnum_p && !mmx_regnum_p && !sse_regnum_p);
+ return default_register_reggroup_p (gdbarch, regnum, group);
+}
+
+
static struct gdbarch *
i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
@@ -1573,6 +1652,10 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_print_insn (gdbarch, i386_print_insn);
+ /* Add the i386 register groups. */
+ i386_add_reggroups (gdbarch);
+ set_gdbarch_register_reggroup_p (gdbarch, i386_register_reggroup_p);
+
/* Hook in ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch, osabi);
@@ -1643,4 +1726,7 @@ are \"default\", \"pcc\" and \"reg\", and the default value is \"default\".",
i386_go32_init_abi);
gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_NETWARE,
i386_nw_init_abi);
+
+ /* Initialize the i386 specific register groups. */
+ i386_init_reggroups ();
}
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h
index 646001baa34..627cb0a974e 100644
--- a/gdb/i386-tdep.h
+++ b/gdb/i386-tdep.h
@@ -113,11 +113,10 @@ struct gdbarch_tdep
/* FPU opcode, bottom eleven bits. */
#define FOP_REGNUM (FPC_REGNUM + 7)
-/* Return non-zero if N corresponds to a FPU data registers. */
-#define FP_REGNUM_P(n) (FP0_REGNUM && FP0_REGNUM <= (n) && (n) < FPC_REGNUM)
-
-/* Return non-zero if N corresponds to a FPU control register. */
-#define FPC_REGNUM_P(n) (FPC_REGNUM <= (n) && (n) < XMM0_REGNUM)
+/* Return non-zero if REGNUM matches the FP register and the FP
+ register set is active. */
+extern int i386_fp_regnum_p (int regnum);
+extern int i386_fpc_regnum_p (int regnum);
/* SSE registers. */
@@ -128,17 +127,18 @@ struct gdbarch_tdep
#define MXCSR_REGNUM \
(XMM0_REGNUM + gdbarch_tdep (current_gdbarch)->num_xmm_regs)
-/* Return non-zero if N corresponds to a SSE data register. */
-#define SSE_REGNUM_P(n) (XMM0_REGNUM <= (n) && (n) < MXCSR_REGNUM)
+/* Return non-zero if REGNUM matches the SSE register and the SSE
+ register set is active. */
+extern int i386_sse_regnum_p (int regnum);
+extern int i386_mxcsr_regnum_p (int regnum);
/* FIXME: kettenis/2001-11-24: Obsolete macro's. */
#define FCS_REGNUM FISEG_REGNUM
#define FCOFF_REGNUM FIOFF_REGNUM
#define FDS_REGNUM FOSEG_REGNUM
#define FDOFF_REGNUM FOOFF_REGNUM
-#define IS_FP_REGNUM(n) FP_REGNUM_P (n)
-#define IS_FPU_CTRL_REGNUM(n) FPC_REGNUM_P (n)
-#define IS_SSE_REGNUM(n) SSE_REGNUM_P (n)
+#define IS_FP_REGNUM(n) i386_fp_regnum_p (n)
+#define IS_SSE_REGNUM(n) i386_sse_regnum_p (n)
#define I386_NUM_GREGS 16
#define I386_NUM_FREGS 16
@@ -162,10 +162,15 @@ struct gdbarch_tdep
/* Functions exported from i386-tdep.c. */
extern CORE_ADDR i386_pe_skip_trampoline_code (CORE_ADDR pc, char *name);
+extern int i386_frameless_signal_p (struct frame_info *frame);
/* Return the name of register REG. */
extern char const *i386_register_name (int reg);
+/* Return non-zero if REGNUM is a member of the specified group. */
+extern int i386_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
+ struct reggroup *group);
+
/* Initialize a basic ELF architecture variant. */
extern void i386_elf_init_abi (struct gdbarch_info, struct gdbarch *);
diff --git a/gdb/i386bsd-nat.c b/gdb/i386bsd-nat.c
index 8a3acd4cf58..ec38e135717 100644
--- a/gdb/i386bsd-nat.c
+++ b/gdb/i386bsd-nat.c
@@ -306,7 +306,7 @@ i386bsd_dr_set (int regnum, unsigned int value)
/* For some mysterious reason, some of the reserved bits in the
debug control register get set. Mask these off, otherwise the
ptrace call below will fail. */
- dbregs.dr7 &= ~(0x0000fc00);
+ DBREG_DRX ((&dbregs), 7) &= ~(0x0000fc00);
DBREG_DRX ((&dbregs), regnum) = value;
@@ -355,7 +355,7 @@ i386bsd_dr_get_status (void)
return 0;
#endif
- return dbregs.dr6;
+ return DBREG_DRX ((&dbregs), 6);
}
#endif /* PT_GETDBREGS */
@@ -400,11 +400,16 @@ _initialize_i386bsd_nat (void)
extern int i386fbsd4_sc_sp_offset;
#define SC_PC_OFFSET i386fbsd4_sc_pc_offset
#define SC_SP_OFFSET i386fbsd4_sc_sp_offset
-#elif defined (NetBSD) || defined (__NetBSD_Version__) || defined (OpenBSD)
+#elif defined (NetBSD) || defined (__NetBSD_Version__)
extern int i386nbsd_sc_pc_offset;
extern int i386nbsd_sc_sp_offset;
#define SC_PC_OFFSET i386nbsd_sc_pc_offset
#define SC_SP_OFFSET i386nbsd_sc_sp_offset
+#elif defined (OpenBSD)
+ extern int i386obsd_sc_pc_offset;
+ extern int i386obsd_sc_sp_offset;
+#define SC_PC_OFFSET i386obsd_sc_pc_offset
+#define SC_SP_OFFSET i386obsd_sc_sp_offset
#else
extern int i386bsd_sc_pc_offset;
extern int i386bsd_sc_sp_offset;
diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c
index 3fa99a34d88..4623e116cfc 100644
--- a/gdb/i386gnu-nat.c
+++ b/gdb/i386gnu-nat.c
@@ -184,7 +184,7 @@ store_fpregs (struct proc *thread, int regno)
}
/* FIXME: kettenis/2001-07-15: Is this right? Should we somehow
- take into account REGISTER_VALID like the old code did? */
+ take into account DEPRECATED_REGISTER_VALID like the old code did? */
i387_fill_fsave (state.hw_state, regno);
err = thread_set_state (thread->port, i386_FLOAT_STATE,
@@ -256,7 +256,7 @@ gnu_store_registers (int regno)
}
#define fill(state, regno) \
- memcpy (REG_ADDR(state, regno), &registers[REGISTER_BYTE (regno)], \
+ memcpy (REG_ADDR(state, regno), &deprecated_registers[REGISTER_BYTE (regno)], \
REGISTER_RAW_SIZE (regno))
if (regno == -1)
@@ -266,14 +266,14 @@ gnu_store_registers (int regno)
proc_debug (thread, "storing all registers");
for (i = 0; i < I386_NUM_GREGS; i++)
- if (register_valid[i])
+ if (deprecated_register_valid[i])
fill (state, i);
}
else
{
proc_debug (thread, "storing register %s", REGISTER_NAME (regno));
- gdb_assert (register_valid[regno]);
+ gdb_assert (deprecated_register_valid[regno]);
fill (state, regno);
}
diff --git a/gdb/i386obsd-nat.c b/gdb/i386obsd-nat.c
index 17ef922b82a..b2cdc2a7e58 100644
--- a/gdb/i386obsd-nat.c
+++ b/gdb/i386obsd-nat.c
@@ -44,16 +44,16 @@ _initialize_i386obsd_nat (void)
int mib[2];
size_t len;
- extern CORE_ADDR i386nbsd_sigtramp_start;
- extern CORE_ADDR i386nbsd_sigtramp_end;
+ extern CORE_ADDR i386obsd_sigtramp_start;
+ extern CORE_ADDR i386obsd_sigtramp_end;
mib[0] = CTL_VM;
mib[1] = VM_PSSTRINGS;
len = sizeof (_ps);
if (sysctl (mib, 2, &_ps, &len, NULL, 0) == 0)
{
- i386nbsd_sigtramp_start = (CORE_ADDR)_ps.val - 128;
- i386nbsd_sigtramp_end = (CORE_ADDR)_ps.val;
+ i386obsd_sigtramp_start = (CORE_ADDR)_ps.val - 128;
+ i386obsd_sigtramp_end = (CORE_ADDR)_ps.val;
}
}
#endif
diff --git a/gdb/i386obsd-tdep.c b/gdb/i386obsd-tdep.c
new file mode 100644
index 00000000000..7f162379a54
--- /dev/null
+++ b/gdb/i386obsd-tdep.c
@@ -0,0 +1,122 @@
+/* Target-dependent code for OpenBSD/i386.
+ Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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 "defs.h"
+#include "arch-utils.h"
+#include "gdbcore.h"
+#include "regcache.h"
+
+#include "i386-tdep.h"
+#include "i387-tdep.h"
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+void _initialize_i386obsd_tdep (void);
+
+#define SIZEOF_STRUCT_REG (16 * 4)
+
+static void
+i386obsd_supply_reg (char *regs, int regno)
+{
+ int i;
+
+ for (i = 0; i <= 15; i++)
+ if (regno == i || regno == -1)
+ supply_register (i, regs + i * 4);
+}
+
+static void
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
+ CORE_ADDR ignore)
+{
+ char *regs, *fsave;
+
+ /* We get everything from one section. */
+ if (which != 0)
+ return;
+
+ if (core_reg_size < (SIZEOF_STRUCT_REG + 108))
+ {
+ warning ("Wrong size register set in core file.");
+ return;
+ }
+
+ regs = core_reg_sect;
+ fsave = core_reg_sect + SIZEOF_STRUCT_REG;
+
+ /* Integer registers. */
+ i386obsd_supply_reg (regs, -1);
+
+ /* Floating point registers. */
+ i387_supply_fsave (fsave);
+}
+
+static struct core_fns i386obsd_core_fns =
+{
+ bfd_target_unknown_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_core_registers, /* core_read_registers */
+ NULL /* next */
+};
+
+
+CORE_ADDR i386obsd_sigtramp_start = 0xbfbfdf20;
+CORE_ADDR i386obsd_sigtramp_end = 0xbfbfdff0;
+
+/* From <machine/signal.h>. */
+int i386obsd_sc_pc_offset = 44;
+int i386obsd_sc_sp_offset = 56;
+
+static void
+i386obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ /* Obviously OpenBSD is BSD-based. */
+ i386bsd_init_abi (info, gdbarch);
+
+ /* OpenBSD uses -freg-struct-return by default. */
+ tdep->struct_return = reg_struct_return;
+
+ /* OpenBSD uses a different memory layout. */
+ tdep->sigtramp_start = i386obsd_sigtramp_start;
+ tdep->sigtramp_end = i386obsd_sigtramp_end;
+
+ /* OpenBSD has a `struct sigcontext' that's different from the
+ origional 4.3 BSD. */
+ tdep->sc_pc_offset = i386obsd_sc_pc_offset;
+ tdep->sc_sp_offset = i386obsd_sc_sp_offset;
+}
+
+void
+_initialize_i386obsd_tdep (void)
+{
+ add_core_fns (&i386obsd_core_fns);
+
+ /* FIXME: kettenis/20021020: Since OpenBSD/i386 binaries are
+ indistingushable from NetBSD/i386 a.out binaries, building a GDB
+ that should support both these targets will probably not work as
+ expected. */
+#define GDB_OSABI_OPENBSD_AOUT GDB_OSABI_NETBSD_AOUT
+
+ gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_OPENBSD_AOUT,
+ i386obsd_init_abi);
+}
diff --git a/gdb/i386v-nat.c b/gdb/i386v-nat.c
index 8180093c2ae..a6dc505a9e1 100644
--- a/gdb/i386v-nat.c
+++ b/gdb/i386v-nat.c
@@ -60,6 +60,8 @@
#include "floatformat.h"
#include "target.h"
+
+#include "i386-tdep.h"
/* Mapping between the general-purpose registers in `struct user'
@@ -83,7 +85,7 @@ register_u_addr (CORE_ADDR blockend, int regnum)
struct user u;
CORE_ADDR fpstate;
- if (FP_REGNUM_P (regnum))
+ if (i386_fp_regnum_p (regnum))
{
#ifdef KSTKSZ /* SCO, and others? */
blockend += 4 * (SS + 1) - KSTKSZ;
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index 3d4b39775fb..9b47e5827af 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -321,26 +321,35 @@ void
i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
struct frame_info *frame, const char *args)
{
- unsigned int fctrl;
- unsigned int fstat;
- unsigned int ftag;
- unsigned int fiseg;
- unsigned int fioff;
- unsigned int foseg;
- unsigned int fooff;
- unsigned int fop;
+ char buf[4];
+ ULONGEST fctrl;
+ ULONGEST fstat;
+ ULONGEST ftag;
+ ULONGEST fiseg;
+ ULONGEST fioff;
+ ULONGEST foseg;
+ ULONGEST fooff;
+ ULONGEST fop;
int fpreg;
int top;
- fctrl = read_register (FCTRL_REGNUM);
- fstat = read_register (FSTAT_REGNUM);
- ftag = read_register (FTAG_REGNUM);
- fiseg = read_register (FCS_REGNUM);
- fioff = read_register (FCOFF_REGNUM);
- foseg = read_register (FDS_REGNUM);
- fooff = read_register (FDOFF_REGNUM);
- fop = read_register (FOP_REGNUM);
-
+ frame_register_read (frame, FCTRL_REGNUM, buf);
+ fctrl = extract_unsigned_integer (buf, 4);
+ frame_register_read (frame, FSTAT_REGNUM, buf);
+ fstat = extract_unsigned_integer (buf, 4);
+ frame_register_read (frame, FTAG_REGNUM, buf);
+ ftag = extract_unsigned_integer (buf, 4);
+ frame_register_read (frame, FISEG_REGNUM, buf);
+ fiseg = extract_unsigned_integer (buf, 4);
+ frame_register_read (frame, FIOFF_REGNUM, buf);
+ fioff = extract_unsigned_integer (buf, 4);
+ frame_register_read (frame, FOSEG_REGNUM, buf);
+ foseg = extract_unsigned_integer (buf, 4);
+ frame_register_read (frame, FOOFF_REGNUM, buf);
+ fooff = extract_unsigned_integer (buf, 4);
+ frame_register_read (frame, FOP_REGNUM, buf);
+ fop = extract_unsigned_integer (buf, 4);
+
top = ((fstat >> 11) & 7);
for (fpreg = 7; fpreg >= 0; fpreg--)
@@ -367,7 +376,7 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
break;
}
- read_register_gen ((fpreg + 8 - top) % 8 + FP0_REGNUM, raw);
+ frame_register_read (frame, (fpreg + 8 - top) % 8 + FP0_REGNUM, raw);
fputs_filtered ("0x", file);
for (i = 9; i >= 0; i--)
@@ -379,7 +388,7 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
fputs_filtered ("\n", file);
}
- puts_filtered ("\n");
+ fputs_filtered ("\n", file);
print_i387_status_word (fstat, file);
print_i387_control_word (fctrl, file);
@@ -435,6 +444,12 @@ static int fsave_offset[] =
void
i387_supply_register (int regnum, char *fsave)
{
+ if (fsave == NULL)
+ {
+ supply_register (regnum, NULL);
+ return;
+ }
+
/* Most of the FPU control registers occupy only 16 bits in
the fsave area. Give those a special treatment. */
if (regnum >= FPC_REGNUM
@@ -555,6 +570,12 @@ i387_supply_fxsave (char *fxsave)
for (i = FP0_REGNUM; i <= last_regnum; i++)
{
+ if (fxsave == NULL)
+ {
+ supply_register (i, NULL);
+ continue;
+ }
+
/* Most of the FPU control registers occupy only 16 bits in
the fxsave area. Give those a special treatment. */
if (i >= FPC_REGNUM && i < XMM0_REGNUM
@@ -621,7 +642,7 @@ i387_fill_fxsave (char *fxsave, int regnum)
/* Most of the FPU control registers occupy only 16 bits in
the fxsave area. Give those a special treatment. */
if (i >= FPC_REGNUM && i < XMM0_REGNUM
- && i != FIOFF_REGNUM && i != FDOFF_REGNUM)
+ && i != FIOFF_REGNUM && i != FOOFF_REGNUM)
{
unsigned char buf[4];
diff --git a/gdb/ia64-aix-nat.c b/gdb/ia64-aix-nat.c
index c41cc7cc88c..c94144c402f 100644
--- a/gdb/ia64-aix-nat.c
+++ b/gdb/ia64-aix-nat.c
@@ -71,11 +71,11 @@ supply_gregset (prgregset_t *gregsetp)
by other means. Those that aren't are already handled by the
code above. */
for (regi = IA64_GR32_REGNUM; regi <= IA64_GR127_REGNUM; regi++)
- register_valid[regi] = 1;
+ deprecated_register_valid[regi] = 1;
for (regi = IA64_PR0_REGNUM; regi <= IA64_PR63_REGNUM; regi++)
- register_valid[regi] = 1;
+ deprecated_register_valid[regi] = 1;
for (regi = IA64_VFP_REGNUM; regi <= NUM_REGS; regi++)
- register_valid[regi] = 1;
+ deprecated_register_valid[regi] = 1;
}
void
@@ -85,7 +85,7 @@ fill_gregset (prgregset_t *gregsetp, int regno)
#define COPY_REG(_fld_,_regi_) \
if ((regno == -1) || regno == _regi_) \
- memcpy (&(gregsetp->_fld_), &registers[REGISTER_BYTE (_regi_)], \
+ memcpy (&(gregsetp->_fld_), &deprecated_registers[REGISTER_BYTE (_regi_)], \
REGISTER_RAW_SIZE (_regi_))
for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
@@ -108,10 +108,10 @@ fill_gregset (prgregset_t *gregsetp, int regno)
if (regno == IA64_BSP_REGNUM || regno == -1)
{
memcpy (&(gregsetp->__bspstore),
- &registers[REGISTER_BYTE (IA64_BSP_REGNUM)],
+ &deprecated_registers[REGISTER_BYTE (IA64_BSP_REGNUM)],
REGISTER_RAW_SIZE (IA64_BSP_REGNUM));
- memcpy (&registers[REGISTER_BYTE (IA64_BSPSTORE_REGNUM)],
- &registers[REGISTER_BYTE (IA64_BSP_REGNUM)],
+ memcpy (&deprecated_registers[REGISTER_BYTE (IA64_BSPSTORE_REGNUM)],
+ &deprecated_registers[REGISTER_BYTE (IA64_BSP_REGNUM)],
REGISTER_RAW_SIZE (IA64_BSP_REGNUM));
}
@@ -153,7 +153,7 @@ fill_fpregset (prfpregset_t *fpregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- from = (char *) &registers[REGISTER_BYTE (regi)];
+ from = (char *) &deprecated_registers[REGISTER_BYTE (regi)];
to = (char *) &(fpregsetp->__fpr[regi - IA64_FR0_REGNUM]);
memcpy (to, from, REGISTER_RAW_SIZE (regi));
}
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index 82695ef57ae..76b8235b4f9 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -400,7 +400,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
#define COPY_REG(_idx_,_regi_) \
if ((regno == -1) || regno == _regi_) \
- memcpy (regp + _idx_, &registers[REGISTER_BYTE (_regi_)], \
+ memcpy (regp + _idx_, &deprecated_registers[REGISTER_BYTE (_regi_)], \
REGISTER_RAW_SIZE (_regi_))
for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
@@ -465,7 +465,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- from = (char *) &registers[REGISTER_BYTE (regi)];
+ from = (char *) &deprecated_registers[REGISTER_BYTE (regi)];
to = (char *) &((*fpregsetp)[regi - IA64_FR0_REGNUM]);
memcpy (to, from, REGISTER_RAW_SIZE (regi));
}
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 53f21a46b1f..59c7c73df65 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -1375,8 +1375,8 @@ ia64_get_saved_register (char *raw_buffer,
+ ((regnum - IA64_FR32_REGNUM) + rrb_fr) % 96;
}
- generic_get_saved_register (raw_buffer, optimized, addrp, frame,
- regnum, lval);
+ deprecated_generic_get_saved_register (raw_buffer, optimized, addrp,
+ frame, regnum, lval);
}
}
@@ -1902,7 +1902,7 @@ ia64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
float_elt_type,
floatreg,
VALUE_CONTENTS (arg) + argoffset,
- &registers[REGISTER_BYTE (floatreg)]);
+ &deprecated_registers[REGISTER_BYTE (floatreg)]);
floatreg++;
argoffset += TYPE_LENGTH (float_elt_type);
len -= TYPE_LENGTH (float_elt_type);
@@ -1913,7 +1913,7 @@ ia64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* Store the struct return value in r8 if necessary. */
if (struct_return)
{
- store_address (&registers[REGISTER_BYTE (IA64_GR8_REGNUM)],
+ store_address (&deprecated_registers[REGISTER_BYTE (IA64_GR8_REGNUM)],
REGISTER_RAW_SIZE (IA64_GR8_REGNUM),
struct_addr);
}
@@ -1954,12 +1954,12 @@ ia64_store_return_value (struct type *type, char *valbuf)
if (TYPE_CODE (type) == TYPE_CODE_FLT)
{
ia64_register_convert_to_raw (type, IA64_FR8_REGNUM, valbuf,
- &registers[REGISTER_BYTE (IA64_FR8_REGNUM)]);
+ &deprecated_registers[REGISTER_BYTE (IA64_FR8_REGNUM)]);
target_store_registers (IA64_FR8_REGNUM);
}
else
- write_register_bytes (REGISTER_BYTE (IA64_GR8_REGNUM),
- valbuf, TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (IA64_GR8_REGNUM),
+ valbuf, TYPE_LENGTH (type));
}
void
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index a36258152c7..2556221f29d 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -41,6 +41,8 @@
#include "event-top.h"
#include "parser-defs.h"
#include "regcache.h"
+#include "reggroups.h"
+#include <ctype.h>
/* Functions exported for general use, in inferior.h: */
@@ -983,7 +985,7 @@ run_stack_dummy (CORE_ADDR addr, struct regcache *buffer)
struct breakpoint *bpt;
struct symtab_and_line sal;
- INIT_SAL (&sal); /* initialize to zeroes */
+ init_sal (&sal); /* initialize to zeroes */
if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
{
sal.pc = CALL_DUMMY_ADDRESS ();
@@ -1571,10 +1573,9 @@ default_print_registers_info (struct gdbarch *gdbarch,
char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
- /* FIXME: cagney/2002-03-08: This should be deprecated. */
- if (DO_REGISTERS_INFO_P ())
+ if (DEPRECATED_DO_REGISTERS_INFO_P ())
{
- DO_REGISTERS_INFO (regnum, print_all);
+ DEPRECATED_DO_REGISTERS_INFO (regnum, print_all);
return;
}
@@ -1584,11 +1585,14 @@ default_print_registers_info (struct gdbarch *gdbarch,
specific reg. */
if (regnum == -1)
{
- if (!print_all)
+ if (print_all)
{
- if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
+ if (!gdbarch_register_reggroup_p (gdbarch, i, all_reggroup))
continue;
- if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)))
+ }
+ else
+ {
+ if (!gdbarch_register_reggroup_p (gdbarch, i, general_reggroup))
continue;
}
}
@@ -1664,12 +1668,6 @@ default_print_registers_info (struct gdbarch *gdbarch,
}
}
- /* The SPARC wants to print even-numbered float regs as doubles
- in addition to printing them as floats. */
-#ifdef PRINT_REGISTER_HOOK
- PRINT_REGISTER_HOOK (i);
-#endif
-
fprintf_filtered (file, "\n");
}
}
@@ -1692,35 +1690,89 @@ registers_info (char *addr_exp, int fpregs)
return;
}
- do
+ while (*addr_exp != '\0')
{
- if (addr_exp[0] == '$')
- addr_exp++;
- end = addr_exp;
- while (*end != '\0' && *end != ' ' && *end != '\t')
- ++end;
- numregs = NUM_REGS + NUM_PSEUDO_REGS;
+ char *start;
+ const char *end;
- regnum = frame_map_name_to_regnum (addr_exp, end - addr_exp);
- if (regnum >= 0)
- goto found;
-
- regnum = numregs;
+ /* Keep skipping leading white space. */
+ if (isspace ((*addr_exp)))
+ {
+ addr_exp++;
+ continue;
+ }
- if (*addr_exp >= '0' && *addr_exp <= '9')
- regnum = atoi (addr_exp); /* Take a number */
- if (regnum >= numregs) /* Bad name, or bad number */
- error ("%.*s: invalid register", (int) (end - addr_exp), addr_exp);
+ /* Discard any leading ``$''. Check that there is something
+ resembling a register following it. */
+ if (addr_exp[0] == '$')
+ addr_exp++;
+ if (isspace ((*addr_exp)) || (*addr_exp) == '\0')
+ error ("Missing register name");
- found:
- gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
- selected_frame, regnum, fpregs);
+ /* Find the start/end of this register name/num/group. */
+ start = addr_exp;
+ while ((*addr_exp) != '\0' && !isspace ((*addr_exp)))
+ addr_exp++;
+ end = addr_exp;
+
+ /* Figure out what we've found and display it. */
+
+ /* A register name? */
+ {
+ int regnum = frame_map_name_to_regnum (start, end - start);
+ if (regnum >= 0)
+ {
+ gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
+ selected_frame, regnum, fpregs);
+ continue;
+ }
+ }
+
+ /* A register number? (how portable is this one?). */
+ {
+ char *endptr;
+ int regnum = strtol (start, &endptr, 0);
+ if (endptr == end
+ && regnum >= 0
+ && regnum < NUM_REGS + NUM_PSEUDO_REGS)
+ {
+ gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
+ selected_frame, regnum, fpregs);
+ continue;
+ }
+ }
+
+ /* A register group? */
+ {
+ struct reggroup *const *group;
+ for (group = reggroups (current_gdbarch);
+ (*group) != NULL;
+ group++)
+ {
+ /* Don't bother with a length check. Should the user
+ enter a short register group name, go with the first
+ group that matches. */
+ if (strncmp (start, reggroup_name ((*group)), end - start) == 0)
+ break;
+ }
+ if ((*group) != NULL)
+ {
+ int regnum;
+ for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
+ {
+ if (gdbarch_register_reggroup_p (current_gdbarch, regnum,
+ (*group)))
+ gdbarch_print_registers_info (current_gdbarch,
+ gdb_stdout, selected_frame,
+ regnum, fpregs);
+ }
+ continue;
+ }
+ }
- addr_exp = end;
- while (*addr_exp == ' ' || *addr_exp == '\t')
- ++addr_exp;
+ /* Nothing matched. */
+ error ("Invalid register `%.*s'", (int) (end - start), start);
}
- while (*addr_exp != '\0');
}
void
@@ -1739,6 +1791,11 @@ static void
print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
struct frame_info *frame, const char *args)
{
+ if (!target_has_registers)
+ error ("The program has no registers now.");
+ if (selected_frame == NULL)
+ error ("No selected frame.");
+
if (gdbarch_print_vector_info_p (gdbarch))
gdbarch_print_vector_info (gdbarch, file, frame, args);
else
@@ -1746,14 +1803,9 @@ print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
int regnum;
int printed_something = 0;
- if (!target_has_registers)
- error ("The program has no registers now.");
- if (selected_frame == NULL)
- error ("No selected frame.");
-
for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
{
- if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (regnum)))
+ if (gdbarch_register_reggroup_p (gdbarch, regnum, vector_reggroup))
{
printed_something = 1;
gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
@@ -1906,6 +1958,11 @@ static void
print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
struct frame_info *frame, const char *args)
{
+ if (!target_has_registers)
+ error ("The program has no registers now.");
+ if (selected_frame == NULL)
+ error ("No selected frame.");
+
if (gdbarch_print_float_info_p (gdbarch))
gdbarch_print_float_info (gdbarch, file, frame, args);
else
@@ -1919,14 +1976,9 @@ print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
int regnum;
int printed_something = 0;
- if (!target_has_registers)
- error ("The program has no registers now.");
- if (selected_frame == NULL)
- error ("No selected frame.");
-
for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
{
- if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
+ if (gdbarch_register_reggroup_p (gdbarch, regnum, float_reggroup))
{
printed_something = 1;
gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
diff --git a/gdb/infptrace.c b/gdb/infptrace.c
index 777a5b491ed..601e157c8ef 100644
--- a/gdb/infptrace.c
+++ b/gdb/infptrace.c
@@ -514,6 +514,37 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
PTRACE_XFER_TYPE *buffer;
struct cleanup *old_chain = NULL;
+#ifdef PT_IO
+ /* OpenBSD 3.1, NetBSD 1.6 and FreeBSD 5.0 have a new PT_IO request
+ that promises to be much more efficient in reading and writing
+ data in the traced process's address space. */
+
+ {
+ struct ptrace_io_desc piod;
+
+ /* NOTE: We assume that there are no distinct address spaces for
+ instruction and data. */
+ piod.piod_op = write ? PIOD_WRITE_D : PIOD_READ_D;
+ piod.piod_offs = (void *) memaddr;
+ piod.piod_addr = myaddr;
+ piod.piod_len = len;
+
+ if (ptrace (PT_IO, PIDGET (inferior_ptid), (caddr_t) &piod, 0) == -1)
+ {
+ /* If the PT_IO request is somehow not supported, fallback on
+ using PT_WRITE_D/PT_READ_D. Otherwise we will return zero
+ to indicate failure. */
+ if (errno != EINVAL)
+ return 0;
+ }
+ else
+ {
+ /* Return the actual number of bytes read or written. */
+ return piod.piod_len;
+ }
+ }
+#endif
+
/* Allocate buffer of that many longwords. */
if (len < GDB_MAX_ALLOCA)
{
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 89a1d23a458..88c59c58fd7 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -231,13 +231,6 @@ a command like `return' or `jump' to continue execution.");
#define HAVE_STEPPABLE_WATCHPOINT 1
#endif
-#ifndef HAVE_NONSTEPPABLE_WATCHPOINT
-#define HAVE_NONSTEPPABLE_WATCHPOINT 0
-#else
-#undef HAVE_NONSTEPPABLE_WATCHPOINT
-#define HAVE_NONSTEPPABLE_WATCHPOINT 1
-#endif
-
#ifndef HAVE_CONTINUABLE_WATCHPOINT
#define HAVE_CONTINUABLE_WATCHPOINT 0
#else
@@ -2610,7 +2603,7 @@ process_event_stop_test:
/* Set up a step-resume breakpoint at the address
indicated by SKIP_SOLIB_RESOLVER. */
struct symtab_and_line sr_sal;
- INIT_SAL (&sr_sal);
+ init_sal (&sr_sal);
sr_sal.pc = pc_after_resolver;
check_for_old_step_resume_breakpoint ();
@@ -2663,7 +2656,7 @@ process_event_stop_test:
breakpoint even though the signal happened. */
struct symtab_and_line sr_sal;
- INIT_SAL (&sr_sal);
+ init_sal (&sr_sal);
sr_sal.symtab = NULL;
sr_sal.line = 0;
sr_sal.pc = prev_pc;
@@ -2776,7 +2769,7 @@ process_event_stop_test:
struct symtab_and_line xxx;
/* Why isn't this s_a_l called "sr_sal", like all of the
other s_a_l's where this code is duplicated? */
- INIT_SAL (&xxx); /* initialize to zeroes */
+ init_sal (&xxx); /* initialize to zeroes */
xxx.pc = tmp;
xxx.section = find_pc_overlay (xxx.pc);
check_for_old_step_resume_breakpoint ();
@@ -2851,7 +2844,7 @@ process_event_stop_test:
/* And put the step-breakpoint there and go until there. */
struct symtab_and_line sr_sal;
- INIT_SAL (&sr_sal); /* initialize to zeroes */
+ init_sal (&sr_sal); /* initialize to zeroes */
sr_sal.pc = tmp;
sr_sal.section = find_pc_overlay (sr_sal.pc);
/* Do not specify what the fp should be when we stop
@@ -2967,7 +2960,7 @@ check_sigtramp2 (struct execution_control_state *ecs)
struct symtab_and_line sr_sal;
- INIT_SAL (&sr_sal); /* initialize to zeroes */
+ init_sal (&sr_sal); /* initialize to zeroes */
sr_sal.pc = prev_pc;
sr_sal.section = find_pc_overlay (sr_sal.pc);
/* We perhaps could set the frame if we kept track of what the
@@ -3023,7 +3016,7 @@ step_into_function (struct execution_control_state *ecs)
else
{
/* Put the step-breakpoint there and go until there. */
- INIT_SAL (&sr_sal); /* initialize to zeroes */
+ init_sal (&sr_sal); /* initialize to zeroes */
sr_sal.pc = ecs->stop_func_start;
sr_sal.section = find_pc_overlay (ecs->stop_func_start);
/* Do not specify what the fp should be when we stop since on
@@ -3058,7 +3051,7 @@ step_over_function (struct execution_control_state *ecs)
{
struct symtab_and_line sr_sal;
- INIT_SAL (&sr_sal); /* initialize to zeros */
+ init_sal (&sr_sal); /* initialize to zeros */
sr_sal.pc = ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
sr_sal.section = find_pc_overlay (sr_sal.pc);
diff --git a/gdb/irix4-nat.c b/gdb/irix4-nat.c
index 0f447767af2..2283887a6f9 100644
--- a/gdb/irix4-nat.c
+++ b/gdb/irix4-nat.c
@@ -77,19 +77,19 @@ fill_gregset (gregset_t *gregsetp, int regno)
/* same FIXME as above wrt 32 */
for (regi = 0; regi < 32; regi++)
if ((regno == -1) || (regno == regi))
- *(regp + regi) = *(greg_t *) & registers[REGISTER_BYTE (regi)];
+ *(regp + regi) = *(greg_t *) & deprecated_registers[REGISTER_BYTE (regi)];
if ((regno == -1) || (regno == PC_REGNUM))
- gregsetp->gp_pc = *(greg_t *) & registers[REGISTER_BYTE (PC_REGNUM)];
+ gregsetp->gp_pc = *(greg_t *) & deprecated_registers[REGISTER_BYTE (PC_REGNUM)];
if ((regno == -1) || (regno == CAUSE_REGNUM))
- gregsetp->gp_cause = *(greg_t *) & registers[REGISTER_BYTE (CAUSE_REGNUM)];
+ gregsetp->gp_cause = *(greg_t *) & deprecated_registers[REGISTER_BYTE (CAUSE_REGNUM)];
if ((regno == -1) || (regno == HI_REGNUM))
- gregsetp->gp_mdhi = *(greg_t *) & registers[REGISTER_BYTE (HI_REGNUM)];
+ gregsetp->gp_mdhi = *(greg_t *) & deprecated_registers[REGISTER_BYTE (HI_REGNUM)];
if ((regno == -1) || (regno == LO_REGNUM))
- gregsetp->gp_mdlo = *(greg_t *) & registers[REGISTER_BYTE (LO_REGNUM)];
+ gregsetp->gp_mdlo = *(greg_t *) & deprecated_registers[REGISTER_BYTE (LO_REGNUM)];
}
/*
@@ -127,14 +127,14 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- from = (char *) &registers[REGISTER_BYTE (regi)];
+ from = (char *) &deprecated_registers[REGISTER_BYTE (regi)];
to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
memcpy (to, from, REGISTER_RAW_SIZE (regi));
}
}
if ((regno == -1) || (regno == FCRCS_REGNUM))
- fpregsetp->fp_csr = *(unsigned *) &registers[REGISTER_BYTE (FCRCS_REGNUM)];
+ fpregsetp->fp_csr = *(unsigned *) &deprecated_registers[REGISTER_BYTE (FCRCS_REGNUM)];
}
@@ -184,7 +184,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
return;
}
- memcpy ((char *) registers, core_reg_sect, core_reg_size);
+ memcpy ((char *) deprecated_registers, core_reg_sect, core_reg_size);
}
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c
index d5b5c0c1c4d..9e4f2100f66 100644
--- a/gdb/irix5-nat.c
+++ b/gdb/irix5-nat.c
@@ -83,27 +83,27 @@ fill_gregset (gregset_t *gregsetp, int regno)
for (regi = 0; regi <= CTX_RA; regi++)
if ((regno == -1) || (regno == regi))
*(regp + regi) =
- extract_signed_integer (&registers[REGISTER_BYTE (regi)],
+ extract_signed_integer (&deprecated_registers[REGISTER_BYTE (regi)],
REGISTER_RAW_SIZE (regi));
if ((regno == -1) || (regno == PC_REGNUM))
*(regp + CTX_EPC) =
- extract_signed_integer (&registers[REGISTER_BYTE (PC_REGNUM)],
+ extract_signed_integer (&deprecated_registers[REGISTER_BYTE (PC_REGNUM)],
REGISTER_RAW_SIZE (PC_REGNUM));
if ((regno == -1) || (regno == CAUSE_REGNUM))
*(regp + CTX_CAUSE) =
- extract_signed_integer (&registers[REGISTER_BYTE (CAUSE_REGNUM)],
+ extract_signed_integer (&deprecated_registers[REGISTER_BYTE (CAUSE_REGNUM)],
REGISTER_RAW_SIZE (CAUSE_REGNUM));
if ((regno == -1) || (regno == HI_REGNUM))
*(regp + CTX_MDHI) =
- extract_signed_integer (&registers[REGISTER_BYTE (HI_REGNUM)],
+ extract_signed_integer (&deprecated_registers[REGISTER_BYTE (HI_REGNUM)],
REGISTER_RAW_SIZE (HI_REGNUM));
if ((regno == -1) || (regno == LO_REGNUM))
*(regp + CTX_MDLO) =
- extract_signed_integer (&registers[REGISTER_BYTE (LO_REGNUM)],
+ extract_signed_integer (&deprecated_registers[REGISTER_BYTE (LO_REGNUM)],
REGISTER_RAW_SIZE (LO_REGNUM));
}
@@ -145,14 +145,14 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- from = (char *) &registers[REGISTER_BYTE (regi)];
+ from = (char *) &deprecated_registers[REGISTER_BYTE (regi)];
to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
memcpy (to, from, REGISTER_RAW_SIZE (regi));
}
}
if ((regno == -1) || (regno == FCRCS_REGNUM))
- fpregsetp->fp_csr = *(unsigned *) &registers[REGISTER_BYTE (FCRCS_REGNUM)];
+ fpregsetp->fp_csr = *(unsigned *) &deprecated_registers[REGISTER_BYTE (FCRCS_REGNUM)];
}
@@ -198,7 +198,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
{
if (core_reg_size == REGISTER_BYTES)
{
- memcpy ((char *) registers, core_reg_sect, core_reg_size);
+ memcpy ((char *) deprecated_registers, core_reg_sect, core_reg_size);
}
else if (MIPS_REGSIZE == 4 &&
core_reg_size == (2 * MIPS_REGSIZE) * NUM_REGS)
@@ -206,7 +206,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
/* This is a core file from a N32 executable, 64 bits are saved
for all registers. */
char *srcp = core_reg_sect;
- char *dstp = registers;
+ char *dstp = deprecated_registers;
int regno;
for (regno = 0; regno < NUM_REGS; regno++)
@@ -250,7 +250,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
return;
}
- registers_fetched ();
+ deprecated_registers_fetched ();
}
/* Register that we are able to handle irix5 core file formats.
diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y
index 70c228b9575..b4ae3401ea4 100644
--- a/gdb/jv-exp.y
+++ b/gdb/jv-exp.y
@@ -179,7 +179,7 @@ static int parse_number (char *, int, int, YYSTYPE *);
%token <opcode> ASSIGN_MODIFY
-%token THIS SUPER NEW
+%token SUPER NEW
%left ','
%right '=' ASSIGN_MODIFY
@@ -365,9 +365,6 @@ Primary:
PrimaryNoNewArray:
Literal
-| THIS
- { write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (OP_THIS); }
| '(' Expression ')'
| ClassInstanceCreationExpression
| FieldAccess
@@ -1167,17 +1164,6 @@ yylex ()
yylval.lval = 1;
return BOOLEAN_LITERAL;
}
- if (current_language->la_language == language_cplus
- && STREQN (tokstart, "this", 4))
- {
- static const char this_name[] =
- { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' };
-
- if (lookup_symbol (this_name, expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
- (struct symtab **) NULL))
- return THIS;
- }
break;
case 3:
if (STREQN (tokstart, "int", 3))
diff --git a/gdb/language.c b/gdb/language.c
index dc94ebdd8c3..8eee8f6d4a5 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -549,6 +549,7 @@ binop_result_type (struct value *v1, struct value *v2)
{
case language_c:
case language_cplus:
+ case language_objc:
if (TYPE_CODE (t1) == TYPE_CODE_FLT)
return TYPE_CODE (t2) == TYPE_CODE_FLT && l2 > l1 ?
VALUE_TYPE (v2) : VALUE_TYPE (v1);
@@ -786,6 +787,7 @@ integral_type (struct type *type)
{
case language_c:
case language_cplus:
+ case language_objc:
return (TYPE_CODE (type) != TYPE_CODE_INT) &&
(TYPE_CODE (type) != TYPE_CODE_ENUM) ? 0 : 1;
case language_m2:
@@ -828,6 +830,7 @@ character_type (struct type *type)
case language_c:
case language_cplus:
+ case language_objc:
return (TYPE_CODE (type) == TYPE_CODE_INT) &&
TYPE_LENGTH (type) == sizeof (char)
? 1 : 0;
@@ -850,6 +853,7 @@ string_type (struct type *type)
case language_c:
case language_cplus:
+ case language_objc:
/* C does not have distinct string type. */
return (0);
default:
@@ -868,6 +872,7 @@ boolean_type (struct type *type)
{
case language_c:
case language_cplus:
+ case language_objc:
/* Might be more cleanly handled by having a
TYPE_CODE_INT_NOT_BOOL for (OBSOLETE) CHILL and such
languages, or a TYPE_CODE_INT_OR_BOOL for C. */
@@ -904,6 +909,7 @@ structured_type (struct type *type)
{
case language_c:
case language_cplus:
+ case language_objc:
return (TYPE_CODE (type) == TYPE_CODE_STRUCT) ||
(TYPE_CODE (type) == TYPE_CODE_UNION) ||
(TYPE_CODE (type) == TYPE_CODE_ARRAY);
@@ -1124,6 +1130,7 @@ binop_type_check (struct value *arg1, struct value *arg2, int op)
#ifdef _LANG_c
case language_c:
case language_cplus:
+ case language_objc:
switch (op)
{
case BINOP_DIV:
diff --git a/gdb/language.h b/gdb/language.h
index 67a8ff26afe..b15544fead9 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -288,7 +288,8 @@ language_mode;
/* "cast" really means conversion */
/* FIXME -- should be a setting in language_defn */
#define CAST_IS_CONVERSION (current_language->la_language == language_c || \
- current_language->la_language == language_cplus)
+ current_language->la_language == language_cplus || \
+ current_language->la_language == language_objc)
extern void language_info (int);
diff --git a/gdb/lin-lwp.c b/gdb/lin-lwp.c
index cd577fbe3a0..4b9d57d0320 100644
--- a/gdb/lin-lwp.c
+++ b/gdb/lin-lwp.c
@@ -579,11 +579,8 @@ lin_lwp_resume (ptid_t ptid, int step, enum target_signal signo)
struct lwp_info *lp;
int resume_all;
- /* Apparently the interpretation of PID is dependent on STEP: If
- STEP is non-zero, a specific PID means `step only this process
- id'. But if STEP is zero, then PID means `continue *all*
- processes, but give the signal only to this one'. */
- resume_all = (PIDGET (ptid) == -1) || !step;
+ /* A specific PTID means `step only this process id'. */
+ resume_all = (PIDGET (ptid) == -1);
if (resume_all)
iterate_over_lwps (resume_set_callback, NULL);
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 5631fd31433..1f7cab22dfd 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -31,11 +31,7 @@
#include "value.h"
#include "completer.h"
#include "cp-abi.h"
-
-/* Prototype for one function in parser-defs.h,
- instead of including that entire file. */
-
-extern char *find_template_name_end (char *);
+#include "parser-defs.h"
/* We share this one with symtab.c, but it is not exported widely. */
@@ -43,6 +39,13 @@ extern char *operator_chars (char *, char **);
/* Prototypes for local functions */
+static void initialize_defaults (struct symtab **default_symtab,
+ int *default_line);
+
+static void set_flags (char *arg, int *is_quoted, char **paren_pointer);
+
+static struct symtabs_and_lines decode_indirect (char **argptr);
+
static void cplusplus_error (const char *name, const char *fmt, ...) ATTR_FORMAT (printf, 2, 3);
static int total_number_of_methods (struct type *type);
@@ -57,6 +60,18 @@ static char *find_toplevel_char (char *s, char c);
static struct symtabs_and_lines decode_line_2 (struct symbol *[],
int, int, char ***);
+static struct
+symtabs_and_lines symbol_found (int funfirstline,
+ char ***canonical,
+ char *copy,
+ struct symbol *sym,
+ struct symtab *s,
+ struct symtab *sym_symtab);
+
+static struct
+symtabs_and_lines minsym_found (int funfirstline,
+ struct minimal_symbol *msymbol);
+
/* Helper functions. */
/* Issue a helpful hint on using the command completion feature on
@@ -371,8 +386,8 @@ decode_line_2 (struct symbol *sym_arr[], int nelts, int funfirstline,
printf_unfiltered ("[0] cancel\n[1] all\n");
while (i < nelts)
{
- INIT_SAL (&return_values.sals[i]); /* initialize to zeroes */
- INIT_SAL (&values.sals[i]);
+ init_sal (&return_values.sals[i]); /* initialize to zeroes */
+ init_sal (&values.sals[i]);
if (sym_arr[i] && SYMBOL_CLASS (sym_arr[i]) == LOC_BLOCK)
{
values.sals[i] = find_function_start_sal (sym_arr[i], funfirstline);
@@ -515,7 +530,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
struct symtabs_and_lines values;
struct symtab_and_line val;
register char *p, *p1;
- char *q, *pp, *ii, *p2;
+ char *q, *ii, *p2;
#if 0
char *q1;
#endif
@@ -525,94 +540,41 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
/* The symtab that SYM was found in. */
struct symtab *sym_symtab;
- register CORE_ADDR pc;
register struct minimal_symbol *msymbol;
char *copy;
struct symbol *sym_class;
int i1;
+ /* This is NULL if there are no parens in *ARGPTR, or a pointer to
+ the closing parenthesis if there are parens. */
+ char *paren_pointer;
+ /* This says whether or not something in *ARGPTR is quoted with
+ completer_quotes (i.e. with single quotes). */
int is_quoted;
int is_quote_enclosed;
- int has_parens;
- int has_if = 0;
int has_comma = 0;
struct symbol **sym_arr;
struct type *t;
char *saved_arg = *argptr;
extern char *gdb_completer_quote_characters;
- INIT_SAL (&val); /* initialize to zeroes */
+ init_sal (&val); /* initialize to zeroes */
/* Defaults have defaults. */
- if (default_symtab == 0)
- {
- /* Use whatever we have for the default source line. We don't use
- get_current_or_default_symtab_and_line as it can recurse and call
- us back! */
- struct symtab_and_line cursal =
- get_current_source_symtab_and_line ();
-
- default_symtab = cursal.symtab;
- default_line = cursal.line;
- }
-
+ initialize_defaults (&default_symtab, &default_line);
+
/* See if arg is *PC */
if (**argptr == '*')
- {
- (*argptr)++;
- pc = parse_and_eval_address_1 (argptr);
-
- values.sals = (struct symtab_and_line *)
- xmalloc (sizeof (struct symtab_and_line));
-
- values.nelts = 1;
- values.sals[0] = find_pc_line (pc, 0);
- values.sals[0].pc = pc;
- values.sals[0].section = find_pc_overlay (pc);
-
- return values;
- }
-
- /* 'has_if' is for the syntax:
- * (gdb) break foo if (a==b)
- */
- if ((ii = strstr (*argptr, " if ")) != NULL ||
- (ii = strstr (*argptr, "\tif ")) != NULL ||
- (ii = strstr (*argptr, " if\t")) != NULL ||
- (ii = strstr (*argptr, "\tif\t")) != NULL ||
- (ii = strstr (*argptr, " if(")) != NULL ||
- (ii = strstr (*argptr, "\tif( ")) != NULL)
- has_if = 1;
- /* Temporarily zap out "if (condition)" to not
- * confuse the parenthesis-checking code below.
- * This is undone below. Do not change ii!!
- */
- if (has_if)
- {
- *ii = '\0';
- }
+ return decode_indirect (argptr);
/* Set various flags.
- * 'has_parens' is important for overload checking, where
+ * 'paren_pointer' is important for overload checking, where
* we allow things like:
* (gdb) break c::f(int)
*/
- /* Maybe arg is FILE : LINENUM or FILE : FUNCTION */
-
- is_quoted = (**argptr
- && strchr (get_gdb_completer_quote_characters (),
- **argptr) != NULL);
-
- has_parens = ((pp = strchr (*argptr, '(')) != NULL
- && (pp = strrchr (pp, ')')) != NULL);
-
- /* Now that we're safely past the has_parens check,
- * put back " if (condition)" so outer layers can see it
- */
- if (has_if)
- *ii = ' ';
+ set_flags (*argptr, &is_quoted, &paren_pointer);
/* Maybe we were called with a line range FILENAME:LINENUM,FILENAME:LINENUM
and we must isolate the first half. Outer layers will call again later
@@ -693,7 +655,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
if (has_comma)
*ii = ',';
- if ((p[0] == ':' || p[0] == '.') && !has_parens)
+ if ((p[0] == ':' || p[0] == '.') && paren_pointer == NULL)
{
/* C++ */
/* ... or Java */
@@ -914,16 +876,9 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
/* Look up entire name */
sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab);
s = (struct symtab *) 0;
- /* Prepare to jump: restore the " if (condition)" so outer layers see it */
- /* Symbol was found --> jump to normal symbol processing.
- Code following "symbol_found" expects "copy" to have the
- symbol name, "sym" to have the symbol pointer, "s" to be
- a specified file's symtab, and sym_symtab to be the symbol's
- symtab. */
- /* By jumping there we avoid falling through the FILE:LINE and
- FILE:FUNC processing stuff below */
if (sym)
- goto symbol_found;
+ return symbol_found (funfirstline, canonical, copy, sym,
+ NULL, sym_symtab);
/* Couldn't find any interpretation as classes/namespaces, so give up */
/* The quotes are important if copy is empty. */
@@ -989,12 +944,9 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab);
if (sym)
{
- /* Yes, we have a symbol; jump to symbol processing */
- /* Code after symbol_found expects S, SYM_SYMTAB, SYM,
- and COPY to be set correctly */
*argptr = (*p == '\'') ? p + 1 : p;
- s = (struct symtab *) 0;
- goto symbol_found;
+ return symbol_found (funfirstline, canonical, copy, sym,
+ NULL, sym_symtab);
}
/* Otherwise fall out from here and go to file/line spec
processing, etc. */
@@ -1032,14 +984,9 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
if (s == 0 && default_symtab == 0)
{
- struct symtab_and_line cursal;
-
/* Make sure we have at least a default source file. */
set_default_source_symtab_and_line ();
- cursal = get_current_source_symtab_and_line ();
-
- default_symtab = cursal.symtab;
- default_line = cursal.line;
+ initialize_defaults (&default_symtab, &default_line);
}
if (**argptr == '+')
@@ -1101,9 +1048,9 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
if (p[-1] != '\'')
error ("Unmatched single quote.");
}
- else if (has_parens)
+ else if (paren_pointer != NULL)
{
- p = pp + 1;
+ p = paren_pointer + 1;
}
else
{
@@ -1155,19 +1102,16 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab);
s = (struct symtab *) 0;
need_canonical = 1;
- /* Symbol was found --> jump to normal symbol processing.
- Code following "symbol_found" expects "copy" to have the
- symbol name, "sym" to have the symbol pointer, "s" to be
- a specified file's symtab, and sym_symtab to be the symbol's
- symtab. */
+ /* Symbol was found --> jump to normal symbol processing. */
if (sym)
- goto symbol_found;
+ return symbol_found (funfirstline, canonical, copy, sym,
+ NULL, sym_symtab);
/* If symbol was not found, look in minimal symbol tables */
msymbol = lookup_minimal_symbol (copy, NULL, NULL);
/* Min symbol was found --> jump to minsym processing. */
if (msymbol)
- goto minimal_symbol_found;
+ return minsym_found (funfirstline, msymbol);
/* Not a user variable or function -- must be convenience variable */
need_canonical = (s == 0) ? 1 : 0;
@@ -1200,84 +1144,196 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
: get_selected_block (0)),
VAR_NAMESPACE, 0, &sym_symtab);
-symbol_found: /* We also jump here from inside the C++ class/namespace
- code on finding a symbol of the form "A::B::C" */
-
if (sym != NULL)
+ return symbol_found (funfirstline, canonical, copy, sym, s, sym_symtab);
+
+ msymbol = lookup_minimal_symbol (copy, NULL, NULL);
+
+ if (msymbol != NULL)
+ return minsym_found (funfirstline, msymbol);
+
+ if (!have_full_symbols () &&
+ !have_partial_symbols () && !have_minimal_symbols ())
+ error ("No symbol table is loaded. Use the \"file\" command.");
+
+ error ("Function \"%s\" not defined.", copy);
+ return values; /* for lint */
+}
+
+
+
+/* Now, still more helper functions. */
+
+/* NOTE: carlton/2002-11-07: Some of these have non-obvious side
+ effects. In particular, if a function is passed ARGPTR as an
+ argument, it modifies what ARGPTR points to. (Typically, it
+ advances *ARGPTR past whatever substring it has just looked
+ at.) */
+
+/* First, some functions to initialize stuff at the beggining of the
+ function. */
+
+static void
+initialize_defaults (struct symtab **default_symtab, int *default_line)
+{
+ if (*default_symtab == 0)
{
- if (SYMBOL_CLASS (sym) == LOC_BLOCK)
- {
- /* Arg is the name of a function */
- values.sals = (struct symtab_and_line *)
- xmalloc (sizeof (struct symtab_and_line));
- values.sals[0] = find_function_start_sal (sym, funfirstline);
- values.nelts = 1;
+ /* Use whatever we have for the default source line. We don't use
+ get_current_or_default_symtab_and_line as it can recurse and call
+ us back! */
+ struct symtab_and_line cursal =
+ get_current_source_symtab_and_line ();
+
+ *default_symtab = cursal.symtab;
+ *default_line = cursal.line;
+ }
+}
- /* Don't use the SYMBOL_LINE; if used at all it points to
- the line containing the parameters or thereabouts, not
- the first line of code. */
+static void
+set_flags (char *arg, int *is_quoted, char **paren_pointer)
+{
+ char *ii;
+ int has_if = 0;
- /* We might need a canonical line spec if it is a static
- function. */
- if (s == 0)
- {
- struct blockvector *bv = BLOCKVECTOR (sym_symtab);
- struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- if (lookup_block_symbol (b, copy, NULL, VAR_NAMESPACE) != NULL)
- build_canonical_line_spec (values.sals, copy, canonical);
- }
- return values;
- }
- else
- {
- if (funfirstline)
- error ("\"%s\" is not a function", copy);
- else if (SYMBOL_LINE (sym) != 0)
- {
- /* We know its line number. */
- values.sals = (struct symtab_and_line *)
- xmalloc (sizeof (struct symtab_and_line));
- values.nelts = 1;
- memset (&values.sals[0], 0, sizeof (values.sals[0]));
- values.sals[0].symtab = sym_symtab;
- values.sals[0].line = SYMBOL_LINE (sym);
- return values;
- }
- else
- /* This can happen if it is compiled with a compiler which doesn't
- put out line numbers for variables. */
- /* FIXME: Shouldn't we just set .line and .symtab to zero
- and return? For example, "info line foo" could print
- the address. */
- error ("Line number not known for symbol \"%s\"", copy);
- }
+ /* 'has_if' is for the syntax:
+ * (gdb) break foo if (a==b)
+ */
+ if ((ii = strstr (arg, " if ")) != NULL ||
+ (ii = strstr (arg, "\tif ")) != NULL ||
+ (ii = strstr (arg, " if\t")) != NULL ||
+ (ii = strstr (arg, "\tif\t")) != NULL ||
+ (ii = strstr (arg, " if(")) != NULL ||
+ (ii = strstr (arg, "\tif( ")) != NULL)
+ has_if = 1;
+ /* Temporarily zap out "if (condition)" to not
+ * confuse the parenthesis-checking code below.
+ * This is undone below. Do not change ii!!
+ */
+ if (has_if)
+ {
+ *ii = '\0';
}
- msymbol = lookup_minimal_symbol (copy, NULL, NULL);
+ *is_quoted = (*arg
+ && strchr (get_gdb_completer_quote_characters (),
+ *arg) != NULL);
-minimal_symbol_found: /* We also jump here from the case for variables
- that begin with '$' */
+ *paren_pointer = strchr (arg, '(');
+ if (*paren_pointer != NULL)
+ *paren_pointer = strrchr (*paren_pointer, ')');
- if (msymbol != NULL)
+ /* Now that we're safely past the paren_pointer check,
+ * put back " if (condition)" so outer layers can see it
+ */
+ if (has_if)
+ *ii = ' ';
+}
+
+
+
+/* Decode arg of the form *PC. */
+
+static struct symtabs_and_lines
+decode_indirect (char **argptr)
+{
+ struct symtabs_and_lines values;
+ CORE_ADDR pc;
+
+ (*argptr)++;
+ pc = parse_and_eval_address_1 (argptr);
+
+ values.sals = (struct symtab_and_line *)
+ xmalloc (sizeof (struct symtab_and_line));
+
+ values.nelts = 1;
+ values.sals[0] = find_pc_line (pc, 0);
+ values.sals[0].pc = pc;
+ values.sals[0].section = find_pc_overlay (pc);
+
+ return values;
+}
+
+
+
+/* Now come some functions that are called from multiple places within
+ decode_line_1. */
+
+/* We've found a symbol SYM to associate with our linespec; build a
+ corresponding struct symtabs_and_lines. */
+
+static struct symtabs_and_lines
+symbol_found (int funfirstline, char ***canonical, char *copy,
+ struct symbol *sym, struct symtab *s,
+ struct symtab *sym_symtab)
+{
+ struct symtabs_and_lines values;
+
+ if (SYMBOL_CLASS (sym) == LOC_BLOCK)
{
+ /* Arg is the name of a function */
values.sals = (struct symtab_and_line *)
xmalloc (sizeof (struct symtab_and_line));
- values.sals[0] = find_pc_sect_line (SYMBOL_VALUE_ADDRESS (msymbol),
- (struct sec *) 0, 0);
- values.sals[0].section = SYMBOL_BFD_SECTION (msymbol);
- if (funfirstline)
+ values.sals[0] = find_function_start_sal (sym, funfirstline);
+ values.nelts = 1;
+
+ /* Don't use the SYMBOL_LINE; if used at all it points to
+ the line containing the parameters or thereabouts, not
+ the first line of code. */
+
+ /* We might need a canonical line spec if it is a static
+ function. */
+ if (s == 0)
{
- values.sals[0].pc += FUNCTION_START_OFFSET;
- values.sals[0].pc = SKIP_PROLOGUE (values.sals[0].pc);
+ struct blockvector *bv = BLOCKVECTOR (sym_symtab);
+ struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+ if (lookup_block_symbol (b, copy, NULL, VAR_NAMESPACE) != NULL)
+ build_canonical_line_spec (values.sals, copy, canonical);
}
- values.nelts = 1;
return values;
}
+ else
+ {
+ if (funfirstline)
+ error ("\"%s\" is not a function", copy);
+ else if (SYMBOL_LINE (sym) != 0)
+ {
+ /* We know its line number. */
+ values.sals = (struct symtab_and_line *)
+ xmalloc (sizeof (struct symtab_and_line));
+ values.nelts = 1;
+ memset (&values.sals[0], 0, sizeof (values.sals[0]));
+ values.sals[0].symtab = sym_symtab;
+ values.sals[0].line = SYMBOL_LINE (sym);
+ return values;
+ }
+ else
+ /* This can happen if it is compiled with a compiler which doesn't
+ put out line numbers for variables. */
+ /* FIXME: Shouldn't we just set .line and .symtab to zero
+ and return? For example, "info line foo" could print
+ the address. */
+ error ("Line number not known for symbol \"%s\"", copy);
+ }
+}
- if (!have_full_symbols () &&
- !have_partial_symbols () && !have_minimal_symbols ())
- error ("No symbol table is loaded. Use the \"file\" command.");
+/* We've found a minimal symbol MSYMBOL to associate with our
+ linespec; build a corresponding struct symtabs_and_lines. */
- error ("Function \"%s\" not defined.", copy);
- return values; /* for lint */
+static struct symtabs_and_lines
+minsym_found (int funfirstline, struct minimal_symbol *msymbol)
+{
+ struct symtabs_and_lines values;
+
+ values.sals = (struct symtab_and_line *)
+ xmalloc (sizeof (struct symtab_and_line));
+ values.sals[0] = find_pc_sect_line (SYMBOL_VALUE_ADDRESS (msymbol),
+ (struct sec *) 0, 0);
+ values.sals[0].section = SYMBOL_BFD_SECTION (msymbol);
+ if (funfirstline)
+ {
+ values.sals[0].pc += FUNCTION_START_OFFSET;
+ values.sals[0].pc = SKIP_PROLOGUE (values.sals[0].pc);
+ }
+ values.nelts = 1;
+ return values;
}
diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c
index 9cd1672d336..37edc2bcb5c 100644
--- a/gdb/lynx-nat.c
+++ b/gdb/lynx-nat.c
@@ -296,10 +296,10 @@ fetch_inferior_registers (int regno)
supply_register (G0_REGNUM, buf);
supply_register (TBR_REGNUM, (char *) &ec.tbr);
- memcpy (&registers[REGISTER_BYTE (G1_REGNUM)], &ec.g1,
+ memcpy (&deprecated_registers[REGISTER_BYTE (G1_REGNUM)], &ec.g1,
4 * REGISTER_RAW_SIZE (G1_REGNUM));
for (i = G1_REGNUM; i <= G1_REGNUM + 3; i++)
- register_valid[i] = 1;
+ deprecated_register_valid[i] = 1;
supply_register (PS_REGNUM, (char *) &ec.psr);
supply_register (Y_REGNUM, (char *) &ec.y);
@@ -307,10 +307,10 @@ fetch_inferior_registers (int regno)
supply_register (NPC_REGNUM, (char *) &ec.npc);
supply_register (WIM_REGNUM, (char *) &ec.wim);
- memcpy (&registers[REGISTER_BYTE (O0_REGNUM)], ec.o,
+ memcpy (&deprecated_registers[REGISTER_BYTE (O0_REGNUM)], ec.o,
8 * REGISTER_RAW_SIZE (O0_REGNUM));
for (i = O0_REGNUM; i <= O0_REGNUM + 7; i++)
- register_valid[i] = 1;
+ deprecated_register_valid[i] = 1;
}
if (whatregs & WHATREGS_STACK)
@@ -321,16 +321,16 @@ fetch_inferior_registers (int regno)
sp = read_register (SP_REGNUM);
target_read_memory (sp + FRAME_SAVED_I0,
- &registers[REGISTER_BYTE (I0_REGNUM)],
+ &deprecated_registers[REGISTER_BYTE (I0_REGNUM)],
8 * REGISTER_RAW_SIZE (I0_REGNUM));
for (i = I0_REGNUM; i <= I7_REGNUM; i++)
- register_valid[i] = 1;
+ deprecated_register_valid[i] = 1;
target_read_memory (sp + FRAME_SAVED_L0,
- &registers[REGISTER_BYTE (L0_REGNUM)],
+ &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
8 * REGISTER_RAW_SIZE (L0_REGNUM));
for (i = L0_REGNUM; i <= L0_REGNUM + 7; i++)
- register_valid[i] = 1;
+ deprecated_register_valid[i] = 1;
}
if (whatregs & WHATREGS_FLOAT)
@@ -345,10 +345,10 @@ fetch_inferior_registers (int regno)
if (errno)
perror_with_name ("ptrace(PTRACE_GETFPREGS)");
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], fc.f.fregs,
+ memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)], fc.f.fregs,
32 * REGISTER_RAW_SIZE (FP0_REGNUM));
for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
- register_valid[i] = 1;
+ deprecated_register_valid[i] = 1;
supply_register (FPS_REGNUM, (char *) &fc.fsr);
}
@@ -383,7 +383,7 @@ store_inferior_registers (int regno)
int retval;
ec.tbr = read_register (TBR_REGNUM);
- memcpy (&ec.g1, &registers[REGISTER_BYTE (G1_REGNUM)],
+ memcpy (&ec.g1, &deprecated_registers[REGISTER_BYTE (G1_REGNUM)],
4 * REGISTER_RAW_SIZE (G1_REGNUM));
ec.psr = read_register (PS_REGNUM);
@@ -392,7 +392,7 @@ store_inferior_registers (int regno)
ec.npc = read_register (NPC_REGNUM);
ec.wim = read_register (WIM_REGNUM);
- memcpy (ec.o, &registers[REGISTER_BYTE (O0_REGNUM)],
+ memcpy (ec.o, &deprecated_registers[REGISTER_BYTE (O0_REGNUM)],
8 * REGISTER_RAW_SIZE (O0_REGNUM));
errno = 0;
@@ -411,19 +411,19 @@ store_inferior_registers (int regno)
if (regno == -1 || regno == SP_REGNUM)
{
- if (!register_valid[L0_REGNUM + 5])
+ if (!deprecated_register_valid[L0_REGNUM + 5])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
target_write_memory (sp + FRAME_SAVED_I0,
- &registers[REGISTER_BYTE (I0_REGNUM)],
+ &deprecated_registers[REGISTER_BYTE (I0_REGNUM)],
8 * REGISTER_RAW_SIZE (I0_REGNUM));
target_write_memory (sp + FRAME_SAVED_L0,
- &registers[REGISTER_BYTE (L0_REGNUM)],
+ &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
8 * REGISTER_RAW_SIZE (L0_REGNUM));
}
else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
{
- if (!register_valid[regno])
+ if (!deprecated_register_valid[regno])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (regno >= L0_REGNUM && regno <= L0_REGNUM + 7)
regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM)
@@ -432,7 +432,7 @@ store_inferior_registers (int regno)
regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (I0_REGNUM)
+ FRAME_SAVED_I0;
target_write_memory (sp + regoffset,
- &registers[REGISTER_BYTE (regno)],
+ &deprecated_registers[REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
}
}
@@ -449,7 +449,7 @@ store_inferior_registers (int regno)
if (errno)
perror_with_name ("ptrace(PTRACE_GETFPREGS)");
- memcpy (fc.f.fregs, &registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (fc.f.fregs, &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
32 * REGISTER_RAW_SIZE (FP0_REGNUM));
fc.fsr = read_register (FPS_REGNUM);
@@ -571,7 +571,7 @@ store_inferior_registers (int regno)
{
unsigned int reg;
- reg = *(unsigned int *) &registers[REGISTER_BYTE (regno) + i];
+ reg = *(unsigned int *) &deprecated_registers[REGISTER_BYTE (regno) + i];
errno = 0;
ptrace (ptrace_fun, PIDGET (inferior_ptid),
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index e291d62b1cb..3fb46851c84 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -216,6 +216,7 @@ type_exp: type
exp : exp '^' %prec UNARY
{ write_exp_elt_opcode (UNOP_IND); }
+ ;
exp : '-'
{ number_sign = -1; }
@@ -330,6 +331,7 @@ exp : INCL '(' exp ',' exp ')'
exp : EXCL '(' exp ',' exp ')'
{ error("Sets are not implemented.");}
+ ;
set : '{' arglist '}'
{ error("Sets are not implemented.");}
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index aa1a226754f..3045a58fa88 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -1345,7 +1345,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
sizeof (m68hc11_call_dummy_words));
set_gdbarch_call_dummy_p (gdbarch, 1);
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
- set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
+ set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_deprecated_extract_return_value (gdbarch, m68hc11_extract_return_value);
set_gdbarch_push_arguments (gdbarch, m68hc11_push_arguments);
@@ -1368,7 +1368,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
- set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
+ set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
set_gdbarch_store_struct_return (gdbarch, m68hc11_store_struct_return);
set_gdbarch_deprecated_store_return_value (gdbarch, m68hc11_store_return_value);
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index 31e8e660dc8..d27d177d2df 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -252,7 +252,7 @@ m68k_deprecated_extract_struct_value_address (char *regbuf)
static void
m68k_store_return_value (struct type *type, char *valbuf)
{
- write_register_bytes (0, valbuf, TYPE_LENGTH (type));
+ deprecated_write_register_bytes (0, valbuf, TYPE_LENGTH (type));
}
/* Describe the pointer in each stack frame to the previous stack frame
@@ -463,7 +463,7 @@ m68k_push_dummy_frame (void)
this target or not. */
for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--)
{
- read_register_bytes (REGISTER_BYTE (regnum), raw_buffer, 12);
+ deprecated_read_register_bytes (REGISTER_BYTE (regnum), raw_buffer, 12);
sp = push_bytes (sp, raw_buffer, 12);
}
@@ -493,7 +493,8 @@ m68k_pop_frame (void)
if (frame->saved_regs[regnum])
{
read_memory (frame->saved_regs[regnum], raw_buffer, 12);
- write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, 12);
+ deprecated_write_register_bytes (REGISTER_BYTE (regnum), raw_buffer,
+ 12);
}
}
for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--)
@@ -836,16 +837,16 @@ fill_gregset (gregset_t *gregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- *(regp + regi) = *(int *) &registers[REGISTER_BYTE (regi)];
+ *(regp + regi) = *(int *) &deprecated_registers[REGISTER_BYTE (regi)];
}
}
if ((regno == -1) || (regno == PS_REGNUM))
{
- *(regp + R_PS) = *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
+ *(regp + R_PS) = *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)];
}
if ((regno == -1) || (regno == PC_REGNUM))
{
- *(regp + R_PC) = *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
+ *(regp + R_PC) = *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)];
}
}
@@ -887,22 +888,22 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- from = (char *) &registers[REGISTER_BYTE (regi)];
+ from = (char *) &deprecated_registers[REGISTER_BYTE (regi)];
to = (char *) &(fpregsetp->f_fpregs[regi - FP0_REGNUM][0]);
memcpy (to, from, REGISTER_RAW_SIZE (regi));
}
}
if ((regno == -1) || (regno == E_FPC_REGNUM))
{
- fpregsetp->f_pcr = *(int *) &registers[REGISTER_BYTE (E_FPC_REGNUM)];
+ fpregsetp->f_pcr = *(int *) &deprecated_registers[REGISTER_BYTE (E_FPC_REGNUM)];
}
if ((regno == -1) || (regno == E_FPS_REGNUM))
{
- fpregsetp->f_psr = *(int *) &registers[REGISTER_BYTE (E_FPS_REGNUM)];
+ fpregsetp->f_psr = *(int *) &deprecated_registers[REGISTER_BYTE (E_FPS_REGNUM)];
}
if ((regno == -1) || (regno == E_FPI_REGNUM))
{
- fpregsetp->f_fpiaddr = *(int *) &registers[REGISTER_BYTE (E_FPI_REGNUM)];
+ fpregsetp->f_fpiaddr = *(int *) &deprecated_registers[REGISTER_BYTE (E_FPI_REGNUM)];
}
}
diff --git a/gdb/m68knbsd-nat.c b/gdb/m68knbsd-nat.c
index ec986eeb364..191327a0f7b 100644
--- a/gdb/m68knbsd-nat.c
+++ b/gdb/m68knbsd-nat.c
@@ -36,15 +36,15 @@ fetch_inferior_registers (int regno)
ptrace (PT_GETREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_registers, 0);
- memcpy (&registers[REGISTER_BYTE (0)], &inferior_registers,
+ memcpy (&deprecated_registers[REGISTER_BYTE (0)], &inferior_registers,
sizeof (inferior_registers));
ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
+ memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
sizeof (inferior_fp_registers));
- registers_fetched ();
+ deprecated_registers_fetched ();
}
void
@@ -53,12 +53,12 @@ store_inferior_registers (int regno)
struct reg inferior_registers;
struct fpreg inferior_fp_registers;
- memcpy (&inferior_registers, &registers[REGISTER_BYTE (0)],
+ memcpy (&inferior_registers, &deprecated_registers[REGISTER_BYTE (0)],
sizeof (inferior_registers));
ptrace (PT_SETREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_registers, 0);
- memcpy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (&inferior_fp_registers, &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
sizeof (inferior_fp_registers));
ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
@@ -77,10 +77,10 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
struct md_core *core_reg = (struct md_core *) core_reg_sect;
/* Integer registers */
- memcpy (&registers[REGISTER_BYTE (0)],
+ memcpy (&deprecated_registers[REGISTER_BYTE (0)],
&core_reg->intreg, sizeof (struct reg));
/* Floating point registers */
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
&core_reg->freg, sizeof (struct fpreg));
}
diff --git a/gdb/macroscope.c b/gdb/macroscope.c
index 083dc1f4e4a..b482068637c 100644
--- a/gdb/macroscope.c
+++ b/gdb/macroscope.c
@@ -27,12 +27,13 @@
#include "target.h"
#include "frame.h"
#include "inferior.h"
+#include "complaints.h"
struct macro_scope *
sal_macro_scope (struct symtab_and_line sal)
{
- struct macro_source_file *main;
+ struct macro_source_file *main, *inclusion;
struct macro_scope *ms;
if (! sal.symtab
@@ -42,17 +43,37 @@ sal_macro_scope (struct symtab_and_line sal)
ms = (struct macro_scope *) xmalloc (sizeof (*ms));
main = macro_main (sal.symtab->macro_table);
- ms->file = macro_lookup_inclusion (main, sal.symtab->filename);
-
- if (! ms->file)
- internal_error
- (__FILE__, __LINE__,
- "\n"
- "the symtab `%s' refers to a preprocessor macro table which doesn't\n"
- "have any record of processing a file by that name.\n",
- sal.symtab->filename);
+ inclusion = macro_lookup_inclusion (main, sal.symtab->filename);
- ms->line = sal.line;
+ if (inclusion)
+ {
+ ms->file = inclusion;
+ ms->line = sal.line;
+ }
+ else
+ {
+ /* There are, unfortunately, cases where a compilation unit can
+ have a symtab for a source file that doesn't appear in the
+ macro table. For example, at the moment, Dwarf doesn't have
+ any way in the .debug_macinfo section to describe the effect
+ of #line directives, so if you debug a YACC parser you'll get
+ a macro table which only mentions the .c files generated by
+ YACC, but symtabs that mention the .y files consumed by YACC.
+
+ In the long run, we should extend the Dwarf macro info
+ representation to handle #line directives, and get GCC to
+ emit it.
+
+ For the time being, though, we'll just treat these as
+ occurring at the end of the main source file. */
+ ms->file = main;
+ ms->line = -1;
+
+ complaint (&symfile_complaints,
+ "symtab found for `%s', but that file\n"
+ "is not covered in the compilation unit's macro information",
+ sal.symtab->filename);
+ }
return ms;
}
diff --git a/gdb/macrotab.c b/gdb/macrotab.c
index accaa7dad83..5bc5b7327da 100644
--- a/gdb/macrotab.c
+++ b/gdb/macrotab.c
@@ -445,7 +445,7 @@ macro_include (struct macro_source_file *source,
should tolerate bad debug info. So:
First, squawk. */
- static struct complaint bogus_inclusion_line = {
+ static struct deprecated_complaint bogus_inclusion_line = {
"both `%s' and `%s' allegedly #included at %s:%d", 0, 0
};
@@ -707,7 +707,7 @@ check_for_redefinition (struct macro_source_file *source, int line,
if (! same)
{
- static struct complaint macro_redefined = {
+ static struct deprecated_complaint macro_redefined = {
"macro `%s' redefined at %s:%d; original definition at %s:%d",
0, 0
};
@@ -801,7 +801,7 @@ macro_undef (struct macro_source_file *source, int line,
if (key->end_file)
{
- static struct complaint double_undef = {
+ static struct deprecated_complaint double_undef = {
"macro '%s' is #undefined twice, at %s:%d and %s:%d",
0, 0
};
@@ -820,7 +820,7 @@ macro_undef (struct macro_source_file *source, int line,
has no macro definition in scope is ignored. So we should
ignore it too. */
#if 0
- static struct complaint no_macro_to_undefine = {
+ static struct deprecated_complaint no_macro_to_undefine = {
"no definition for macro `%s' in scope to #undef at %s:%d",
0, 0
};
diff --git a/gdb/macrotab.h b/gdb/macrotab.h
index df32977967e..bd44e2c3ed3 100644
--- a/gdb/macrotab.h
+++ b/gdb/macrotab.h
@@ -83,6 +83,15 @@ struct macro_table;
tree mapping the #inclusions that contributed to the compilation
unit, with the main source file as its root.
+ Beware --- not every source file mentioned in a compilation unit's
+ symtab structures will appear in the #inclusion tree! As of Oct
+ 2002, GCC does record the effect of #line directives in the source
+ line info, but not in macro info. This means that GDB's symtabs
+ (built from the former, among other things) may mention filenames
+ that the #inclusion tree (built from the latter) doesn't have any
+ record of. See macroscope.c:sal_macro_scope for how to accomodate
+ this.
+
It's worth noting that libcpp has a simpler way of representing all
this, which we should consider switching to. It might even be
suitable for ordinary non-macro line number info.
diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c
index 41114b44735..23ee96f2790 100644
--- a/gdb/mcore-tdep.c
+++ b/gdb/mcore-tdep.c
@@ -1024,8 +1024,9 @@ mcore_store_return_value (struct type *type, char *valbuf)
zeros = alloca (return_size);
memset (zeros, 0, return_size);
- write_register_bytes (REGISTER_BYTE (RETVAL_REGNUM), zeros, return_size);
- write_register_bytes (offset, valbuf, value_size);
+ deprecated_write_register_bytes (REGISTER_BYTE (RETVAL_REGNUM), zeros,
+ return_size);
+ deprecated_write_register_bytes (offset, valbuf, value_size);
}
/* Initialize our target-dependent "stuff" for this newly created frame.
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 1695afdf178..ed13fa3364a 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -143,94 +143,94 @@ struct symloc
/* Various complaints about symbol reading that don't abort the process */
-static struct complaint bad_file_number_complaint =
+static struct deprecated_complaint bad_file_number_complaint =
{"bad file number %d", 0, 0};
-static struct complaint index_complaint =
+static struct deprecated_complaint index_complaint =
{"bad aux index at symbol %s", 0, 0};
-static struct complaint aux_index_complaint =
+static struct deprecated_complaint aux_index_complaint =
{"bad proc end in aux found from symbol %s", 0, 0};
-static struct complaint block_index_complaint =
+static struct deprecated_complaint block_index_complaint =
{"bad aux index at block symbol %s", 0, 0};
-static struct complaint unknown_ext_complaint =
+static struct deprecated_complaint unknown_ext_complaint =
{"unknown external symbol %s", 0, 0};
-static struct complaint unknown_sym_complaint =
+static struct deprecated_complaint unknown_sym_complaint =
{"unknown local symbol %s", 0, 0};
-static struct complaint unknown_st_complaint =
+static struct deprecated_complaint unknown_st_complaint =
{"with type %d", 0, 0};
-static struct complaint block_overflow_complaint =
+static struct deprecated_complaint block_overflow_complaint =
{"block containing %s overfilled", 0, 0};
-static struct complaint basic_type_complaint =
+static struct deprecated_complaint basic_type_complaint =
{"cannot map ECOFF basic type 0x%x for %s", 0, 0};
-static struct complaint unknown_type_qual_complaint =
+static struct deprecated_complaint unknown_type_qual_complaint =
{"unknown type qualifier 0x%x", 0, 0};
-static struct complaint array_index_type_complaint =
+static struct deprecated_complaint array_index_type_complaint =
{"illegal array index type for %s, assuming int", 0, 0};
-static struct complaint bad_tag_guess_complaint =
+static struct deprecated_complaint bad_tag_guess_complaint =
{"guessed tag type of %s incorrectly", 0, 0};
-static struct complaint block_member_complaint =
+static struct deprecated_complaint block_member_complaint =
{"declaration block contains unhandled symbol type %d", 0, 0};
-static struct complaint stEnd_complaint =
+static struct deprecated_complaint stEnd_complaint =
{"stEnd with storage class %d not handled", 0, 0};
-static struct complaint unknown_mdebug_symtype_complaint =
+static struct deprecated_complaint unknown_mdebug_symtype_complaint =
{"unknown symbol type 0x%x", 0, 0};
-static struct complaint stab_unknown_complaint =
+static struct deprecated_complaint stab_unknown_complaint =
{"unknown stabs symbol %s", 0, 0};
-static struct complaint pdr_for_nonsymbol_complaint =
+static struct deprecated_complaint pdr_for_nonsymbol_complaint =
{"PDR for %s, but no symbol", 0, 0};
-static struct complaint pdr_static_symbol_complaint =
+static struct deprecated_complaint pdr_static_symbol_complaint =
{"can't handle PDR for static proc at 0x%lx", 0, 0};
-static struct complaint bad_setjmp_pdr_complaint =
+static struct deprecated_complaint bad_setjmp_pdr_complaint =
{"fixing bad setjmp PDR from libc", 0, 0};
-static struct complaint bad_fbitfield_complaint =
+static struct deprecated_complaint bad_fbitfield_complaint =
{"can't handle TIR fBitfield for %s", 0, 0};
-static struct complaint bad_continued_complaint =
+static struct deprecated_complaint bad_continued_complaint =
{"illegal TIR continued for %s", 0, 0};
-static struct complaint bad_rfd_entry_complaint =
+static struct deprecated_complaint bad_rfd_entry_complaint =
{"bad rfd entry for %s: file %d, index %d", 0, 0};
-static struct complaint unexpected_type_code_complaint =
+static struct deprecated_complaint unexpected_type_code_complaint =
{"unexpected type code for %s", 0, 0};
-static struct complaint unable_to_cross_ref_complaint =
+static struct deprecated_complaint unable_to_cross_ref_complaint =
{"unable to cross ref btTypedef for %s", 0, 0};
-static struct complaint bad_indirect_xref_complaint =
+static struct deprecated_complaint bad_indirect_xref_complaint =
{"unable to cross ref btIndirect for %s", 0, 0};
-static struct complaint illegal_forward_tq0_complaint =
+static struct deprecated_complaint illegal_forward_tq0_complaint =
{"illegal tq0 in forward typedef for %s", 0, 0};
-static struct complaint illegal_forward_bt_complaint =
+static struct deprecated_complaint illegal_forward_bt_complaint =
{"illegal bt %d in forward typedef for %s", 0, 0};
-static struct complaint bad_linetable_guess_complaint =
+static struct deprecated_complaint bad_linetable_guess_complaint =
{"guessed size of linetable for %s incorrectly", 0, 0};
-static struct complaint bad_ext_ifd_complaint =
+static struct deprecated_complaint bad_ext_ifd_complaint =
{"bad ifd for external symbol: %d (max %d)", 0, 0};
-static struct complaint bad_ext_iss_complaint =
+static struct deprecated_complaint bad_ext_iss_complaint =
{"bad iss for external symbol: %ld (max %ld)", 0, 0};
/* Macros and extra defs */
@@ -1092,6 +1092,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
FIELD_TYPE (*f) = t;
FIELD_NAME (*f) = debug_info->ss + cur_fdr->issBase + tsym.iss;
FIELD_BITSIZE (*f) = 0;
+ FIELD_STATIC_KIND (*f) = 0;
enum_sym = ((struct symbol *)
obstack_alloc (&current_objfile->symbol_obstack,
@@ -1284,6 +1285,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
bitsize = 0;
FIELD_TYPE (*f) = parse_type (cur_fd, ax, sh->index, &bitsize, bigend, name);
FIELD_BITSIZE (*f) = bitsize;
+ FIELD_STATIC_KIND (*f) = 0;
break;
case stIndirect: /* forward declaration on Irix5 */
@@ -2720,7 +2722,7 @@ parse_partial_symbols (struct objfile *objfile)
switch (type_code)
{
- static struct complaint function_outside_compilation_unit = {
+ static struct deprecated_complaint function_outside_compilation_unit = {
"function `%s' appears to be defined outside of all compilation units", 0, 0
};
char *p;
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index 0a0954f534e..a28bab34303 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,3 +1,43 @@
+2002-11-13 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (mi_cmd_data_write_register_values): Use
+ deprecated_write_register_bytes instead of write_register_bytes.
+
+2002-11-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * gdbmi.texinfo (-var-assign): Add comments about interaction
+ with -var-update and add an example. Part of fix for gdb/702.
+
+2002-11-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * mi-main.c (mi_command_loop): Initialize raw_stdout and gdb_stdout
+ only if mi version is <= 1.
+ (mi_init_ui): Initialize raw_stdout and gdb_stdout if mi version
+ is > 1 so startup message is treated as console output. This is
+ part of fix for PR gdb/604.
+
+2002-11-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * mi-cmd-var.c (mi_cmd_var_create): Change the function used to
+ parse the frame addr from parse_and_eval_address() to
+ string_to_core_addr(). This is a fix for PR gdb/494.
+
+2002-10-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * mi-cmd-var.c: Change all remaining occurrences of ui_out_tuple_begin
+ to make_cleanup_ui_out_tuple_begin_end. Change all remaining
+ occurrences of ui_out_list_begin to make_cleanup_ui_out_list_begin_end.
+ Use do_cleanups instead of ui_out_list_end or ui_out_tuple_end. This
+ is a fix for PR gdb/680.
+ * mi-cmd-stack.c: Ditto.
+ * mi-main.c: Ditto.
+
+2002-10-22 Keith Seitz <keiths@redhat.com>
+
+ * mi-main.c (mi_cmd_thread_select): Only return MI_CMD_CAUGHT_ERROR
+ when we really did catch an error(). If we got GDB_RC_FAIL, return
+ MI_CMD_ERROR instead.
+
2002-10-03 Jeff Johnston <jjohnstn@redhat.com>
* gdbmi.texinfo: Fix examples that show frames to remove
diff --git a/gdb/mi/gdbmi.texinfo b/gdb/mi/gdbmi.texinfo
index 164b1e823b7..d64328c1734 100644
--- a/gdb/mi/gdbmi.texinfo
+++ b/gdb/mi/gdbmi.texinfo
@@ -3799,7 +3799,21 @@ before the value of a child variable can be evaluated.
@end example
Assigns the value of @var{expression} to the variable object specified
-by @var{name}. The object must be @samp{editable}.
+by @var{name}. The object must be @samp{editable}. If the variable's
+value is altered by the assign, the variable will show up in any
+subsequent @code{-var-update} list.
+
+@subsubheading Example
+
+@example
+(@value{GDBP})
+-var-assign var1 3
+^done,value="3"
+(@value{GDBP})
+-var-update *
+^done,changelist=[@{name="var1",in_scope="true",type_changed="false"@}]
+(@value{GDBP})
+@end example
@subheading The @code{-var-update} Command
@findex -var-update
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index b4bae47716d..74cb126af80 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -45,6 +45,7 @@ mi_cmd_stack_list_frames (char *command, char **argv, int argc)
int frame_low;
int frame_high;
int i;
+ struct cleanup *cleanup_stack;
struct frame_info *fi;
if (!target_has_stack)
@@ -76,7 +77,7 @@ mi_cmd_stack_list_frames (char *command, char **argv, int argc)
if (fi == NULL)
error ("mi_cmd_stack_list_frames: Not enough frames in stack.");
- ui_out_list_begin (uiout, "stack");
+ cleanup_stack = make_cleanup_ui_out_list_begin_end (uiout, "stack");
/* Now let;s print the frames up to frame_high, or until there are
frames in the stack. */
@@ -95,7 +96,7 @@ mi_cmd_stack_list_frames (char *command, char **argv, int argc)
0 /* args */ );
}
- ui_out_list_end (uiout);
+ do_cleanups (cleanup_stack);
if (i < frame_high)
error ("mi_cmd_stack_list_frames: Not enough frames in stack.");
@@ -155,6 +156,7 @@ mi_cmd_stack_list_args (char *command, char **argv, int argc)
int frame_high;
int i;
struct frame_info *fi;
+ struct cleanup *cleanup_stack_args;
if (argc < 1 || argc > 3 || argc == 2)
error ("mi_cmd_stack_list_args: Usage: PRINT_VALUES [FRAME_LOW FRAME_HIGH]");
@@ -182,7 +184,7 @@ mi_cmd_stack_list_args (char *command, char **argv, int argc)
if (fi == NULL)
error ("mi_cmd_stack_list_args: Not enough frames in stack.");
- ui_out_list_begin (uiout, "stack-args");
+ cleanup_stack_args = make_cleanup_ui_out_list_begin_end (uiout, "stack-args");
/* Now let's print the frames up to frame_high, or until there are
frames in the stack. */
@@ -190,14 +192,15 @@ mi_cmd_stack_list_args (char *command, char **argv, int argc)
fi && (i <= frame_high || frame_high == -1);
i++, fi = get_prev_frame (fi))
{
+ struct cleanup *cleanup_frame;
QUIT;
- ui_out_tuple_begin (uiout, "frame");
+ cleanup_frame = make_cleanup_ui_out_tuple_begin_end (uiout, "frame");
ui_out_field_int (uiout, "level", i);
list_args_or_locals (0, atoi (argv[0]), fi);
- ui_out_tuple_end (uiout);
+ do_cleanups (cleanup_frame);
}
- ui_out_list_end (uiout);
+ do_cleanups (cleanup_stack_args);
if (i < frame_high)
error ("mi_cmd_stack_list_args: Not enough frames in stack.");
@@ -214,13 +217,14 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
struct block *block;
struct symbol *sym;
int i, nsyms;
+ struct cleanup *cleanup_list;
static struct ui_stream *stb = NULL;
stb = ui_out_stream_new (uiout);
block = get_frame_block (fi, 0);
- ui_out_list_begin (uiout, locals ? "locals" : "args");
+ cleanup_list = make_cleanup_ui_out_list_begin_end (uiout, locals ? "locals" : "args");
while (block != 0)
{
@@ -262,8 +266,10 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
}
if (print_me)
{
+ struct cleanup *cleanup_tuple = NULL;
if (values)
- ui_out_tuple_begin (uiout, NULL);
+ cleanup_tuple =
+ make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
ui_out_field_string (uiout, "name", SYMBOL_NAME (sym));
if (values)
@@ -278,7 +284,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
sym2 = sym;
print_variable_value (sym2, fi, stb->stream);
ui_out_field_stream (uiout, "value", stb);
- ui_out_tuple_end (uiout);
+ do_cleanups (cleanup_tuple);
}
}
}
@@ -287,7 +293,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
else
block = BLOCK_SUPERBLOCK (block);
}
- ui_out_list_end (uiout);
+ do_cleanups (cleanup_list);
ui_out_stream_delete (stb);
}
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 114906609ef..990b2788ca1 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -81,7 +81,7 @@ mi_cmd_var_create (char *command, char **argv, int argc)
else
{
var_type = USE_SPECIFIED_FRAME;
- frameaddr = parse_and_eval_address (frame);
+ frameaddr = string_to_core_addr (frame);
}
if (varobjdebug)
@@ -254,6 +254,7 @@ mi_cmd_var_list_children (char *command, char **argv, int argc)
struct varobj *var;
struct varobj **childlist;
struct varobj **cc;
+ struct cleanup *cleanup_children;
int numchild;
char *type;
@@ -271,11 +272,12 @@ mi_cmd_var_list_children (char *command, char **argv, int argc)
if (numchild <= 0)
return MI_CMD_DONE;
- ui_out_tuple_begin (uiout, "children");
+ cleanup_children = make_cleanup_ui_out_tuple_begin_end (uiout, "children");
cc = childlist;
while (*cc != NULL)
{
- ui_out_tuple_begin (uiout, "child");
+ struct cleanup *cleanup_child;
+ cleanup_child = make_cleanup_ui_out_tuple_begin_end (uiout, "child");
ui_out_field_string (uiout, "name", varobj_get_objname (*cc));
ui_out_field_string (uiout, "exp", varobj_get_expression (*cc));
ui_out_field_int (uiout, "numchild", varobj_get_num_children (*cc));
@@ -283,10 +285,10 @@ mi_cmd_var_list_children (char *command, char **argv, int argc)
/* C++ pseudo-variables (public, private, protected) do not have a type */
if (type)
ui_out_field_string (uiout, "type", varobj_get_type (*cc));
- ui_out_tuple_end (uiout);
+ do_cleanups (cleanup_child);
cc++;
}
- ui_out_tuple_end (uiout);
+ do_cleanups (cleanup_children);
xfree (childlist);
return MI_CMD_DONE;
}
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 41775922def..8af91cc0bba 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -36,7 +36,7 @@
#include "event-loop.h"
#include "event-top.h"
#include "gdbcore.h" /* for write_memory() */
-#include "value.h" /* for write_register_bytes() */
+#include "value.h" /* for deprecated_write_register_bytes() */
#include "regcache.h"
#include "gdb.h"
#include "frame.h"
@@ -240,8 +240,12 @@ mi_cmd_thread_select (char *command, char **argv, int argc)
else
rc = gdb_thread_select (uiout, argv[0]);
- if (rc == GDB_RC_FAIL)
+ /* RC is enum gdb_rc if it is successful (>=0)
+ enum return_reason if not (<0). */
+ if ((int) rc < 0 && (enum return_reason) rc == RETURN_ERROR)
return MI_CMD_CAUGHT_ERROR;
+ else if ((int) rc >= 0 && rc == GDB_RC_FAIL)
+ return MI_CMD_ERROR;
else
return MI_CMD_DONE;
}
@@ -628,7 +632,7 @@ mi_cmd_data_write_register_values (char *command, char **argv, int argc)
old_chain = make_cleanup (xfree, buffer);
store_signed_integer (buffer, REGISTER_SIZE, value);
/* Write it down */
- write_register_bytes (REGISTER_BYTE (regnum), buffer, REGISTER_RAW_SIZE (regnum));
+ deprecated_write_register_bytes (REGISTER_BYTE (regnum), buffer, REGISTER_RAW_SIZE (regnum));
/* Free the buffer. */
do_cleanups (old_chain);
}
@@ -911,19 +915,22 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
/* Build the result as a two dimentional table. */
{
struct ui_stream *stream = ui_out_stream_new (uiout);
+ struct cleanup *cleanup_list_memory;
int row;
int row_byte;
- ui_out_list_begin (uiout, "memory");
+ cleanup_list_memory = make_cleanup_ui_out_list_begin_end (uiout, "memory");
for (row = 0, row_byte = 0;
row < nr_rows;
row++, row_byte += nr_cols * word_size)
{
int col;
int col_byte;
- ui_out_tuple_begin (uiout, NULL);
+ struct cleanup *cleanup_tuple;
+ struct cleanup *cleanup_list_data;
+ cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
ui_out_field_core_addr (uiout, "addr", addr + row_byte);
/* ui_out_field_core_addr_symbolic (uiout, "saddr", addr + row_byte); */
- ui_out_list_begin (uiout, "data");
+ cleanup_list_data = make_cleanup_ui_out_list_begin_end (uiout, "data");
for (col = 0, col_byte = row_byte;
col < nr_cols;
col++, col_byte += word_size)
@@ -940,7 +947,7 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
ui_out_field_stream (uiout, NULL, stream);
}
}
- ui_out_list_end (uiout);
+ do_cleanups (cleanup_list_data);
if (aschar)
{
int byte;
@@ -960,10 +967,10 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
}
ui_out_field_stream (uiout, "ascii", stream);
}
- ui_out_tuple_end (uiout);
+ do_cleanups (cleanup_tuple);
}
ui_out_stream_delete (stream);
- ui_out_list_end (uiout);
+ do_cleanups (cleanup_list_memory);
}
do_cleanups (cleanups);
return MI_CMD_DONE;
@@ -1415,17 +1422,18 @@ mi_load_progress (const char *section_name,
strcmp (previous_sect_name, section_name) : 1);
if (new_section)
{
+ struct cleanup *cleanup_tuple;
xfree (previous_sect_name);
previous_sect_name = xstrdup (section_name);
if (last_async_command)
fputs_unfiltered (last_async_command, raw_stdout);
fputs_unfiltered ("+download", raw_stdout);
- ui_out_tuple_begin (uiout, NULL);
+ cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
ui_out_field_string (uiout, "section", section_name);
ui_out_field_int (uiout, "section-size", total_section);
ui_out_field_int (uiout, "total-size", grand_total);
- ui_out_tuple_end (uiout);
+ do_cleanups (cleanup_tuple);
mi_out_put (uiout, raw_stdout);
fputs_unfiltered ("\n", raw_stdout);
gdb_flush (raw_stdout);
@@ -1434,18 +1442,19 @@ mi_load_progress (const char *section_name,
if (delta.tv_sec >= update_threshold.tv_sec &&
delta.tv_usec >= update_threshold.tv_usec)
{
+ struct cleanup *cleanup_tuple;
last_update.tv_sec = time_now.tv_sec;
last_update.tv_usec = time_now.tv_usec;
if (last_async_command)
fputs_unfiltered (last_async_command, raw_stdout);
fputs_unfiltered ("+download", raw_stdout);
- ui_out_tuple_begin (uiout, NULL);
+ cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
ui_out_field_string (uiout, "section", section_name);
ui_out_field_int (uiout, "section-sent", sent_so_far);
ui_out_field_int (uiout, "section-size", total_section);
ui_out_field_int (uiout, "total-sent", total_sent);
ui_out_field_int (uiout, "total-size", grand_total);
- ui_out_tuple_end (uiout);
+ do_cleanups (cleanup_tuple);
mi_out_put (uiout, raw_stdout);
fputs_unfiltered ("\n", raw_stdout);
gdb_flush (raw_stdout);
@@ -1455,12 +1464,16 @@ mi_load_progress (const char *section_name,
static void
mi_command_loop (int mi_version)
{
- /* HACK: Force stdout/stderr to point at the console. This avoids
- any potential side effects caused by legacy code that is still
- using the TUI / fputs_unfiltered_hook */
- raw_stdout = stdio_fileopen (stdout);
- /* Route normal output through the MIx */
- gdb_stdout = mi_console_file_new (raw_stdout, "~");
+ if (mi_version <= 1)
+ {
+ /* HACK: Force stdout/stderr to point at the console. This avoids
+ any potential side effects caused by legacy code that is still
+ using the TUI / fputs_unfiltered_hook */
+ raw_stdout = stdio_fileopen (stdout);
+ /* Route normal output through the MIx */
+ gdb_stdout = mi_console_file_new (raw_stdout, "~");
+ }
+
/* Route error and log output through the MI */
gdb_stderr = mi_console_file_new (raw_stdout, "&");
gdb_stdlog = gdb_stderr;
@@ -1532,8 +1545,16 @@ setup_architecture_data (void)
static void
mi_init_ui (char *arg0)
{
- /* Eventually this will contain code that takes control of the
- console. */
+ if (strlen (interpreter_p) <= 2 ||
+ interpreter_p[2] > '1')
+ {
+ /* HACK: Force stdout/stderr to point at the console. This avoids
+ any potential side effects caused by legacy code that is still
+ using the TUI / fputs_unfiltered_hook */
+ raw_stdout = stdio_fileopen (stdout);
+ /* Route normal output through the MIx */
+ gdb_stdout = mi_console_file_new (raw_stdout, "~");
+ }
}
void
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index 454520d35e7..a0469f6f9f3 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -29,6 +29,8 @@
int
mips_linux_cannot_fetch_register (int regno)
{
+ if (REGISTER_NAME (regno)[0] == 0)
+ return 1;
if (regno == PS_REGNUM)
return 1;
else if (regno == ZERO_REGNUM)
@@ -40,6 +42,8 @@ mips_linux_cannot_fetch_register (int regno)
int
mips_linux_cannot_store_register (int regno)
{
+ if (REGISTER_NAME (regno)[0] == 0)
+ return 1;
if (regno == PS_REGNUM)
return 1;
else if (regno == ZERO_REGNUM)
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 03279d8098a..9ad457b0352 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -132,7 +132,7 @@ fill_gregset (elf_gregset_t *gregsetp, int regno)
if (regno < 32)
{
- src = &registers[REGISTER_BYTE (regno)];
+ src = &deprecated_registers[REGISTER_BYTE (regno)];
dst = regp + regno + EF_REG0;
memcpy (dst, src, sizeof (elf_greg_t));
return;
@@ -163,7 +163,7 @@ fill_gregset (elf_gregset_t *gregsetp, int regno)
if (regaddr != -1)
{
- src = &registers[REGISTER_BYTE (regno)];
+ src = &deprecated_registers[REGISTER_BYTE (regno)];
dst = regp + regaddr;
memcpy (dst, src, sizeof (elf_greg_t));
}
@@ -199,13 +199,13 @@ fill_fpregset (elf_fpregset_t *fpregsetp, int regno)
if ((regno >= FP0_REGNUM) && (regno < FP0_REGNUM + 32))
{
- from = (char *) &registers[REGISTER_BYTE (regno)];
+ from = (char *) &deprecated_registers[REGISTER_BYTE (regno)];
to = (char *) (*fpregsetp + regno - FP0_REGNUM);
memcpy (to, from, REGISTER_RAW_SIZE (regno - FP0_REGNUM));
}
else if (regno == FCRCS_REGNUM)
{
- from = (char *) &registers[REGISTER_BYTE (regno)];
+ from = (char *) &deprecated_registers[REGISTER_BYTE (regno)];
to = (char *) (*fpregsetp + 32);
memcpy (to, from, REGISTER_RAW_SIZE (regno));
}
diff --git a/gdb/mips-nat.c b/gdb/mips-nat.c
index 545c74171c3..16009c2e545 100644
--- a/gdb/mips-nat.c
+++ b/gdb/mips-nat.c
@@ -76,7 +76,7 @@ fetch_inferior_registers (int regno)
char buf[MAX_REGISTER_RAW_SIZE];
register int i;
- registers_fetched ();
+ deprecated_registers_fetched ();
for (regno = 1; regno < NUM_REGS; regno++)
{
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index fd61c5ba49d..739e058536f 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -3718,7 +3718,7 @@ mips_push_register (CORE_ADDR * sp, int regno)
offset = 0;
}
*sp -= regsize;
- read_register_gen (regno, buffer);
+ deprecated_read_register_gen (regno, buffer);
write_memory (*sp, buffer + offset, regsize);
}
@@ -4666,17 +4666,15 @@ mips_eabi_store_return_value (struct type *valtype, char *valbuf)
memset (raw_buffer, 0, sizeof (raw_buffer));
memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len);
- write_register_bytes (REGISTER_BYTE (lo.reg),
- raw_buffer,
- REGISTER_RAW_SIZE (lo.reg));
+ deprecated_write_register_bytes (REGISTER_BYTE (lo.reg), raw_buffer,
+ REGISTER_RAW_SIZE (lo.reg));
if (hi.len > 0)
{
memset (raw_buffer, 0, sizeof (raw_buffer));
memcpy (raw_buffer + hi.reg_offset, valbuf + hi.buf_offset, hi.len);
- write_register_bytes (REGISTER_BYTE (hi.reg),
- raw_buffer,
- REGISTER_RAW_SIZE (hi.reg));
+ deprecated_write_register_bytes (REGISTER_BYTE (hi.reg), raw_buffer,
+ REGISTER_RAW_SIZE (hi.reg));
}
}
@@ -4690,17 +4688,15 @@ mips_o64_store_return_value (struct type *valtype, char *valbuf)
memset (raw_buffer, 0, sizeof (raw_buffer));
memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len);
- write_register_bytes (REGISTER_BYTE (lo.reg),
- raw_buffer,
- REGISTER_RAW_SIZE (lo.reg));
+ deprecated_write_register_bytes (REGISTER_BYTE (lo.reg), raw_buffer,
+ REGISTER_RAW_SIZE (lo.reg));
if (hi.len > 0)
{
memset (raw_buffer, 0, sizeof (raw_buffer));
memcpy (raw_buffer + hi.reg_offset, valbuf + hi.buf_offset, hi.len);
- write_register_bytes (REGISTER_BYTE (hi.reg),
- raw_buffer,
- REGISTER_RAW_SIZE (hi.reg));
+ deprecated_write_register_bytes (REGISTER_BYTE (hi.reg), raw_buffer,
+ REGISTER_RAW_SIZE (hi.reg));
}
}
@@ -6060,7 +6056,7 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_register_virtual_type (gdbarch, mips_register_virtual_type);
set_gdbarch_register_virtual_size (gdbarch, generic_register_size);
- set_gdbarch_do_registers_info (gdbarch, mips_do_registers_info);
+ set_gdbarch_deprecated_do_registers_info (gdbarch, mips_do_registers_info);
set_gdbarch_pc_in_sigtramp (gdbarch, mips_pc_in_sigtramp);
/* Hook in OS ABI-specific overrides, if they have been registered. */
@@ -6194,12 +6190,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
"mips_dump_tdep: CAUSE_REGNUM = %d\n",
CAUSE_REGNUM);
fprintf_unfiltered (file,
- "mips_dump_tdep: CPLUS_MARKER = %c\n",
- CPLUS_MARKER);
- fprintf_unfiltered (file,
- "mips_dump_tdep: DO_REGISTERS_INFO # %s\n",
- XSTRING (DO_REGISTERS_INFO));
- fprintf_unfiltered (file,
"mips_dump_tdep: DWARF_REG_TO_REGNUM # %s\n",
XSTRING (DWARF_REG_TO_REGNUM (REGNUM)));
fprintf_unfiltered (file,
diff --git a/gdb/mipsm3-nat.c b/gdb/mipsm3-nat.c
index 62d68600bc7..22f947f9db2 100644
--- a/gdb/mipsm3-nat.c
+++ b/gdb/mipsm3-nat.c
@@ -122,14 +122,14 @@ static int reg_offset[] =
* Caller knows that the regs handled in one transaction are of same size.
*/
#define FETCH_REGS(state, regnum, count) \
- memcpy (&registers[REGISTER_BYTE (regnum)], \
+ memcpy (&deprecated_registers[REGISTER_BYTE (regnum)], \
(char *)state+reg_offset[ regnum ], \
count*REGISTER_SIZE)
/* Store COUNT contiguous registers to thread STATE starting from REGNUM */
#define STORE_REGS(state, regnum, count) \
memcpy ((char *)state+reg_offset[ regnum ], \
- &registers[REGISTER_BYTE (regnum)], \
+ &deprecated_registers[REGISTER_BYTE (regnum)], \
count*REGISTER_SIZE)
#define REGS_ALL -1
@@ -204,7 +204,7 @@ fetch_inferior_registers (int regno)
}
/* ZERO_REGNUM is always zero */
- *(int *) registers = 0;
+ *(int *) deprecated_registers = 0;
/* Copy thread saved regs 1..31 to gdb's reg value array
* Luckily, they are contiquous
@@ -259,7 +259,7 @@ fetch_inferior_registers (int regno)
/* If the thread does not have saved COPROC1, set regs to zero */
if (!(exc_state.coproc_state & MIPS_STATUS_USE_COP1))
- bzero (&registers[REGISTER_BYTE (FP0_REGNUM)],
+ bzero (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
sizeof (struct mips_float_state));
else
{
@@ -282,7 +282,7 @@ fetch_inferior_registers (int regno)
}
/* All registers are valid, if not returned yet */
- registers_fetched ();
+ deprecated_registers_fetched ();
}
/* Store gdb's view of registers to the thread.
@@ -324,7 +324,7 @@ store_inferior_registers (register int regno)
/* Don't allow these to change */
/* ZERO_REGNUM */
- *(int *) registers = 0;
+ *(int *) deprecated_registers = 0;
fetch_inferior_registers (PS_REGNUM);
fetch_inferior_registers (BADVADDR_REGNUM);
@@ -342,8 +342,8 @@ store_inferior_registers (register int regno)
* should go to threads frame pointer. If not true, this
* fails badly!!!!!
*/
- memcpy (&registers[REGISTER_BYTE (MACH_FP_REGNUM)],
- &registers[REGISTER_BYTE (FP_REGNUM)],
+ memcpy (&deprecated_registers[REGISTER_BYTE (MACH_FP_REGNUM)],
+ &deprecated_registers[REGISTER_BYTE (FP_REGNUM)],
REGISTER_RAW_SIZE (FP_REGNUM));
#endif
diff --git a/gdb/mipsv4-nat.c b/gdb/mipsv4-nat.c
index 901f9b0e39f..ec46df60826 100644
--- a/gdb/mipsv4-nat.c
+++ b/gdb/mipsv4-nat.c
@@ -75,19 +75,19 @@ fill_gregset (gregset_t *gregsetp, int regno)
for (regi = 0; regi <= 32; regi++)
if ((regno == -1) || (regno == regi))
- *(regp + regi) = *(greg_t *) & registers[REGISTER_BYTE (regi)];
+ *(regp + regi) = *(greg_t *) & deprecated_registers[REGISTER_BYTE (regi)];
if ((regno == -1) || (regno == PC_REGNUM))
- *(regp + CXT_EPC) = *(greg_t *) & registers[REGISTER_BYTE (PC_REGNUM)];
+ *(regp + CXT_EPC) = *(greg_t *) & deprecated_registers[REGISTER_BYTE (PC_REGNUM)];
if ((regno == -1) || (regno == CAUSE_REGNUM))
- *(regp + CXT_CAUSE) = *(greg_t *) & registers[REGISTER_BYTE (CAUSE_REGNUM)];
+ *(regp + CXT_CAUSE) = *(greg_t *) & deprecated_registers[REGISTER_BYTE (CAUSE_REGNUM)];
if ((regno == -1) || (regno == HI_REGNUM))
- *(regp + CXT_MDHI) = *(greg_t *) & registers[REGISTER_BYTE (HI_REGNUM)];
+ *(regp + CXT_MDHI) = *(greg_t *) & deprecated_registers[REGISTER_BYTE (HI_REGNUM)];
if ((regno == -1) || (regno == LO_REGNUM))
- *(regp + CXT_MDLO) = *(greg_t *) & registers[REGISTER_BYTE (LO_REGNUM)];
+ *(regp + CXT_MDLO) = *(greg_t *) & deprecated_registers[REGISTER_BYTE (LO_REGNUM)];
}
/*
@@ -125,14 +125,14 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- from = (char *) &registers[REGISTER_BYTE (regi)];
+ from = (char *) &deprecated_registers[REGISTER_BYTE (regi)];
to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
memcpy (to, from, REGISTER_RAW_SIZE (regi));
}
}
if ((regno == -1) || (regno == FCRCS_REGNUM))
- fpregsetp->fp_csr = *(unsigned *) &registers[REGISTER_BYTE (FCRCS_REGNUM)];
+ fpregsetp->fp_csr = *(unsigned *) &deprecated_registers[REGISTER_BYTE (FCRCS_REGNUM)];
}
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 6e7bada4cad..ed55da92add 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -139,9 +139,11 @@ static void
mn10300_store_return_value (struct type *type, char *valbuf)
{
if (TYPE_CODE (type) == TYPE_CODE_PTR)
- write_register_bytes (REGISTER_BYTE (4), valbuf, TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (4), valbuf,
+ TYPE_LENGTH (type));
else
- write_register_bytes (REGISTER_BYTE (0), valbuf, TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (0), valbuf,
+ TYPE_LENGTH (type));
}
static struct frame_info *analyze_dummy_frame (CORE_ADDR, CORE_ADDR);
@@ -1148,7 +1150,7 @@ mn10300_gdbarch_init (struct gdbarch_info info,
set_gdbarch_register_virtual_size (gdbarch, mn10300_register_virtual_size);
set_gdbarch_register_virtual_type (gdbarch, mn10300_register_virtual_type);
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mn10300_dwarf2_reg_to_regnum);
- set_gdbarch_do_registers_info (gdbarch, mn10300_do_registers_info);
+ set_gdbarch_deprecated_do_registers_info (gdbarch, mn10300_do_registers_info);
set_gdbarch_sp_regnum (gdbarch, 8);
set_gdbarch_pc_regnum (gdbarch, 9);
set_gdbarch_fp_regnum (gdbarch, 31);
diff --git a/gdb/monitor.c b/gdb/monitor.c
index 559c0a2f372..5a9bb60f988 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -2294,19 +2294,10 @@ static struct target_ops monitor_ops;
static void
init_base_monitor_ops (void)
{
- monitor_ops.to_shortname = NULL;
- monitor_ops.to_longname = NULL;
- monitor_ops.to_doc = NULL;
- monitor_ops.to_open = NULL;
monitor_ops.to_close = monitor_close;
- monitor_ops.to_attach = NULL;
- monitor_ops.to_post_attach = NULL;
- monitor_ops.to_require_attach = NULL;
monitor_ops.to_detach = monitor_detach;
- monitor_ops.to_require_detach = NULL;
monitor_ops.to_resume = monitor_resume;
monitor_ops.to_wait = monitor_wait;
- monitor_ops.to_post_wait = NULL;
monitor_ops.to_fetch_registers = monitor_fetch_registers;
monitor_ops.to_store_registers = monitor_store_registers;
monitor_ops.to_prepare_to_store = monitor_prepare_to_store;
@@ -2314,48 +2305,18 @@ init_base_monitor_ops (void)
monitor_ops.to_files_info = monitor_files_info;
monitor_ops.to_insert_breakpoint = monitor_insert_breakpoint;
monitor_ops.to_remove_breakpoint = monitor_remove_breakpoint;
- monitor_ops.to_terminal_init = 0;
- monitor_ops.to_terminal_inferior = 0;
- monitor_ops.to_terminal_ours_for_output = 0;
- monitor_ops.to_terminal_ours = 0;
- monitor_ops.to_terminal_info = 0;
monitor_ops.to_kill = monitor_kill;
monitor_ops.to_load = monitor_load;
- monitor_ops.to_lookup_symbol = 0;
monitor_ops.to_create_inferior = monitor_create_inferior;
- monitor_ops.to_post_startup_inferior = NULL;
- monitor_ops.to_acknowledge_created_inferior = NULL;
- monitor_ops.to_clone_and_follow_inferior = NULL;
- monitor_ops.to_post_follow_inferior_by_clone = NULL;
- monitor_ops.to_insert_fork_catchpoint = NULL;
- monitor_ops.to_remove_fork_catchpoint = NULL;
- monitor_ops.to_insert_vfork_catchpoint = NULL;
- monitor_ops.to_remove_vfork_catchpoint = NULL;
- monitor_ops.to_has_forked = NULL;
- monitor_ops.to_has_vforked = NULL;
- monitor_ops.to_can_follow_vfork_prior_to_exec = NULL;
- monitor_ops.to_post_follow_vfork = NULL;
- monitor_ops.to_insert_exec_catchpoint = NULL;
- monitor_ops.to_remove_exec_catchpoint = NULL;
- monitor_ops.to_has_execd = NULL;
- monitor_ops.to_reported_exec_events_per_exec_call = NULL;
- monitor_ops.to_has_exited = NULL;
monitor_ops.to_mourn_inferior = monitor_mourn_inferior;
- monitor_ops.to_can_run = 0;
- monitor_ops.to_notice_signals = 0;
- monitor_ops.to_thread_alive = 0;
monitor_ops.to_stop = monitor_stop;
monitor_ops.to_rcmd = monitor_rcmd;
- monitor_ops.to_pid_to_exec_file = NULL;
monitor_ops.to_stratum = process_stratum;
- monitor_ops.DONT_USE = 0;
monitor_ops.to_has_all_memory = 1;
monitor_ops.to_has_memory = 1;
monitor_ops.to_has_stack = 1;
monitor_ops.to_has_registers = 1;
monitor_ops.to_has_execution = 1;
- monitor_ops.to_sections = 0;
- monitor_ops.to_sections_end = 0;
monitor_ops.to_magic = OPS_MAGIC;
} /* init_base_monitor_ops */
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index e60b1c0ef36..5563cf9b0c6 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -470,8 +470,9 @@ ns32k_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
static void
ns32k_store_return_value (struct type *valtype, char *valbuf)
{
- write_register_bytes (TYPE_CODE (valtype) == TYPE_CODE_FLT ?
- FP0_REGNUM : 0, valbuf, TYPE_LENGTH (valtype));
+ deprecated_write_register_bytes (TYPE_CODE (valtype) == TYPE_CODE_FLT
+ ? FP0_REGNUM : 0, valbuf,
+ TYPE_LENGTH (valtype));
}
static CORE_ADDR
diff --git a/gdb/ns32knbsd-nat.c b/gdb/ns32knbsd-nat.c
index fd6e6197efc..bf5250f4035 100644
--- a/gdb/ns32knbsd-nat.c
+++ b/gdb/ns32knbsd-nat.c
@@ -32,10 +32,10 @@
#include "regcache.h"
#define RF(dst, src) \
- memcpy(&registers[REGISTER_BYTE(dst)], &src, sizeof(src))
+ memcpy(&deprecated_registers[REGISTER_BYTE(dst)], &src, sizeof(src))
#define RS(src, dst) \
- memcpy(&dst, &registers[REGISTER_BYTE(src)], sizeof(dst))
+ memcpy(&dst, &deprecated_registers[REGISTER_BYTE(src)], sizeof(dst))
void
fetch_inferior_registers (int regno)
@@ -71,7 +71,7 @@ fetch_inferior_registers (int regno)
RF (LP0_REGNUM + 3, inferior_fpregisters.r_freg[3]);
RF (LP0_REGNUM + 5, inferior_fpregisters.r_freg[5]);
RF (LP0_REGNUM + 7, inferior_fpregisters.r_freg[7]);
- registers_fetched ();
+ deprecated_registers_fetched ();
}
void
@@ -164,7 +164,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
RF (LP0_REGNUM + 3, core_reg->freg.r_freg[3]);
RF (LP0_REGNUM + 5, core_reg->freg.r_freg[5]);
RF (LP0_REGNUM + 7, core_reg->freg.r_freg[7]);
- registers_fetched ();
+ deprecated_registers_fetched ();
}
/* Register that we are able to handle ns32knbsd core file formats.
@@ -237,7 +237,7 @@ fetch_kcore_registers (struct pcb *pcb)
RF (LP0_REGNUM + 3, pcb->pcb_freg[3]);
RF (LP0_REGNUM + 5, pcb->pcb_freg[5]);
RF (LP0_REGNUM + 7, pcb->pcb_freg[7]);
- registers_fetched ();
+ deprecated_registers_fetched ();
}
#endif /* FETCH_KCORE_REGISTERS */
diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y
index 54b99b00610..c1971f77a87 100644
--- a/gdb/objc-exp.y
+++ b/gdb/objc-exp.y
@@ -203,9 +203,6 @@ parse_number PARAMS ((char *, int, int, YYSTYPE *));
%token <opcode> ASSIGN_MODIFY
-/* C++ */
-%token THIS
-
%left ','
%left ABOVE_COMMA
%right '=' ASSIGN_MODIFY
@@ -613,14 +610,6 @@ exp : NSSTRING /* ObjC NextStep NSString constant
write_exp_elt_opcode (OP_NSSTRING); }
;
-/* C++. */
-exp : THIS
- { write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (OP_THIS); }
- ;
-
-/* end of C++. */
-
block : BLOCKNAME
{
if ($1.sym != 0)
@@ -986,7 +975,7 @@ name_not_typename : NAME
name_not_typename (=variable, =exp) or just an exp. If
name_not_typename was ever used in an lvalue context where only a
name could occur, this might be useful. */
- | NAME_OR_INT */
+/* | NAME_OR_INT */
;
%%
@@ -1631,18 +1620,6 @@ yylex ()
return ENUM;
if (STREQN (tokstart, "long", 4))
return LONG;
- if (current_language->la_language == language_cplus
- && STREQN (tokstart, "this", 4))
- {
- static const char this_name[] = {
- CPLUS_MARKER, 't', 'h', 'i', 's', '\0'
- };
-
- if (lookup_symbol (this_name, expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
- (struct symtab **) NULL))
- return THIS;
- }
break;
case 3:
if (STREQN (tokstart, "int", 3))
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index 0c749a2ebe5..7309d002534 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -74,11 +74,11 @@ struct objc_method {
/* Complaints about ObjC classes, selectors, etc. */
-static struct complaint noclass_lookup_complaint = {
+static struct deprecated_complaint noclass_lookup_complaint = {
"no way to lookup Objective-C classes", 0, 0
};
-static struct complaint nosel_lookup_complaint = {
+static struct deprecated_complaint nosel_lookup_complaint = {
"no way to lookup Objective-C selectors", 0, 0
};
@@ -1320,8 +1320,8 @@ find_methods (struct symtab *symtab, char type,
continue;
if (symtab)
- if ((SYMBOL_VALUE_ADDRESS (msymbol) < block->startaddr) ||
- (SYMBOL_VALUE_ADDRESS (msymbol) >= block->endaddr))
+ if ((SYMBOL_VALUE_ADDRESS (msymbol) < BLOCK_START (block)) ||
+ (SYMBOL_VALUE_ADDRESS (msymbol) >= BLOCK_END (block)))
/* Not in the specified symtab. */
continue;
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index f0939e7bbbf..cf521afb364 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -233,7 +233,8 @@ static int search_field;
start : { current_type = NULL;
search_field = 0;
}
- normal_start;
+ normal_start {}
+ ;
normal_start :
exp1
@@ -257,11 +258,13 @@ exp : exp '^' %prec UNARY
{ write_exp_elt_opcode (UNOP_IND);
if (current_type)
current_type = TYPE_TARGET_TYPE (current_type); }
+ ;
exp : '@' exp %prec UNARY
{ write_exp_elt_opcode (UNOP_ADDR);
if (current_type)
current_type = TYPE_POINTER_TYPE (current_type); }
+ ;
exp : '-' exp %prec UNARY
{ write_exp_elt_opcode (UNOP_NEG); }
@@ -317,6 +320,7 @@ exp : exp '['
write_exp_elt_opcode (BINOP_SUBSCRIPT);
if (current_type)
current_type = TYPE_TARGET_TYPE (current_type); }
+ ;
exp : exp '('
/* This is to save the value of arglist_len
@@ -645,7 +649,7 @@ variable: name_not_typename
if (this_type)
current_type = lookup_struct_elt_type (
this_type,
- $1.stoken.ptr, false);
+ copy_name($1.stoken), false);
else
current_type = NULL;
}
@@ -1358,8 +1362,7 @@ yylex ()
{
/* here we search for 'this' like
inserted in FPC stabs debug info */
- static const char this_name[] =
- { /* CPLUS_MARKER,*/ 't', 'h', 'i', 's', '\0' };
+ static const char this_name[] = "this";
if (lookup_symbol (this_name, expression_context_block,
VAR_NAMESPACE, (int *) NULL,
diff --git a/gdb/parse.c b/gdb/parse.c
index 29b8e3c3709..5d81dfd0e53 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -830,6 +830,11 @@ length_of_subexp (register struct expression *expr, register int endpos)
args = 1 + longest_to_int (expr->elts[endpos - 2].longconst);
break;
+ case OP_MSGCALL: /* Objective C message (method) call */
+ oplen = 4;
+ args = 1 + longest_to_int (expr->elts[endpos - 2].longconst);
+ break;
+
case UNOP_MAX:
case UNOP_MIN:
oplen = 3;
@@ -861,6 +866,8 @@ length_of_subexp (register struct expression *expr, register int endpos)
/* fall through */
case OP_M2_STRING:
case OP_STRING:
+ case OP_NSSTRING: /* Objective C Foundation Class NSString constant */
+ case OP_SELECTOR: /* Objective C "@selector" pseudo-op */
case OP_NAME:
case OP_EXPRSTRING:
oplen = longest_to_int (expr->elts[endpos - 2].longconst);
@@ -899,6 +906,7 @@ length_of_subexp (register struct expression *expr, register int endpos)
/* C++ */
case OP_THIS:
+ case OP_SELF:
oplen = 2;
break;
@@ -967,6 +975,11 @@ prefixify_subexp (register struct expression *inexpr,
args = 1 + longest_to_int (inexpr->elts[inend - 2].longconst);
break;
+ case OP_MSGCALL: /* Objective C message (method) call */
+ oplen = 4;
+ args = 1 + longest_to_int (inexpr->elts[inend - 2].longconst);
+ break;
+
case UNOP_MIN:
case UNOP_MAX:
oplen = 3;
@@ -997,6 +1010,8 @@ prefixify_subexp (register struct expression *inexpr,
/* fall through */
case OP_M2_STRING:
case OP_STRING:
+ case OP_NSSTRING: /* Objective C Foundation Class NSString constant */
+ case OP_SELECTOR: /* Objective C "@selector" pseudo-op */
case OP_NAME:
case OP_EXPRSTRING:
oplen = longest_to_int (inexpr->elts[inend - 2].longconst);
@@ -1035,6 +1050,7 @@ prefixify_subexp (register struct expression *inexpr,
/* C++ */
case OP_THIS:
+ case OP_SELF:
oplen = 2;
break;
@@ -1107,7 +1123,7 @@ parse_exp_1 (char **stringptr, struct block *block, int comma)
if (block)
{
expression_context_block = block;
- expression_context_pc = block->startaddr;
+ expression_context_pc = BLOCK_START (block);
}
else
expression_context_block = get_selected_block (&expression_context_pc);
diff --git a/gdb/ppc-bdm.c b/gdb/ppc-bdm.c
index 0797e0d64d2..9e7133e10ac 100644
--- a/gdb/ppc-bdm.c
+++ b/gdb/ppc-bdm.c
@@ -295,7 +295,7 @@ bdm_ppc_store_registers (int regno)
&& ((i < FP0_REGNUM) || (i > FPLAST_REGNUM)))
{
/* printf("write valid reg %d\n", bdm_regno); */
- ocd_write_bdm_registers (bdm_regno, registers + REGISTER_BYTE (i), 4);
+ ocd_write_bdm_registers (bdm_regno, deprecated_registers + REGISTER_BYTE (i), 4);
}
/*
else if (i == gdbarch_tdep (current_gdbarch)->ppc_mq_regnum)
@@ -321,14 +321,9 @@ a wiggler, specify wiggler and then the port it is connected to\n\
(e.g. wiggler lpt1)."; /* to_doc */
bdm_ppc_ops.to_open = bdm_ppc_open;
bdm_ppc_ops.to_close = ocd_close;
- bdm_ppc_ops.to_attach = NULL;
- bdm_ppc_ops.to_post_attach = NULL;
- bdm_ppc_ops.to_require_attach = NULL;
bdm_ppc_ops.to_detach = ocd_detach;
- bdm_ppc_ops.to_require_detach = NULL;
bdm_ppc_ops.to_resume = ocd_resume;
bdm_ppc_ops.to_wait = bdm_ppc_wait;
- bdm_ppc_ops.to_post_wait = NULL;
bdm_ppc_ops.to_fetch_registers = bdm_ppc_fetch_registers;
bdm_ppc_ops.to_store_registers = bdm_ppc_store_registers;
bdm_ppc_ops.to_prepare_to_store = ocd_prepare_to_store;
@@ -336,47 +331,18 @@ a wiggler, specify wiggler and then the port it is connected to\n\
bdm_ppc_ops.to_files_info = ocd_files_info;
bdm_ppc_ops.to_insert_breakpoint = ocd_insert_breakpoint;
bdm_ppc_ops.to_remove_breakpoint = ocd_remove_breakpoint;
- bdm_ppc_ops.to_terminal_init = NULL;
- bdm_ppc_ops.to_terminal_inferior = NULL;
- bdm_ppc_ops.to_terminal_ours_for_output = NULL;
- bdm_ppc_ops.to_terminal_ours = NULL;
- bdm_ppc_ops.to_terminal_info = NULL;
bdm_ppc_ops.to_kill = ocd_kill;
bdm_ppc_ops.to_load = ocd_load;
- bdm_ppc_ops.to_lookup_symbol = NULL;
bdm_ppc_ops.to_create_inferior = ocd_create_inferior;
- bdm_ppc_ops.to_post_startup_inferior = NULL;
- bdm_ppc_ops.to_acknowledge_created_inferior = NULL;
- bdm_ppc_ops.to_clone_and_follow_inferior = NULL;
- bdm_ppc_ops.to_post_follow_inferior_by_clone = NULL;
- bdm_ppc_ops.to_insert_fork_catchpoint = NULL;
- bdm_ppc_ops.to_remove_fork_catchpoint = NULL;
- bdm_ppc_ops.to_insert_vfork_catchpoint = NULL;
- bdm_ppc_ops.to_remove_vfork_catchpoint = NULL;
- bdm_ppc_ops.to_has_forked = NULL;
- bdm_ppc_ops.to_has_vforked = NULL;
- bdm_ppc_ops.to_can_follow_vfork_prior_to_exec = NULL;
- bdm_ppc_ops.to_post_follow_vfork = NULL;
- bdm_ppc_ops.to_insert_exec_catchpoint = NULL;
- bdm_ppc_ops.to_remove_exec_catchpoint = NULL;
- bdm_ppc_ops.to_has_execd = NULL;
- bdm_ppc_ops.to_reported_exec_events_per_exec_call = NULL;
- bdm_ppc_ops.to_has_exited = NULL;
bdm_ppc_ops.to_mourn_inferior = ocd_mourn;
- bdm_ppc_ops.to_can_run = 0;
- bdm_ppc_ops.to_notice_signals = 0;
bdm_ppc_ops.to_thread_alive = ocd_thread_alive;
bdm_ppc_ops.to_stop = ocd_stop;
- bdm_ppc_ops.to_pid_to_exec_file = NULL;
bdm_ppc_ops.to_stratum = process_stratum;
- bdm_ppc_ops.DONT_USE = NULL;
bdm_ppc_ops.to_has_all_memory = 1;
bdm_ppc_ops.to_has_memory = 1;
bdm_ppc_ops.to_has_stack = 1;
bdm_ppc_ops.to_has_registers = 1;
bdm_ppc_ops.to_has_execution = 1;
- bdm_ppc_ops.to_sections = NULL;
- bdm_ppc_ops.to_sections_end = NULL;
bdm_ppc_ops.to_magic = OPS_MAGIC;
} /* init_bdm_ppc_ops */
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index ecaed850cbf..1f01706ef03 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -175,7 +175,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
{
char val_buf[4];
store_address (val_buf, 4, struct_addr);
- memcpy (&registers[REGISTER_BYTE (greg)], val_buf, 4);
+ memcpy (&deprecated_registers[REGISTER_BYTE (greg)], val_buf, 4);
greg++;
}
/* Now fill in the registers and stack... */
@@ -192,7 +192,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
if (len > 8)
printf_unfiltered (
"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM + freg)],
+ memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM + freg)],
VALUE_CONTENTS (arg), len);
freg++;
}
@@ -222,9 +222,9 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
if ((greg & 1) == 0)
greg++;
- memcpy (&registers[REGISTER_BYTE (greg)],
+ memcpy (&deprecated_registers[REGISTER_BYTE (greg)],
VALUE_CONTENTS (arg), 4);
- memcpy (&registers[REGISTER_BYTE (greg + 1)],
+ memcpy (&deprecated_registers[REGISTER_BYTE (greg + 1)],
VALUE_CONTENTS (arg) + 4, 4);
greg += 2;
}
@@ -247,7 +247,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
}
if (greg <= 10)
{
- memcpy (&registers[REGISTER_BYTE (greg)], val_buf, 4);
+ memcpy (&deprecated_registers[REGISTER_BYTE (greg)], val_buf, 4);
greg++;
}
else
@@ -268,7 +268,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
memcpy (v_val_buf, VALUE_CONTENTS (arg), len);
if (vreg <= 13)
{
- memcpy (&registers[REGISTER_BYTE (tdep->ppc_vr0_regnum
+ memcpy (&deprecated_registers[REGISTER_BYTE (tdep->ppc_vr0_regnum
+ vreg)],
v_val_buf, 16);
vreg++;
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 8542b8a9a5b..f1a7fdd7f8b 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -41,6 +41,7 @@
#include "completer.h" /* for completion functions */
#include "ui-out.h"
#include "gdb_assert.h"
+#include "disasm.h"
extern int asm_demangle; /* Whether to demangle syms in asm printouts */
extern int addressprint; /* Whether to print hex addresses in HLL " */
@@ -136,8 +137,6 @@ static void enable_display (char *, int);
static void disable_display_command (char *, int);
-static void disassemble_command (char *, int);
-
static void printf_command (char *, int);
static void print_frame_nameless_args (struct frame_info *, long,
@@ -1104,7 +1103,11 @@ address_info (char *exp, int from_tty)
printf_filtered ("Symbol \"");
fprintf_symbol_filtered (gdb_stdout, exp,
current_language->la_language, DMGL_ANSI);
- printf_filtered ("\" is a field of the local class variable `this'\n");
+ printf_filtered ("\" is a field of the local class variable ");
+ if (current_language->la_language == language_objc)
+ printf_filtered ("`self'\n"); /* ObjC equivalent of "this" */
+ else
+ printf_filtered ("`this'\n");
return;
}
@@ -1275,12 +1278,18 @@ address_info (char *exp, int from_tty)
}
break;
- case LOC_THREAD_LOCAL_STATIC:
+ case LOC_HP_THREAD_LOCAL_STATIC:
printf_filtered (
"a thread-local variable at offset %ld from the thread base register %s",
val, REGISTER_NAME (basereg));
break;
+ case LOC_THREAD_LOCAL_STATIC:
+ printf_filtered ("a thread-local variable at offset %ld in the "
+ "thread-local storage for `%s'",
+ val, SYMBOL_OBJFILE (sym)->name);
+ break;
+
case LOC_OPTIMIZED_OUT:
printf_filtered ("optimized out");
break;
@@ -2260,114 +2269,6 @@ printf_command (char *arg, int from_tty)
}
do_cleanups (old_cleanups);
}
-
-/* Dump a specified section of assembly code. With no command line
- arguments, this command will dump the assembly code for the
- function surrounding the pc value in the selected frame. With one
- argument, it will dump the assembly code surrounding that pc value.
- Two arguments are interpeted as bounds within which to dump
- assembly. */
-
-/* ARGSUSED */
-static void
-disassemble_command (char *arg, int from_tty)
-{
- CORE_ADDR low, high;
- char *name;
- CORE_ADDR pc, pc_masked;
- char *space_index;
-#if 0
- asection *section;
-#endif
-
- name = NULL;
- if (!arg)
- {
- if (!selected_frame)
- error ("No frame selected.\n");
-
- pc = get_frame_pc (selected_frame);
- if (find_pc_partial_function (pc, &name, &low, &high) == 0)
- error ("No function contains program counter for selected frame.\n");
-#if defined(TUI)
- else if (tui_version)
- low = tuiGetLowDisassemblyAddress (low, pc);
-#endif
- low += FUNCTION_START_OFFSET;
- }
- else if (!(space_index = (char *) strchr (arg, ' ')))
- {
- /* One argument. */
- pc = parse_and_eval_address (arg);
- if (find_pc_partial_function (pc, &name, &low, &high) == 0)
- error ("No function contains specified address.\n");
-#if defined(TUI)
- else if (tui_version)
- low = tuiGetLowDisassemblyAddress (low, pc);
-#endif
- low += FUNCTION_START_OFFSET;
- }
- else
- {
- /* Two arguments. */
- *space_index = '\0';
- low = parse_and_eval_address (arg);
- high = parse_and_eval_address (space_index + 1);
- }
-
-#if defined(TUI)
- if (!tui_is_window_visible (DISASSEM_WIN))
-#endif
- {
- printf_filtered ("Dump of assembler code ");
- if (name != NULL)
- {
- printf_filtered ("for function %s:\n", name);
- }
- else
- {
- printf_filtered ("from ");
- print_address_numeric (low, 1, gdb_stdout);
- printf_filtered (" to ");
- print_address_numeric (high, 1, gdb_stdout);
- printf_filtered (":\n");
- }
-
- /* Dump the specified range. */
- pc = low;
-
-#ifdef GDB_TARGET_MASK_DISAS_PC
- pc_masked = GDB_TARGET_MASK_DISAS_PC (pc);
-#else
- pc_masked = pc;
-#endif
-
- while (pc_masked < high)
- {
- QUIT;
- print_address (pc_masked, gdb_stdout);
- printf_filtered (":\t");
- /* We often wrap here if there are long symbolic names. */
- wrap_here (" ");
- pc += print_insn (pc, gdb_stdout);
- printf_filtered ("\n");
-
-#ifdef GDB_TARGET_MASK_DISAS_PC
- pc_masked = GDB_TARGET_MASK_DISAS_PC (pc);
-#else
- pc_masked = pc;
-#endif
- }
- printf_filtered ("End of assembler dump.\n");
- gdb_flush (gdb_stdout);
- }
-#if defined(TUI)
- else
- {
- tui_show_assembly (low);
- }
-#endif
-}
/* Print the instruction at address MEMADDR in debugged memory,
on STREAM. Returns length of the instruction, in bytes. */
@@ -2417,15 +2318,6 @@ Defaults for format and size letters are those previously used.\n\
Default count is 1. Default address is following last thing printed\n\
with this command or \"print\".", NULL));
- c = add_com ("disassemble", class_vars, disassemble_command,
- "Disassemble a specified section of memory.\n\
-Default is the function surrounding the pc of the selected frame.\n\
-With a single argument, the function surrounding that address is dumped.\n\
-Two arguments are taken as a range of memory to dump.");
- set_cmd_completer (c, location_completer);
- if (xdb_commands)
- add_com_alias ("va", "disassemble", class_xdb, 0);
-
#if 0
add_com ("whereis", class_vars, whereis_command,
"Print line number and file of definition of variable.");
diff --git a/gdb/ptx4-nat.c b/gdb/ptx4-nat.c
index 65eef9d3518..1798b509f30 100644
--- a/gdb/ptx4-nat.c
+++ b/gdb/ptx4-nat.c
@@ -59,7 +59,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- (*gregsetp)[regi] = *(greg_t *) & registers[REGISTER_BYTE (regi)];
+ (*gregsetp)[regi] = *(greg_t *) & deprecated_registers[REGISTER_BYTE (regi)];
}
}
}
diff --git a/gdb/regcache.c b/gdb/regcache.c
index ab65c67a47b..1bbdb61b95f 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -26,6 +26,7 @@
#include "gdbarch.h"
#include "gdbcmd.h"
#include "regcache.h"
+#include "reggroups.h"
#include "gdb_assert.h"
#include "gdb_string.h"
#include "gdbcmd.h" /* For maintenanceprintlist. */
@@ -65,6 +66,8 @@ struct regcache_descr
both raw registers and memory by the architecture methods
gdbarch_register_read and gdbarch_register_write. */
int nr_cooked_registers;
+ long sizeof_cooked_registers;
+ long sizeof_cooked_register_valid_p;
/* Offset and size (in 8 bit bytes), of reach register in the
register cache. All registers (including those in the range
@@ -92,20 +95,28 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch,
gdb_assert (gdbarch != NULL);
/* FIXME: cagney/2002-05-11: Shouldn't be including pseudo-registers
- in the register buffer. Unfortunatly some architectures do. */
+ in the register cache. Unfortunatly some architectures still
+ rely on this and the pseudo_register_write() method. */
descr->nr_raw_registers = descr->nr_cooked_registers;
- descr->sizeof_raw_register_valid_p = descr->nr_cooked_registers;
-
- /* FIXME: cagney/2002-05-11: Instead of using REGISTER_BYTE() this
- code should compute the offets et.al. at runtime. This currently
- isn't possible because some targets overlap register locations -
- see the mess in read_register_bytes() and write_register_bytes()
- registers. */
+ descr->sizeof_raw_register_valid_p = descr->sizeof_cooked_register_valid_p;
+
+ /* Compute the offset of each register. Legacy architectures define
+ REGISTER_BYTE() so use that. */
+ /* FIXME: cagney/2002-11-07: Instead of using REGISTER_BYTE() this
+ code should, as is done in init_regcache_descr(), compute the
+ offets at runtime. This currently isn't possible as some ISAs
+ define overlapping register regions - see the mess in
+ read_register_bytes() and write_register_bytes() registers. */
descr->sizeof_register = XCALLOC (descr->nr_cooked_registers, long);
descr->register_offset = XCALLOC (descr->nr_cooked_registers, long);
descr->max_register_size = 0;
for (i = 0; i < descr->nr_cooked_registers; i++)
{
+ /* FIXME: cagney/2001-12-04: This code shouldn't need to use
+ REGISTER_BYTE(). Unfortunatly, legacy code likes to lay the
+ buffer out so that certain registers just happen to overlap.
+ Ulgh! New targets use gdbarch's register read/write and
+ entirely avoid this uglyness. */
descr->register_offset[i] = REGISTER_BYTE (i);
descr->sizeof_register[i] = REGISTER_RAW_SIZE (i);
if (descr->max_register_size < REGISTER_RAW_SIZE (i))
@@ -114,8 +125,13 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch,
descr->max_register_size = REGISTER_VIRTUAL_SIZE (i);
}
- /* Come up with the real size of the registers buffer. */
- descr->sizeof_raw_registers = REGISTER_BYTES; /* OK use. */
+ /* Compute the real size of the register buffer. Start out by
+ trusting REGISTER_BYTES, but then adjust it upwards should that
+ be found to not be sufficient. */
+ /* FIXME: cagney/2002-11-05: Instead of using REGISTER_BYTES, this
+ code should, as is done in init_regcache_descr(), compute the
+ total number of register bytes using the accumulated offsets. */
+ descr->sizeof_cooked_registers = REGISTER_BYTES; /* OK use. */
for (i = 0; i < descr->nr_cooked_registers; i++)
{
long regend;
@@ -124,15 +140,14 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch,
legacy code is free to put registers in random places in the
buffer separated by holes. Once REGISTER_BYTE() is killed
this can be greatly simplified. */
- /* FIXME: cagney/2001-12-04: This code shouldn't need to use
- REGISTER_BYTE(). Unfortunatly, legacy code likes to lay the
- buffer out so that certain registers just happen to overlap.
- Ulgh! New targets use gdbarch's register read/write and
- entirely avoid this uglyness. */
regend = descr->register_offset[i] + descr->sizeof_register[i];
- if (descr->sizeof_raw_registers < regend)
- descr->sizeof_raw_registers = regend;
+ if (descr->sizeof_cooked_registers < regend)
+ descr->sizeof_cooked_registers = regend;
}
+ /* FIXME: cagney/2002-05-11: Shouldn't be including pseudo-registers
+ in the register cache. Unfortunatly some architectures still
+ rely on this and the pseudo_register_write() method. */
+ descr->sizeof_raw_registers = descr->sizeof_cooked_registers;
}
static void *
@@ -150,6 +165,7 @@ init_regcache_descr (struct gdbarch *gdbarch)
directly onto the raw register cache while the pseudo's are
either mapped onto raw-registers or memory. */
descr->nr_cooked_registers = NUM_REGS + NUM_PSEUDO_REGS;
+ descr->sizeof_cooked_register_valid_p = NUM_REGS + NUM_PSEUDO_REGS;
/* Fill in a table of register types. */
descr->register_type = XCALLOC (descr->nr_cooked_registers,
@@ -177,12 +193,9 @@ init_regcache_descr (struct gdbarch *gdbarch)
array. This pretects GDB from erant code that accesses elements
of the global register_valid_p[] array in the range [NUM_REGS
.. NUM_REGS + NUM_PSEUDO_REGS). */
- descr->sizeof_raw_register_valid_p = NUM_REGS + NUM_PSEUDO_REGS;
+ descr->sizeof_raw_register_valid_p = descr->sizeof_cooked_register_valid_p;
- /* Lay out the register cache. The pseud-registers are included in
- the layout even though their value isn't stored in the register
- cache. Some code, via read_register_bytes() access a register
- using an offset/length rather than a register number.
+ /* Lay out the register cache.
NOTE: cagney/2002-05-22: Only register_type() is used when
constructing the register cache. It is assumed that the
@@ -203,15 +216,16 @@ init_regcache_descr (struct gdbarch *gdbarch)
descr->max_register_size = descr->sizeof_register[i];
}
/* Set the real size of the register cache buffer. */
- /* FIXME: cagney/2002-05-22: Should only need to allocate space
- for the raw registers. Unfortunatly some code still accesses
- the register array directly using the global registers[].
- Until that code has been purged, play safe and over allocating
- the register buffer. Ulgh! */
- descr->sizeof_raw_registers = offset;
- /* = descr->register_offset[descr->nr_raw_registers]; */
+ descr->sizeof_cooked_registers = offset;
}
+ /* FIXME: cagney/2002-05-22: Should only need to allocate space for
+ the raw registers. Unfortunatly some code still accesses the
+ register array directly using the global registers[]. Until that
+ code has been purged, play safe and over allocating the register
+ buffer. Ulgh! */
+ descr->sizeof_raw_registers = descr->sizeof_cooked_registers;
+
#if 0
/* Sanity check. Confirm that the assumptions about gdbarch are
true. The REGCACHE_DESCR_HANDLE is set before doing the checks
@@ -276,11 +290,18 @@ max_register_size (struct gdbarch *gdbarch)
struct regcache
{
struct regcache_descr *descr;
- char *raw_registers;
- char *raw_register_valid_p;
- /* If a value isn't in the cache should the corresponding target be
- queried for a value. */
- int passthrough_p;
+ /* The register buffers. A read-only register cache can hold the
+ full [0 .. NUM_REGS + NUM_PSEUDO_REGS) while a read/write
+ register cache can only hold [0 .. NUM_REGS). */
+ char *registers;
+ char *register_valid_p;
+ /* Is this a read-only cache? A read-only cache is used for saving
+ the target's register state (e.g, across an inferior function
+ call or just before forcing a function return). A read-only
+ cache can only be updated via the methods regcache_dup() and
+ regcache_cpy(). The actual contents are determined by the
+ reggroup_save and reggroup_restore methods. */
+ int readonly_p;
};
struct regcache *
@@ -292,11 +313,11 @@ regcache_xmalloc (struct gdbarch *gdbarch)
descr = regcache_descr (gdbarch);
regcache = XMALLOC (struct regcache);
regcache->descr = descr;
- regcache->raw_registers
+ regcache->registers
= XCALLOC (descr->sizeof_raw_registers, char);
- regcache->raw_register_valid_p
+ regcache->register_valid_p
= XCALLOC (descr->sizeof_raw_register_valid_p, char);
- regcache->passthrough_p = 0;
+ regcache->readonly_p = 1;
return regcache;
}
@@ -305,8 +326,8 @@ regcache_xfree (struct regcache *regcache)
{
if (regcache == NULL)
return;
- xfree (regcache->raw_registers);
- xfree (regcache->raw_register_valid_p);
+ xfree (regcache->registers);
+ xfree (regcache->register_valid_p);
xfree (regcache);
}
@@ -322,6 +343,68 @@ make_cleanup_regcache_xfree (struct regcache *regcache)
return make_cleanup (do_regcache_xfree, regcache);
}
+/* Return a pointer to register REGNUM's buffer cache. */
+
+static char *
+register_buffer (struct regcache *regcache, int regnum)
+{
+ return regcache->registers + regcache->descr->register_offset[regnum];
+}
+
+void
+regcache_save (struct regcache *dst, struct regcache *src)
+{
+ struct gdbarch *gdbarch = dst->descr->gdbarch;
+ int regnum;
+ /* The SRC and DST register caches had better belong to the same
+ architecture. */
+ gdb_assert (src->descr->gdbarch == dst->descr->gdbarch);
+ /* The DST should be `read-only', if it wasn't then the save would
+ end up trying to write the register values out through to the
+ target. */
+ gdb_assert (!src->readonly_p);
+ gdb_assert (dst->readonly_p);
+ /* Clear the dest. */
+ memset (dst->registers, 0, dst->descr->sizeof_cooked_registers);
+ memset (dst->register_valid_p, 0, dst->descr->sizeof_cooked_register_valid_p);
+ /* Copy over any registers (identified by their membership in the
+ save_reggroup) and mark them as valid. The full [0
+ .. NUM_REGS+NUM_PSEUDO_REGS) range is checked since some
+ architectures need to save/restore `cooked' registers that live
+ in memory. */
+ for (regnum = 0; regnum < dst->descr->nr_cooked_registers; regnum++)
+ {
+ if (gdbarch_register_reggroup_p (gdbarch, regnum, save_reggroup))
+ {
+ regcache_cooked_read (src, regnum, register_buffer (dst, regnum));
+ dst->register_valid_p[regnum] = 1;
+ }
+ }
+}
+
+void
+regcache_restore (struct regcache *dst, struct regcache *src)
+{
+ struct gdbarch *gdbarch = dst->descr->gdbarch;
+ int regnum;
+ gdb_assert (src->descr->gdbarch == dst->descr->gdbarch);
+ gdb_assert (!dst->readonly_p);
+ gdb_assert (src->readonly_p);
+ /* Copy over any registers, being careful to only restore those that
+ were both saved and need to be restored. The full [0
+ .. NUM_REGS+NUM_PSEUDO_REGS) range is checked since some
+ architectures need to save/restore `cooked' registers that live
+ in memory. */
+ for (regnum = 0; regnum < src->descr->nr_cooked_registers; regnum++)
+ {
+ if (gdbarch_register_reggroup_p (gdbarch, regnum, restore_reggroup)
+ && src->register_valid_p[regnum])
+ {
+ regcache_cooked_write (dst, regnum, register_buffer (src, regnum));
+ }
+ }
+}
+
void
regcache_cpy (struct regcache *dst, struct regcache *src)
{
@@ -330,33 +413,13 @@ regcache_cpy (struct regcache *dst, struct regcache *src)
gdb_assert (src != NULL && dst != NULL);
gdb_assert (src->descr->gdbarch == dst->descr->gdbarch);
gdb_assert (src != dst);
- /* FIXME: cagney/2002-05-17: To say this bit is bad is being polite.
- It keeps the existing code working where things rely on going
- through to the register cache. */
- if (src == current_regcache && src->descr->legacy_p)
- {
- /* ULGH!!!! Old way. Use REGISTER bytes and let code below
- untangle fetch. */
- read_register_bytes (0, dst->raw_registers, REGISTER_BYTES);
- return;
- }
- /* FIXME: cagney/2002-05-17: To say this bit is bad is being polite.
- It keeps the existing code working where things rely on going
- through to the register cache. */
- if (dst == current_regcache && dst->descr->legacy_p)
- {
- /* ULGH!!!! Old way. Use REGISTER bytes and let code below
- untangle fetch. */
- write_register_bytes (0, src->raw_registers, REGISTER_BYTES);
- return;
- }
- buf = alloca (src->descr->max_register_size);
- for (i = 0; i < src->descr->nr_raw_registers; i++)
- {
- /* Should we worry about the valid bit here? */
- regcache_raw_read (src, i, buf);
- regcache_raw_write (dst, i, buf);
- }
+ gdb_assert (src->readonly_p || dst->readonly_p);
+ if (!src->readonly_p)
+ regcache_save (dst, src);
+ else if (!dst->readonly_p)
+ regcache_restore (dst, src);
+ else
+ regcache_cpy_no_passthrough (dst, src);
}
void
@@ -369,9 +432,8 @@ regcache_cpy_no_passthrough (struct regcache *dst, struct regcache *src)
move of data into the current_regcache(). Doing this would be
silly - it would mean that valid_p would be completly invalid. */
gdb_assert (dst != current_regcache);
- memcpy (dst->raw_registers, src->raw_registers,
- dst->descr->sizeof_raw_registers);
- memcpy (dst->raw_register_valid_p, src->raw_register_valid_p,
+ memcpy (dst->registers, src->registers, dst->descr->sizeof_raw_registers);
+ memcpy (dst->register_valid_p, src->register_valid_p,
dst->descr->sizeof_raw_register_valid_p);
}
@@ -400,24 +462,24 @@ regcache_valid_p (struct regcache *regcache, int regnum)
{
gdb_assert (regcache != NULL);
gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
- return regcache->raw_register_valid_p[regnum];
+ return regcache->register_valid_p[regnum];
}
char *
deprecated_grub_regcache_for_registers (struct regcache *regcache)
{
- return regcache->raw_registers;
+ return regcache->registers;
}
char *
deprecated_grub_regcache_for_register_valid (struct regcache *regcache)
{
- return regcache->raw_register_valid_p;
+ return regcache->register_valid_p;
}
/* Global structure containing the current regcache. */
/* FIXME: cagney/2002-05-11: The two global arrays registers[] and
- register_valid[] currently point into this structure. */
+ deprecated_register_valid[] currently point into this structure. */
struct regcache *current_regcache;
/* NOTE: this is a write-through cache. There is no "dirty" bit for
@@ -427,9 +489,9 @@ struct regcache *current_regcache;
/* REGISTERS contains the cached register values (in target byte order). */
-char *registers;
+char *deprecated_registers;
-/* REGISTER_VALID is 0 if the register needs to be fetched,
+/* DEPRECATED_REGISTER_VALID is 0 if the register needs to be fetched,
1 if it has been fetched, and
-1 if the register value was not available.
@@ -440,7 +502,7 @@ char *registers;
system being debugged - some of the registers in such a system may
not have been saved. */
-signed char *register_valid;
+signed char *deprecated_register_valid;
/* The thread/process associated with the current set of registers. */
@@ -459,7 +521,7 @@ static ptid_t registers_ptid;
int
register_cached (int regnum)
{
- return register_valid[regnum];
+ return deprecated_register_valid[regnum];
}
/* Record that REGNUM's value is cached if STATE is >0, uncached but
@@ -470,25 +532,7 @@ set_register_cached (int regnum, int state)
{
gdb_assert (regnum >= 0);
gdb_assert (regnum < current_regcache->descr->nr_raw_registers);
- current_regcache->raw_register_valid_p[regnum] = state;
-}
-
-/* REGISTER_CHANGED
-
- invalidate a single register REGNUM in the cache */
-void
-register_changed (int regnum)
-{
- set_register_cached (regnum, 0);
-}
-
-/* If REGNUM >= 0, return a pointer to register REGNUM's cache buffer area,
- else return a pointer to the start of the cache buffer. */
-
-static char *
-register_buffer (struct regcache *regcache, int regnum)
-{
- return regcache->raw_registers + regcache->descr->register_offset[regnum];
+ current_regcache->register_valid_p[regnum] = state;
}
/* Return whether register REGNUM is a real register. */
@@ -531,7 +575,7 @@ registers_changed (void)
registers_changed_hook ();
}
-/* REGISTERS_FETCHED ()
+/* DEPRECATED_REGISTERS_FETCHED ()
Indicate that all registers have been fetched, so mark them all valid. */
@@ -544,7 +588,7 @@ registers_changed (void)
this function/hack is eliminated. */
void
-registers_fetched (void)
+deprecated_registers_fetched (void)
{
int i;
@@ -554,29 +598,29 @@ registers_fetched (void)
Fetching all real regs NEVER accounts for pseudo-regs. */
}
-/* read_register_bytes and write_register_bytes are generally a *BAD*
- idea. They are inefficient because they need to check for partial
- updates, which can only be done by scanning through all of the
- registers and seeing if the bytes that are being read/written fall
- inside of an invalid register. [The main reason this is necessary
- is that register sizes can vary, so a simple index won't suffice.]
- It is far better to call read_register_gen and write_register_gen
- if you want to get at the raw register contents, as it only takes a
- regnum as an argument, and therefore can't do a partial register
- update.
+/* deprecated_read_register_bytes and deprecated_write_register_bytes
+ are generally a *BAD* idea. They are inefficient because they need
+ to check for partial updates, which can only be done by scanning
+ through all of the registers and seeing if the bytes that are being
+ read/written fall inside of an invalid register. [The main reason
+ this is necessary is that register sizes can vary, so a simple
+ index won't suffice.] It is far better to call read_register_gen
+ and write_register_gen if you want to get at the raw register
+ contents, as it only takes a regnum as an argument, and therefore
+ can't do a partial register update.
Prior to the recent fixes to check for partial updates, both read
- and write_register_bytes always checked to see if any registers
- were stale, and then called target_fetch_registers (-1) to update
- the whole set. This caused really slowed things down for remote
- targets. */
+ and deprecated_write_register_bytes always checked to see if any
+ registers were stale, and then called target_fetch_registers (-1)
+ to update the whole set. This caused really slowed things down for
+ remote targets. */
/* Copy INLEN bytes of consecutive data from registers
starting with the INREGBYTE'th byte of register data
into memory at MYADDR. */
void
-read_register_bytes (int in_start, char *in_buf, int in_len)
+deprecated_read_register_bytes (int in_start, char *in_buf, int in_len)
{
int in_end = in_start + in_len;
int regnum;
@@ -604,7 +648,7 @@ read_register_bytes (int in_start, char *in_buf, int in_len)
if (REGISTER_NAME (regnum) != NULL && *REGISTER_NAME (regnum) != '\0')
/* Force the cache to fetch the entire register. */
- read_register_gen (regnum, reg_buf);
+ deprecated_read_register_gen (regnum, reg_buf);
else
/* Legacy note: even though this register is ``invalid'' we
still need to return something. It would appear that some
@@ -613,7 +657,7 @@ read_register_bytes (int in_start, char *in_buf, int in_len)
/* FIXME: cagney/2001-08-18: This is just silly. It defeats
the entire register read/write flow of control. Must
resist temptation to return 0xdeadbeef. */
- memcpy (reg_buf, registers + reg_start, reg_len);
+ memcpy (reg_buf, &deprecated_registers[reg_start], reg_len);
/* Legacy note: This function, for some reason, allows a NULL
input buffer. If the buffer is NULL, the registers are still
@@ -669,12 +713,12 @@ regcache_raw_read (struct regcache *regcache, int regnum, void *buf)
gdb_assert (regcache != NULL && buf != NULL);
gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
if (regcache->descr->legacy_p
- && regcache->passthrough_p)
+ && !regcache->readonly_p)
{
gdb_assert (regcache == current_regcache);
/* For moment, just use underlying legacy code. Ulgh!!! This
silently and very indirectly updates the regcache's regcache
- via the global register_valid[]. */
+ via the global deprecated_register_valid[]. */
legacy_read_register_gen (regnum, buf);
return;
}
@@ -682,7 +726,7 @@ regcache_raw_read (struct regcache *regcache, int regnum, void *buf)
to the current thread. This switching shouldn't be necessary
only there is still only one target side register cache. Sigh!
On the bright side, at least there is a regcache object. */
- if (regcache->passthrough_p)
+ if (!regcache->readonly_p)
{
gdb_assert (regcache == current_regcache);
if (! ptid_equal (registers_ptid, inferior_ptid))
@@ -694,8 +738,7 @@ regcache_raw_read (struct regcache *regcache, int regnum, void *buf)
target_fetch_registers (regnum);
}
/* Copy the value directly into the register cache. */
- memcpy (buf, (regcache->raw_registers
- + regcache->descr->register_offset[regnum]),
+ memcpy (buf, register_buffer (regcache, regnum),
regcache->descr->sizeof_register[regnum]);
}
@@ -748,7 +791,7 @@ regcache_raw_write_unsigned (struct regcache *regcache, int regnum,
}
void
-read_register_gen (int regnum, char *buf)
+deprecated_read_register_gen (int regnum, char *buf)
{
gdb_assert (current_regcache != NULL);
gdb_assert (current_regcache->descr->gdbarch == current_gdbarch);
@@ -767,6 +810,12 @@ regcache_cooked_read (struct regcache *regcache, int regnum, void *buf)
gdb_assert (regnum < regcache->descr->nr_cooked_registers);
if (regnum < regcache->descr->nr_raw_registers)
regcache_raw_read (regcache, regnum, buf);
+ else if (regcache->readonly_p
+ && regnum < regcache->descr->nr_cooked_registers
+ && regcache->register_valid_p[regnum])
+ /* Read-only register cache, perhaphs the cooked value was cached? */
+ memcpy (buf, register_buffer (regcache, regnum),
+ regcache->descr->sizeof_register[regnum]);
else
gdbarch_pseudo_register_read (regcache->descr->gdbarch, regcache,
regnum, buf);
@@ -843,13 +892,13 @@ regcache_raw_write (struct regcache *regcache, int regnum, const void *buf)
{
gdb_assert (regcache != NULL && buf != NULL);
gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+ gdb_assert (!regcache->readonly_p);
- if (regcache->passthrough_p
- && regcache->descr->legacy_p)
+ if (regcache->descr->legacy_p)
{
/* For moment, just use underlying legacy code. Ulgh!!! This
silently and very indirectly updates the regcache's buffers
- via the globals register_valid[] and registers[]. */
+ via the globals deprecated_register_valid[] and registers[]. */
gdb_assert (regcache == current_regcache);
legacy_write_register_gen (regnum, buf);
return;
@@ -860,17 +909,6 @@ regcache_raw_write (struct regcache *regcache, int regnum, const void *buf)
if (CANNOT_STORE_REGISTER (regnum))
return;
- /* Handle the simple case first -> not write through so just store
- value in cache. */
- if (!regcache->passthrough_p)
- {
- memcpy ((regcache->raw_registers
- + regcache->descr->register_offset[regnum]), buf,
- regcache->descr->sizeof_register[regnum]);
- regcache->raw_register_valid_p[regnum] = 1;
- return;
- }
-
/* Make certain that the correct cache is selected. */
gdb_assert (regcache == current_regcache);
if (! ptid_equal (registers_ptid, inferior_ptid))
@@ -889,12 +927,12 @@ regcache_raw_write (struct regcache *regcache, int regnum, const void *buf)
target_prepare_to_store ();
memcpy (register_buffer (regcache, regnum), buf,
regcache->descr->sizeof_register[regnum]);
- regcache->raw_register_valid_p[regnum] = 1;
+ regcache->register_valid_p[regnum] = 1;
target_store_registers (regnum);
}
void
-write_register_gen (int regnum, char *buf)
+deprecated_write_register_gen (int regnum, char *buf)
{
gdb_assert (current_regcache != NULL);
gdb_assert (current_regcache->descr->gdbarch == current_gdbarch);
@@ -922,7 +960,7 @@ regcache_cooked_write (struct regcache *regcache, int regnum, const void *buf)
into registers starting with the MYREGSTART'th byte of register data. */
void
-write_register_bytes (int myregstart, char *myaddr, int inlen)
+deprecated_write_register_bytes (int myregstart, char *myaddr, int inlen)
{
int myregend = myregstart + inlen;
int regnum;
@@ -947,7 +985,7 @@ write_register_bytes (int myregstart, char *myaddr, int inlen)
/* Is this register completely within the range the user is writing? */
else if (myregstart <= regstart && regend <= myregend)
- write_register_gen (regnum, myaddr + (regstart - myregstart));
+ deprecated_write_register_gen (regnum, myaddr + (regstart - myregstart));
/* The register partially overlaps the range being written. */
else
@@ -960,9 +998,9 @@ write_register_bytes (int myregstart, char *myaddr, int inlen)
/* We may be doing a partial update of an invalid register.
Update it from the target before scribbling on it. */
- read_register_gen (regnum, regbuf);
+ deprecated_read_register_gen (regnum, regbuf);
- memcpy (registers + overlapstart,
+ memcpy (&deprecated_registers[overlapstart],
myaddr + (overlapstart - myregstart),
overlapend - overlapstart);
@@ -1063,91 +1101,13 @@ register_offset_hack (struct gdbarch *gdbarch, int regnum)
return descr->register_offset[regnum];
}
-static void
-cooked_xfer_using_offset_hack (struct regcache *regcache,
- int buf_start, int buf_len, void *in_b,
- const void *out_b)
-{
- struct regcache_descr *descr = regcache->descr;
- struct gdbarch *gdbarch = descr->gdbarch;
- bfd_byte *in_buf = in_b;
- const bfd_byte *out_buf = out_b;
- int buf_end = buf_start + buf_len;
- int regnum;
- char *reg_buf = alloca (descr->max_register_size);
-
- /* NOTE: cagney/2002-08-17: This code assumes that the register
- offsets are strictly increasing and do not overlap. If this
- isn't the case then the bug is in the target architecture and NOT
- this code. */
-
- /* NOTE: cagney/2002-08-17: This code assumes that only the
- registers covered by BUF_START:BUF_LEN should be transfered. If,
- for some reason, there is a gap between two registers, then that
- gap isn't transfered. (The gap shouldn't be there but that is
- another story.) */
-
- /* Iterate through all registers looking for those that lie within
- BUF_START:BUF_LEN. */
-
- for (regnum = 0; regnum < descr->nr_cooked_registers; regnum++)
- {
- /* The register's location. */
- int reg_start = descr->register_offset[regnum];
- int reg_len = descr->sizeof_register[regnum];
- int reg_end = reg_start + reg_len;
-
- /* The START, END and LEN that falls within the current
- register. */
- int xfer_start;
- int xfer_end;
- int xfer_len;
-
- /* start = max (reg_start, buf_start) */
- if (reg_start > buf_start)
- xfer_start = reg_start;
- else
- xfer_start = buf_start;
-
- /* end = min (reg_end, buf_end) */
- if (reg_end < buf_end)
- xfer_end = reg_end;
- else
- xfer_end = buf_end;
-
- /* The number of bytes to transfer. If there isn't anything to
- transfer (the end is before the start) this will be -ve. */
- xfer_len = xfer_end - xfer_start;
-
- if (xfer_len > 0)
- regcache_xfer_part (regcache, regnum, xfer_start - reg_start,
- xfer_len, in_b, out_b, regcache_cooked_read,
- regcache_cooked_write);
- }
-}
-
-void
-regcache_cooked_read_using_offset_hack (struct regcache *regcache,
- int buf_start, int buf_len, void *b)
-{
- cooked_xfer_using_offset_hack (regcache, buf_start, buf_len, b, NULL);
-}
-
-void
-regcache_cooked_write_using_offset_hack (struct regcache *regcache,
- int buf_start, int buf_len,
- const void *b)
-{
- cooked_xfer_using_offset_hack (regcache, buf_start, buf_len, NULL, b);
-}
-
/* Return the contents of register REGNUM as an unsigned integer. */
ULONGEST
read_register (int regnum)
{
char *buf = alloca (REGISTER_RAW_SIZE (regnum));
- read_register_gen (regnum, buf);
+ deprecated_read_register_gen (regnum, buf);
return (extract_unsigned_integer (buf, REGISTER_RAW_SIZE (regnum)));
}
@@ -1178,7 +1138,7 @@ LONGEST
read_signed_register (int regnum)
{
void *buf = alloca (REGISTER_RAW_SIZE (regnum));
- read_register_gen (regnum, buf);
+ deprecated_read_register_gen (regnum, buf);
return (extract_signed_integer (buf, REGISTER_RAW_SIZE (regnum)));
}
@@ -1212,7 +1172,7 @@ write_register (int regnum, LONGEST val)
size = REGISTER_RAW_SIZE (regnum);
buf = alloca (size);
store_signed_integer (buf, size, (LONGEST) val);
- write_register_gen (regnum, buf);
+ deprecated_write_register_gen (regnum, buf);
}
void
@@ -1452,9 +1412,9 @@ static void
build_regcache (void)
{
current_regcache = regcache_xmalloc (current_gdbarch);
- current_regcache->passthrough_p = 1;
- registers = deprecated_grub_regcache_for_registers (current_regcache);
- register_valid = deprecated_grub_regcache_for_register_valid (current_regcache);
+ current_regcache->readonly_p = 0;
+ deprecated_registers = deprecated_grub_regcache_for_registers (current_regcache);
+ deprecated_register_valid = deprecated_grub_regcache_for_register_valid (current_regcache);
}
static void
@@ -1479,7 +1439,7 @@ dump_endian_bytes (struct ui_file *file, enum bfd_endian endian,
enum regcache_dump_what
{
- regcache_dump_none, regcache_dump_raw, regcache_dump_cooked
+ regcache_dump_none, regcache_dump_raw, regcache_dump_cooked, regcache_dump_groups
};
static void
@@ -1487,6 +1447,8 @@ regcache_dump (struct regcache *regcache, struct ui_file *file,
enum regcache_dump_what what_to_dump)
{
struct cleanup *cleanups = make_cleanup (null_cleanup, NULL);
+ struct gdbarch *gdbarch = regcache->descr->gdbarch;
+ struct reggroup *const *groups = reggroups (gdbarch);
int regnum;
int footnote_nr = 0;
int footnote_register_size = 0;
@@ -1593,27 +1555,32 @@ regcache_dump (struct regcache *regcache, struct ui_file *file,
}
/* Type. */
- if (regnum < 0)
- fprintf_unfiltered (file, " %-20s", "Type");
- else
- {
- static const char blt[] = "builtin_type";
- const char *t = TYPE_NAME (register_type (regcache->descr->gdbarch,
- regnum));
- if (t == NULL)
- {
- char *n;
- if (!footnote_register_type_name_null)
- footnote_register_type_name_null = ++footnote_nr;
- xasprintf (&n, "*%d", footnote_register_type_name_null);
- make_cleanup (xfree, n);
- t = n;
- }
- /* Chop a leading builtin_type. */
- if (strncmp (t, blt, strlen (blt)) == 0)
- t += strlen (blt);
- fprintf_unfiltered (file, " %-20s", t);
- }
+ {
+ const char *t;
+ if (regnum < 0)
+ t = "Type";
+ else
+ {
+ static const char blt[] = "builtin_type";
+ t = TYPE_NAME (register_type (regcache->descr->gdbarch, regnum));
+ if (t == NULL)
+ {
+ char *n;
+ if (!footnote_register_type_name_null)
+ footnote_register_type_name_null = ++footnote_nr;
+ xasprintf (&n, "*%d", footnote_register_type_name_null);
+ make_cleanup (xfree, n);
+ t = n;
+ }
+ /* Chop a leading builtin_type. */
+ if (strncmp (t, blt, strlen (blt)) == 0)
+ t += strlen (blt);
+ }
+ fprintf_unfiltered (file, " %-15s", t);
+ }
+
+ /* Leading space always present. */
+ fprintf_unfiltered (file, " ");
/* Value, raw. */
if (what_to_dump == regcache_dump_raw)
@@ -1647,6 +1614,26 @@ regcache_dump (struct regcache *regcache, struct ui_file *file,
}
}
+ /* Group members. */
+ if (what_to_dump == regcache_dump_groups)
+ {
+ if (regnum < 0)
+ fprintf_unfiltered (file, "Groups");
+ else
+ {
+ int i;
+ const char *sep = "";
+ for (i = 0; groups[i] != NULL; i++)
+ {
+ if (gdbarch_register_reggroup_p (gdbarch, regnum, groups[i]))
+ {
+ fprintf_unfiltered (file, "%s%s", sep, reggroup_name (groups[i]));
+ sep = ",";
+ }
+ }
+ }
+ }
+
fprintf_unfiltered (file, "\n");
}
@@ -1696,14 +1683,20 @@ maintenance_print_cooked_registers (char *args, int from_tty)
regcache_print (args, regcache_dump_cooked);
}
+static void
+maintenance_print_register_groups (char *args, int from_tty)
+{
+ regcache_print (args, regcache_dump_groups);
+}
+
void
_initialize_regcache (void)
{
regcache_descr_handle = register_gdbarch_data (init_regcache_descr,
xfree_regcache_descr);
REGISTER_GDBARCH_SWAP (current_regcache);
- register_gdbarch_swap (&registers, sizeof (registers), NULL);
- register_gdbarch_swap (&register_valid, sizeof (register_valid), NULL);
+ register_gdbarch_swap (&deprecated_registers, sizeof (deprecated_registers), NULL);
+ register_gdbarch_swap (&deprecated_register_valid, sizeof (deprecated_register_valid), NULL);
register_gdbarch_swap (NULL, 0, build_regcache);
add_com ("flushregs", class_maintenance, reg_flush_command,
@@ -1728,5 +1721,10 @@ Takes an optional file parameter.",
"Print the internal register configuration including cooked values.\
Takes an optional file parameter.",
&maintenanceprintlist);
+ add_cmd ("register-groups", class_maintenance,
+ maintenance_print_register_groups,
+ "Print the internal register configuration including each register's group.\
+Takes an optional file parameter.",
+ &maintenanceprintlist);
}
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 4ddcda38104..de6a321620c 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -94,29 +94,14 @@ extern void regcache_collect (int regnum, void *buf);
/* The register's ``offset''.
- NOTE: cagney/2002-08-17: The ``struct value'' and expression
- evaluator treat the register cache as a large liner buffer.
- Instead of reading/writing a register using its register number,
- the code read/writes registers by specifying their offset into the
- buffer and a number of bytes. The code also assumes that these
- byte read/writes can cross register boundaries, adjacent registers
- treated as a contiguous set of bytes.
-
- The below map that model onto the real register cache. New code
- should go out of their way to avoid using these interfaces.
-
- FIXME: cagney/2002-08-17: The ``struct value'' and expression
- evaluator should be fixed. Instead of using the { offset, length }
- pair to describe a value within one or more registers, the code
- should use a chain of { regnum, offset, len } tripples. */
+ FIXME: cagney/2002-11-07: The get_saved_register() function, when
+ specifying the real location of a register, does so using that
+ registers offset in the register cache. That offset is then used
+ by valops.c to determine the location of the register. The code
+ should instead use the register's number and a location expression
+ to describe a value spread across multiple registers or memory. */
extern int register_offset_hack (struct gdbarch *gdbarch, int regnum);
-extern void regcache_cooked_read_using_offset_hack (struct regcache *regcache,
- int offset, int len,
- void *buf);
-extern void regcache_cooked_write_using_offset_hack (struct regcache *regcache,
- int offset, int len,
- const void *buf);
/* The type of a register. This function is slightly more efficient
@@ -144,16 +129,15 @@ extern struct type *register_type (struct gdbarch *gdbarch, int regnum);
extern int max_register_size (struct gdbarch *gdbarch);
-/* DEPRECATED: Character array containing an image of the inferior
- programs' registers for the most recently referenced thread. */
+/* Save/restore a register cache. The registers saved/restored is
+ determined by the save_reggroup and restore_reggroup (although you
+ can't restore a register that wasn't saved as well :-). You can
+ only save to a read-only cache (default from regcache_xmalloc())
+ from a live cache and you can only restore from a read-only cache
+ to a live cache. */
-extern char *registers;
-
-/* DEPRECATED: Character array containing the current state of each
- register (unavailable<0, invalid=0, valid>0) for the most recently
- referenced thread. */
-
-extern signed char *register_valid;
+extern void regcache_save (struct regcache *dst, struct regcache *src);
+extern void regcache_restore (struct regcache *dst, struct regcache *src);
/* Copy/duplicate the contents of a register cache. By default, the
operation is pass-through. Writes to DST and reads from SRC will
@@ -169,26 +153,59 @@ extern struct regcache *regcache_dup_no_passthrough (struct regcache *regcache);
extern void regcache_cpy (struct regcache *dest, struct regcache *src);
extern void regcache_cpy_no_passthrough (struct regcache *dest, struct regcache *src);
+/* NOTE: cagney/2002-11-02: The below have been superseded by the
+ regcache_cooked_*() functions found above, and the frame_*()
+ functions found in "frame.h". Take care though, often more than a
+ simple substitution is required when updating the code. The
+ change, as far as practical, should avoid adding references to
+ global variables (e.g., current_regcache, current_frame,
+ current_gdbarch or selected_frame) and instead refer to the FRAME
+ or REGCACHE that has been passed into the containing function as
+ parameters. Consequently, the change typically involves modifying
+ the containing function so that it takes a FRAME or REGCACHE
+ parameter. In the case of an architecture vector method, there
+ should already be a non-deprecated variant that is parameterized
+ with FRAME or REGCACHE. */
+
extern char *deprecated_grub_regcache_for_registers (struct regcache *);
extern char *deprecated_grub_regcache_for_register_valid (struct regcache *);
+extern void deprecated_read_register_gen (int regnum, char *myaddr);
+extern void deprecated_write_register_gen (int regnum, char *myaddr);
+extern void deprecated_read_register_bytes (int regbyte, char *myaddr,
+ int len);
+extern void deprecated_write_register_bytes (int regbyte, char *myaddr,
+ int len);
+
+/* Character array containing the current state of each register
+ (unavailable<0, invalid=0, valid>0) for the most recently
+ referenced thread. This global is often found in close proximity
+ to code that is directly manipulating the deprecated_registers[]
+ array. In such cases, it should be possible to replace the lot
+ with a call to supply_register(). If you find yourself in dire
+ straits, still needing access to the cache status bit, the
+ regcache_valid_p() and set_register_cached() functions are
+ available. */
+extern signed char *deprecated_register_valid;
+
+/* Character array containing an image of the inferior programs'
+ registers for the most recently referenced thread.
+
+ NOTE: cagney/2002-11-14: Target side code should be using
+ supply_register() and/or regcache_collect() while architecture side
+ code should use the more generic regcache methods. */
+
+extern char *deprecated_registers;
+
+/* NOTE: cagney/2002-11-05: This function, and its co-conspirator
+ deprecated_registers[], have been superseeded by supply_register(). */
+extern void deprecated_registers_fetched (void);
extern int register_cached (int regnum);
extern void set_register_cached (int regnum, int state);
-extern void register_changed (int regnum);
-
extern void registers_changed (void);
-extern void registers_fetched (void);
-
-extern void read_register_bytes (int regbyte, char *myaddr, int len);
-
-extern void read_register_gen (int regnum, char *myaddr);
-
-extern void write_register_gen (int regnum, char *myaddr);
-
-extern void write_register_bytes (int regbyte, char *myaddr, int len);
/* Rename to read_unsigned_register()? */
extern ULONGEST read_register (int regnum);
diff --git a/gdb/reggroups.c b/gdb/reggroups.c
new file mode 100644
index 00000000000..8c3cbb76128
--- /dev/null
+++ b/gdb/reggroups.c
@@ -0,0 +1,268 @@
+/* Register groupings for GDB, the GNU debugger.
+
+ Copyright 2002 Free Software Foundation, Inc.
+
+ Contributed by Red Hat.
+
+ This file is part of GDB.
+
+ 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 "defs.h"
+#include "reggroups.h"
+#include "gdbtypes.h"
+#include "gdb_assert.h"
+#include "regcache.h"
+#include "command.h"
+#include "gdbcmd.h" /* For maintenanceprintlist. */
+
+/* Individual register groups. */
+
+struct reggroup
+{
+ const char *name;
+ enum reggroup_type type;
+};
+
+struct reggroup *
+reggroup_new (const char *name, enum reggroup_type type)
+{
+ struct reggroup *group = XMALLOC (struct reggroup);
+ group->name = name;
+ group->type = type;
+ return group;
+}
+
+/* Register group attributes. */
+
+const char *
+reggroup_name (struct reggroup *group)
+{
+ return group->name;
+}
+
+enum reggroup_type
+reggroup_type (struct reggroup *group)
+{
+ return group->type;
+}
+
+/* All the groups for a given architecture. */
+
+struct reggroups
+{
+ int nr_group;
+ struct reggroup **group;
+};
+
+static struct gdbarch_data *reggroups_data;
+
+static void *
+reggroups_init (struct gdbarch *gdbarch)
+{
+ struct reggroups *groups = XMALLOC (struct reggroups);
+ groups->nr_group = 0;
+ groups->group = NULL;
+ return groups;
+}
+
+static void
+reggroups_free (struct gdbarch *gdbarch, void *data)
+{
+ struct reggroups *groups = data;
+ xfree (groups->group);
+ xfree (groups);
+}
+
+/* Add a register group (with attribute values) to the pre-defined
+ list. This function can be called during architecture
+ initialization and hence needs to handle NULL architecture groups. */
+
+static void
+add_group (struct reggroups *groups, struct reggroup *group)
+{
+ gdb_assert (group != NULL);
+ groups->nr_group++;
+ groups->group = xrealloc (groups->group, (sizeof (struct reggroup *)
+ * (groups->nr_group + 1)));
+ groups->group[groups->nr_group - 1] = group;
+ groups->group[groups->nr_group] = NULL;
+}
+
+void
+reggroup_add (struct gdbarch *gdbarch, struct reggroup *group)
+{
+ struct reggroups *groups = gdbarch_data (gdbarch, reggroups_data);
+ if (groups == NULL)
+ {
+ /* ULGH, called during architecture initialization. Patch
+ things up. */
+ groups = reggroups_init (gdbarch);
+ set_gdbarch_data (gdbarch, reggroups_data, groups);
+ }
+ add_group (groups, group);
+}
+
+/* The register groups for the current architecture. Mumble something
+ about the lifetime of the buffer.... */
+
+static struct reggroups *default_groups;
+
+struct reggroup * const*
+reggroups (struct gdbarch *gdbarch)
+{
+ struct reggroups *groups = gdbarch_data (gdbarch, reggroups_data);
+ /* Don't allow this function to be called during architecture
+ creation. */
+ gdb_assert (groups != NULL);
+ if (groups->group == NULL)
+ return default_groups->group;
+ else
+ return groups->group;
+}
+
+/* Is REGNUM a member of REGGROUP? */
+int
+default_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
+ struct reggroup *group)
+{
+ int vector_p;
+ int float_p;
+ int raw_p;
+ if (REGISTER_NAME (regnum) == NULL
+ || *REGISTER_NAME (regnum) == '\0')
+ return 0;
+ if (group == all_reggroup)
+ return 1;
+ vector_p = TYPE_VECTOR (register_type (gdbarch, regnum));
+ float_p = TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_FLT;
+ raw_p = regnum < gdbarch_num_regs (gdbarch);
+ if (group == float_reggroup)
+ return float_p;
+ if (group == vector_reggroup)
+ return vector_p;
+ if (group == general_reggroup)
+ return (!vector_p && !float_p);
+ if (group == save_reggroup || group == restore_reggroup)
+ return raw_p;
+ return 0;
+}
+
+/* Dump out a table of register groups for the current architecture. */
+
+static void
+reggroups_dump (struct gdbarch *gdbarch, struct ui_file *file)
+{
+ struct reggroup *const *groups = reggroups (gdbarch);
+ int i = -1;
+ do
+ {
+ /* Group name. */
+ {
+ const char *name;
+ if (i < 0)
+ name = "Group";
+ else
+ name = reggroup_name (groups[i]);
+ fprintf_unfiltered (file, " %-10s", name);
+ }
+
+ /* Group type. */
+ {
+ const char *type;
+ if (i < 0)
+ type = "Type";
+ else
+ {
+ switch (reggroup_type (groups[i]))
+ {
+ case USER_REGGROUP:
+ type = "user";
+ break;
+ case INTERNAL_REGGROUP:
+ type = "internal";
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
+ }
+ fprintf_unfiltered (file, " %-10s", type);
+ }
+
+ /* Note: If you change this, be sure to also update the
+ documentation. */
+
+ fprintf_unfiltered (file, "\n");
+ i++;
+ }
+ while (groups[i] != NULL);
+}
+
+static void
+maintenance_print_reggroups (char *args, int from_tty)
+{
+ if (args == NULL)
+ reggroups_dump (current_gdbarch, gdb_stdout);
+ else
+ {
+ struct ui_file *file = gdb_fopen (args, "w");
+ if (file == NULL)
+ perror_with_name ("maintenance print reggroups");
+ reggroups_dump (current_gdbarch, file);
+ ui_file_delete (file);
+ }
+}
+
+/* Pre-defined register groups. */
+static struct reggroup general_group = { "general", USER_REGGROUP };
+static struct reggroup float_group = { "float", USER_REGGROUP };
+static struct reggroup system_group = { "system", USER_REGGROUP };
+static struct reggroup vector_group = { "vector", USER_REGGROUP };
+static struct reggroup all_group = { "all", USER_REGGROUP };
+static struct reggroup save_group = { "save", INTERNAL_REGGROUP };
+static struct reggroup restore_group = { "restore", INTERNAL_REGGROUP };
+
+struct reggroup *const general_reggroup = &general_group;
+struct reggroup *const float_reggroup = &float_group;
+struct reggroup *const system_reggroup = &system_group;
+struct reggroup *const vector_reggroup = &vector_group;
+struct reggroup *const all_reggroup = &all_group;
+struct reggroup *const save_reggroup = &save_group;
+struct reggroup *const restore_reggroup = &restore_group;
+
+void
+_initialize_reggroup (void)
+{
+ reggroups_data = register_gdbarch_data (reggroups_init, reggroups_free);
+
+ /* The pre-defined list of groups. */
+ default_groups = reggroups_init (NULL);
+ add_group (default_groups, general_reggroup);
+ add_group (default_groups, float_reggroup);
+ add_group (default_groups, system_reggroup);
+ add_group (default_groups, vector_reggroup);
+ add_group (default_groups, all_reggroup);
+ add_group (default_groups, save_reggroup);
+ add_group (default_groups, restore_reggroup);
+
+
+ add_cmd ("reggroups", class_maintenance,
+ maintenance_print_reggroups, "\
+Print the internal register group names.\n\
+Takes an optional file parameter.",
+ &maintenanceprintlist);
+
+}
diff --git a/gdb/reggroups.h b/gdb/reggroups.h
new file mode 100644
index 00000000000..0088a8520e3
--- /dev/null
+++ b/gdb/reggroups.h
@@ -0,0 +1,61 @@
+/* Register groupings for GDB, the GNU debugger.
+
+ Copyright 2002 Free Software Foundation, Inc.
+
+ Contributed by Red Hat.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef REGGROUPS_H
+#define REGGROUPS_H
+
+struct gdbarch;
+struct reggroup;
+
+enum reggroup_type { USER_REGGROUP, INTERNAL_REGGROUP };
+
+/* Pre-defined, user visible, register groups. */
+extern struct reggroup *const general_reggroup;
+extern struct reggroup *const float_reggroup;
+extern struct reggroup *const system_reggroup;
+extern struct reggroup *const vector_reggroup;
+extern struct reggroup *const all_reggroup;
+
+/* Pre-defined, internal, register groups. */
+extern struct reggroup *const save_reggroup;
+extern struct reggroup *const restore_reggroup;
+
+/* Create a new local register group. */
+extern struct reggroup *reggroup_new (const char *name,
+ enum reggroup_type type);
+
+/* Add a register group (with attribute values) to the pre-defined list. */
+extern void reggroup_add (struct gdbarch *gdbarch, struct reggroup *group);
+
+/* Register group attributes. */
+extern const char *reggroup_name (struct reggroup *reggroup);
+extern enum reggroup_type reggroup_type (struct reggroup *reggroup);
+
+/* The register groups for the current architecture. */
+extern struct reggroup *const *reggroups (struct gdbarch *gdbarch);
+
+/* Is REGNUM a member of REGGROUP? */
+extern int default_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
+ struct reggroup *reggroup);
+
+#endif
diff --git a/gdb/remote-array.c b/gdb/remote-array.c
index ed0c40e4436..da9bfc70e68 100644
--- a/gdb/remote-array.c
+++ b/gdb/remote-array.c
@@ -115,14 +115,9 @@ init_array_ops (void)
Specify the serial device it is connected to (e.g. /dev/ttya).";
array_ops.to_open = array_open;
array_ops.to_close = array_close;
- array_ops.to_attach = NULL;
- array_ops.to_post_attach = NULL;
- array_ops.to_require_attach = NULL;
array_ops.to_detach = array_detach;
- array_ops.to_require_detach = NULL;
array_ops.to_resume = array_resume;
array_ops.to_wait = array_wait;
- array_ops.to_post_wait = NULL;
array_ops.to_fetch_registers = array_fetch_registers;
array_ops.to_store_registers = array_store_registers;
array_ops.to_prepare_to_store = array_prepare_to_store;
@@ -130,47 +125,15 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
array_ops.to_files_info = array_files_info;
array_ops.to_insert_breakpoint = array_insert_breakpoint;
array_ops.to_remove_breakpoint = array_remove_breakpoint;
- array_ops.to_terminal_init = 0;
- array_ops.to_terminal_inferior = 0;
- array_ops.to_terminal_ours_for_output = 0;
- array_ops.to_terminal_ours = 0;
- array_ops.to_terminal_info = 0;
array_ops.to_kill = array_kill;
- array_ops.to_load = 0;
- array_ops.to_lookup_symbol = 0;
array_ops.to_create_inferior = array_create_inferior;
- array_ops.to_post_startup_inferior = NULL;
- array_ops.to_acknowledge_created_inferior = NULL;
- array_ops.to_clone_and_follow_inferior = NULL;
- array_ops.to_post_follow_inferior_by_clone = NULL;
- array_ops.to_insert_fork_catchpoint = NULL;
- array_ops.to_remove_fork_catchpoint = NULL;
- array_ops.to_insert_vfork_catchpoint = NULL;
- array_ops.to_remove_vfork_catchpoint = NULL;
- array_ops.to_has_forked = NULL;
- array_ops.to_has_vforked = NULL;
- array_ops.to_can_follow_vfork_prior_to_exec = NULL;
- array_ops.to_post_follow_vfork = NULL;
- array_ops.to_insert_exec_catchpoint = NULL;
- array_ops.to_remove_exec_catchpoint = NULL;
- array_ops.to_has_execd = NULL;
- array_ops.to_reported_exec_events_per_exec_call = NULL;
- array_ops.to_has_exited = NULL;
array_ops.to_mourn_inferior = array_mourn_inferior;
- array_ops.to_can_run = 0;
- array_ops.to_notice_signals = 0;
- array_ops.to_thread_alive = 0;
- array_ops.to_stop = 0;
- array_ops.to_pid_to_exec_file = NULL;
array_ops.to_stratum = process_stratum;
- array_ops.DONT_USE = 0;
array_ops.to_has_all_memory = 1;
array_ops.to_has_memory = 1;
array_ops.to_has_stack = 1;
array_ops.to_has_registers = 1;
array_ops.to_has_execution = 1;
- array_ops.to_sections = 0;
- array_ops.to_sections_end = 0;
array_ops.to_magic = OPS_MAGIC;
};
diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c
index d9cf5e8bba9..33e5c00f0f8 100644
--- a/gdb/remote-e7000.c
+++ b/gdb/remote-e7000.c
@@ -2143,14 +2143,9 @@ target e7000 /dev/ttya 9600\n\
target e7000 foobar";
e7000_ops.to_open = e7000_open;
e7000_ops.to_close = e7000_close;
- e7000_ops.to_attach = 0;
- e7000_ops.to_post_attach = NULL;
- e7000_ops.to_require_attach = NULL;
e7000_ops.to_detach = e7000_detach;
- e7000_ops.to_require_detach = NULL;
e7000_ops.to_resume = e7000_resume;
e7000_ops.to_wait = e7000_wait;
- e7000_ops.to_post_wait = NULL;
e7000_ops.to_fetch_registers = e7000_fetch_register;
e7000_ops.to_store_registers = e7000_store_register;
e7000_ops.to_prepare_to_store = e7000_prepare_to_store;
@@ -2158,47 +2153,17 @@ target e7000 foobar";
e7000_ops.to_files_info = e7000_files_info;
e7000_ops.to_insert_breakpoint = e7000_insert_breakpoint;
e7000_ops.to_remove_breakpoint = e7000_remove_breakpoint;
- e7000_ops.to_terminal_init = 0;
- e7000_ops.to_terminal_inferior = 0;
- e7000_ops.to_terminal_ours_for_output = 0;
- e7000_ops.to_terminal_ours = 0;
- e7000_ops.to_terminal_info = 0;
e7000_ops.to_kill = e7000_kill;
e7000_ops.to_load = e7000_load;
- e7000_ops.to_lookup_symbol = 0;
e7000_ops.to_create_inferior = e7000_create_inferior;
- e7000_ops.to_post_startup_inferior = NULL;
- e7000_ops.to_acknowledge_created_inferior = NULL;
- e7000_ops.to_clone_and_follow_inferior = NULL;
- e7000_ops.to_post_follow_inferior_by_clone = NULL;
- e7000_ops.to_insert_fork_catchpoint = NULL;
- e7000_ops.to_remove_fork_catchpoint = NULL;
- e7000_ops.to_insert_vfork_catchpoint = NULL;
- e7000_ops.to_remove_vfork_catchpoint = NULL;
- e7000_ops.to_has_forked = NULL;
- e7000_ops.to_has_vforked = NULL;
- e7000_ops.to_can_follow_vfork_prior_to_exec = NULL;
- e7000_ops.to_post_follow_vfork = NULL;
- e7000_ops.to_insert_exec_catchpoint = NULL;
- e7000_ops.to_remove_exec_catchpoint = NULL;
- e7000_ops.to_has_execd = NULL;
- e7000_ops.to_reported_exec_events_per_exec_call = NULL;
- e7000_ops.to_has_exited = NULL;
e7000_ops.to_mourn_inferior = e7000_mourn_inferior;
- e7000_ops.to_can_run = 0;
- e7000_ops.to_notice_signals = 0;
- e7000_ops.to_thread_alive = 0;
e7000_ops.to_stop = e7000_stop;
- e7000_ops.to_pid_to_exec_file = NULL;
e7000_ops.to_stratum = process_stratum;
- e7000_ops.DONT_USE = 0;
e7000_ops.to_has_all_memory = 1;
e7000_ops.to_has_memory = 1;
e7000_ops.to_has_stack = 1;
e7000_ops.to_has_registers = 1;
e7000_ops.to_has_execution = 1;
- e7000_ops.to_sections = 0;
- e7000_ops.to_sections_end = 0;
e7000_ops.to_magic = OPS_MAGIC;
};
diff --git a/gdb/remote-es.c b/gdb/remote-es.c
index 24183cc43a8..72e61710e2a 100644
--- a/gdb/remote-es.c
+++ b/gdb/remote-es.c
@@ -623,7 +623,7 @@ es1800_fetch_register (int regno)
{
error ("Emulator reply is too short: %s", buf);
}
- registers[r++] = (fromhex (p[k * 2 + 1]) * 16) + fromhex (p[k * 2 + 2]);
+ deprecated_registers[r++] = (fromhex (p[k * 2 + 1]) * 16) + fromhex (p[k * 2 + 2]);
}
}
else
@@ -666,7 +666,7 @@ es1800_fetch_registers (void)
{
error ("Emulator reply is too short: %s", buf);
}
- registers[r++] = (fromhex (p[i + 0]) * 16) + fromhex (p[i + 1]);
+ deprecated_registers[r++] = (fromhex (p[i + 0]) * 16) + fromhex (p[i + 1]);
i += 2;
}
}
@@ -685,7 +685,7 @@ es1800_fetch_registers (void)
{
error ("Emulator reply is too short: %s", buf);
}
- registers[r++] = (fromhex (p[i + 0])) * 16 + fromhex (p[i + 1]);
+ deprecated_registers[r++] = (fromhex (p[i + 0])) * 16 + fromhex (p[i + 1]);
i += 2;
}
}
@@ -725,7 +725,7 @@ es1800_fetch_registers (void)
{
error ("Emulator reply is too short: %s", buf);
}
- registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]);
+ deprecated_registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]);
}
p = SR_buf;
@@ -735,7 +735,7 @@ es1800_fetch_registers (void)
{
error ("Emulator reply is too short: %s", buf);
}
- registers[r++] =
+ deprecated_registers[r++] =
fromhex (SR_buf[k * 2 + 1]) * 16 + fromhex (SR_buf[k * 2 + 2]);
}
send_with_reply ("PC", buf, sizeof (buf));
@@ -746,7 +746,7 @@ es1800_fetch_registers (void)
{
error ("Emulator reply is too short: %s", buf);
}
- registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]);
+ deprecated_registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]);
}
}
else
@@ -771,7 +771,7 @@ es1800_fetch_registers (void)
{
error ("Emulator reply is too short: %s", buf);
}
- registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]);
+ deprecated_registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]);
}
/* fetch STATUS */
@@ -783,7 +783,7 @@ es1800_fetch_registers (void)
{
error ("Emulator reply is too short: %s", buf);
}
- registers[r++] =
+ deprecated_registers[r++] =
fromhex (SR_buf[k * 2 + 1]) * 16 + fromhex (SR_buf[k * 2 + 2]);
}
@@ -797,7 +797,7 @@ es1800_fetch_registers (void)
{
error ("Emulator reply is too short: %s", buf);
}
- registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]);
+ deprecated_registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]);
}
}
}
@@ -827,7 +827,7 @@ es1800_store_register (int regno)
int k;
unsigned char *r;
- r = (unsigned char *) registers;
+ r = (unsigned char *) deprecated_registers;
if (regno == -1) /* write all registers */
{
@@ -1981,61 +1981,17 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
es1800_ops.to_open = es1800_open;
es1800_ops.to_close = es1800_close;
es1800_ops.to_attach = es1800_attach;
- es1800_ops.to_post_attach = NULL;
- es1800_ops.to_require_attach = NULL;
es1800_ops.to_detach = es1800_detach;
- es1800_ops.to_require_detach = NULL;
es1800_ops.to_resume = es1800_resume;
- es1800_ops.to_wait = NULL;
- es1800_ops.to_post_wait = NULL;
- es1800_ops.to_fetch_registers = NULL;
- es1800_ops.to_store_registers = NULL;
es1800_ops.to_prepare_to_store = es1800_prepare_to_store;
es1800_ops.to_xfer_memory = es1800_xfer_inferior_memory;
es1800_ops.to_files_info = es1800_files_info;
es1800_ops.to_insert_breakpoint = es1800_insert_breakpoint;
es1800_ops.to_remove_breakpoint = es1800_remove_breakpoint;
- es1800_ops.to_terminal_init = NULL;
- es1800_ops.to_terminal_inferior = NULL;
- es1800_ops.to_terminal_ours_for_output = NULL;
- es1800_ops.to_terminal_ours = NULL;
- es1800_ops.to_terminal_info = NULL;
- es1800_ops.to_kill = NULL;
es1800_ops.to_load = es1800_load;
- es1800_ops.to_lookup_symbol = NULL;
es1800_ops.to_create_inferior = es1800_create_inferior;
- es1800_ops.to_post_startup_inferior = NULL;
- es1800_ops.to_acknowledge_created_inferior = NULL;
- es1800_ops.to_clone_and_follow_inferior = NULL;
- es1800_ops.to_post_follow_inferior_by_clone = NULL;
- es1800_ops.to_insert_fork_catchpoint = NULL;
- es1800_ops.to_remove_fork_catchpoint = NULL;
- es1800_ops.to_insert_vfork_catchpoint = NULL;
- es1800_ops.to_remove_vfork_catchpoint = NULL;
- es1800_ops.to_has_forked = NULL;
- es1800_ops.to_has_vforked = NULL;
- es1800_ops.to_can_follow_vfork_prior_to_exec = NULL;
- es1800_ops.to_post_follow_vfork = NULL;
- es1800_ops.to_insert_exec_catchpoint = NULL;
- es1800_ops.to_remove_exec_catchpoint = NULL;
- es1800_ops.to_has_execd = NULL;
- es1800_ops.to_reported_exec_events_per_exec_call = NULL;
- es1800_ops.to_has_exited = NULL;
- es1800_ops.to_mourn_inferior = NULL;
- es1800_ops.to_can_run = 0;
- es1800_ops.to_notice_signals = 0;
- es1800_ops.to_thread_alive = 0;
- es1800_ops.to_stop = 0;
- es1800_ops.to_pid_to_exec_file = NULL;
es1800_ops.to_stratum = core_stratum;
- es1800_ops.DONT_USE = 0;
- es1800_ops.to_has_all_memory = 0;
es1800_ops.to_has_memory = 1;
- es1800_ops.to_has_stack = 0;
- es1800_ops.to_has_registers = 0;
- es1800_ops.to_has_execution = 0;
- es1800_ops.to_sections = NULL;
- es1800_ops.to_sections_end = NULL;
es1800_ops.to_magic = OPS_MAGIC;
}
@@ -2051,15 +2007,10 @@ init_es1800_child_ops (void)
es1800_child_ops.to_doc = "Remote debugging on the es1800 emulator via a serial line.\n\
Specify the serial device it is connected to (e.g. /dev/ttya).";
es1800_child_ops.to_open = es1800_child_open;
- es1800_child_ops.to_close = NULL;
es1800_child_ops.to_attach = es1800_attach;
- es1800_child_ops.to_post_attach = NULL;
- es1800_child_ops.to_require_attach = NULL;
es1800_child_ops.to_detach = es1800_child_detach;
- es1800_child_ops.to_require_detach = NULL;
es1800_child_ops.to_resume = es1800_resume;
es1800_child_ops.to_wait = es1800_wait;
- es1800_child_ops.to_post_wait = NULL;
es1800_child_ops.to_fetch_registers = es1800_fetch_register;
es1800_child_ops.to_store_registers = es1800_store_register;
es1800_child_ops.to_prepare_to_store = es1800_prepare_to_store;
@@ -2067,47 +2018,16 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
es1800_child_ops.to_files_info = es1800_files_info;
es1800_child_ops.to_insert_breakpoint = es1800_insert_breakpoint;
es1800_child_ops.to_remove_breakpoint = es1800_remove_breakpoint;
- es1800_child_ops.to_terminal_init = NULL;
- es1800_child_ops.to_terminal_inferior = NULL;
- es1800_child_ops.to_terminal_ours_for_output = NULL;
- es1800_child_ops.to_terminal_ours = NULL;
- es1800_child_ops.to_terminal_info = NULL;
es1800_child_ops.to_kill = es1800_kill;
es1800_child_ops.to_load = es1800_load;
- es1800_child_ops.to_lookup_symbol = NULL;
es1800_child_ops.to_create_inferior = es1800_create_inferior;
- es1800_child_ops.to_post_startup_inferior = NULL;
- es1800_child_ops.to_acknowledge_created_inferior = NULL;
- es1800_child_ops.to_clone_and_follow_inferior = NULL;
- es1800_child_ops.to_post_follow_inferior_by_clone = NULL;
- es1800_child_ops.to_insert_fork_catchpoint = NULL;
- es1800_child_ops.to_remove_fork_catchpoint = NULL;
- es1800_child_ops.to_insert_vfork_catchpoint = NULL;
- es1800_child_ops.to_remove_vfork_catchpoint = NULL;
- es1800_child_ops.to_has_forked = NULL;
- es1800_child_ops.to_has_vforked = NULL;
- es1800_child_ops.to_can_follow_vfork_prior_to_exec = NULL;
- es1800_child_ops.to_post_follow_vfork = NULL;
- es1800_child_ops.to_insert_exec_catchpoint = NULL;
- es1800_child_ops.to_remove_exec_catchpoint = NULL;
- es1800_child_ops.to_has_execd = NULL;
- es1800_child_ops.to_reported_exec_events_per_exec_call = NULL;
- es1800_child_ops.to_has_exited = NULL;
es1800_child_ops.to_mourn_inferior = es1800_mourn_inferior;
- es1800_child_ops.to_can_run = 0;
- es1800_child_ops.to_notice_signals = 0;
- es1800_child_ops.to_thread_alive = 0;
- es1800_child_ops.to_stop = 0;
- es1800_child_ops.to_pid_to_exec_file = NULL;
es1800_child_ops.to_stratum = process_stratum;
- es1800_child_ops.DONT_USE = 0;
es1800_child_ops.to_has_all_memory = 1;
es1800_child_ops.to_has_memory = 1;
es1800_child_ops.to_has_stack = 1;
es1800_child_ops.to_has_registers = 1;
es1800_child_ops.to_has_execution = 1;
- es1800_child_ops.to_sections = NULL;
- es1800_child_ops.to_sections_end = NULL;
es1800_child_ops.to_magic = OPS_MAGIC;
}
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index a1df0eb94e9..abd590bef2b 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -3443,7 +3443,7 @@ mips_load (char *file, int from_tty)
/* Work around problem where PMON monitor updates the PC after a load
to a different value than GDB thinks it has. The following ensures
that the write_pc() WILL update the PC value: */
- register_valid[PC_REGNUM] = 0;
+ deprecated_register_valid[PC_REGNUM] = 0;
}
if (exec_bfd)
write_pc (bfd_get_start_address (exec_bfd));
diff --git a/gdb/remote-rdi.c b/gdb/remote-rdi.c
index 228e3d98c37..a85fbb118b7 100644
--- a/gdb/remote-rdi.c
+++ b/gdb/remote-rdi.c
@@ -598,7 +598,7 @@ arm_rdi_store_registers (int regno)
}
else
{
- read_register_gen (regno, (char *) rawreg);
+ deprecated_read_register_gen (regno, (char *) rawreg);
/* RDI manipulates data in host byte order, so convert now. */
store_unsigned_integer (rawerreg, 4, rawreg[0]);
diff --git a/gdb/remote-rdp.c b/gdb/remote-rdp.c
index 34a42abb1fa..20ed5160250 100644
--- a/gdb/remote-rdp.c
+++ b/gdb/remote-rdp.c
@@ -643,7 +643,7 @@ remote_rdp_store_register (int regno)
else
{
char tmp[ARM_MAX_REGISTER_RAW_SIZE];
- read_register_gen (regno, tmp);
+ deprecated_read_register_gen (regno, tmp);
if (regno < 15)
rdp_store_one_register (1 << regno, tmp);
else if (regno == ARM_PC_REGNUM)
@@ -1383,13 +1383,8 @@ init_remote_rdp_ops (void)
remote_rdp_ops.to_open = remote_rdp_open;
remote_rdp_ops.to_close = remote_rdp_close;
remote_rdp_ops.to_attach = remote_rdp_attach;
- remote_rdp_ops.to_post_attach = NULL;
- remote_rdp_ops.to_require_attach = NULL;
- remote_rdp_ops.to_detach = NULL;
- remote_rdp_ops.to_require_detach = NULL;
remote_rdp_ops.to_resume = remote_rdp_resume;
remote_rdp_ops.to_wait = remote_rdp_wait;
- remote_rdp_ops.to_post_wait = NULL;
remote_rdp_ops.to_fetch_registers = remote_rdp_fetch_register;
remote_rdp_ops.to_store_registers = remote_rdp_store_register;
remote_rdp_ops.to_prepare_to_store = remote_rdp_prepare_to_store;
@@ -1397,47 +1392,16 @@ init_remote_rdp_ops (void)
remote_rdp_ops.to_files_info = remote_rdp_files_info;
remote_rdp_ops.to_insert_breakpoint = remote_rdp_insert_breakpoint;
remote_rdp_ops.to_remove_breakpoint = remote_rdp_remove_breakpoint;
- remote_rdp_ops.to_terminal_init = NULL;
- remote_rdp_ops.to_terminal_inferior = NULL;
- remote_rdp_ops.to_terminal_ours_for_output = NULL;
- remote_rdp_ops.to_terminal_ours = NULL;
- remote_rdp_ops.to_terminal_info = NULL;
remote_rdp_ops.to_kill = remote_rdp_kill;
remote_rdp_ops.to_load = generic_load;
- remote_rdp_ops.to_lookup_symbol = NULL;
remote_rdp_ops.to_create_inferior = remote_rdp_create_inferior;
- remote_rdp_ops.to_post_startup_inferior = NULL;
- remote_rdp_ops.to_acknowledge_created_inferior = NULL;
- remote_rdp_ops.to_clone_and_follow_inferior = NULL;
- remote_rdp_ops.to_post_follow_inferior_by_clone = NULL;
- remote_rdp_ops.to_insert_fork_catchpoint = NULL;
- remote_rdp_ops.to_remove_fork_catchpoint = NULL;
- remote_rdp_ops.to_insert_vfork_catchpoint = NULL;
- remote_rdp_ops.to_remove_vfork_catchpoint = NULL;
- remote_rdp_ops.to_has_forked = NULL;
- remote_rdp_ops.to_has_vforked = NULL;
- remote_rdp_ops.to_can_follow_vfork_prior_to_exec = NULL;
- remote_rdp_ops.to_post_follow_vfork = NULL;
- remote_rdp_ops.to_insert_exec_catchpoint = NULL;
- remote_rdp_ops.to_remove_exec_catchpoint = NULL;
- remote_rdp_ops.to_has_execd = NULL;
- remote_rdp_ops.to_reported_exec_events_per_exec_call = NULL;
- remote_rdp_ops.to_has_exited = NULL;
remote_rdp_ops.to_mourn_inferior = generic_mourn_inferior;
- remote_rdp_ops.to_can_run = NULL;
- remote_rdp_ops.to_notice_signals = 0;
- remote_rdp_ops.to_thread_alive = 0;
- remote_rdp_ops.to_stop = 0;
- remote_rdp_ops.to_pid_to_exec_file = NULL;
remote_rdp_ops.to_stratum = process_stratum;
- remote_rdp_ops.DONT_USE = NULL;
remote_rdp_ops.to_has_all_memory = 1;
remote_rdp_ops.to_has_memory = 1;
remote_rdp_ops.to_has_stack = 1;
remote_rdp_ops.to_has_registers = 1;
remote_rdp_ops.to_has_execution = 1;
- remote_rdp_ops.to_sections = NULL;
- remote_rdp_ops.to_sections_end = NULL;
remote_rdp_ops.to_magic = OPS_MAGIC;
}
diff --git a/gdb/remote-sds.c b/gdb/remote-sds.c
index 053b97a7615..6797d057071 100644
--- a/gdb/remote-sds.c
+++ b/gdb/remote-sds.c
@@ -509,7 +509,7 @@ static void
sds_prepare_to_store (void)
{
/* Make sure the entire registers array is valid. */
- read_register_bytes (0, (char *) NULL, REGISTER_BYTES);
+ deprecated_read_register_bytes (0, (char *) NULL, REGISTER_BYTES);
}
/* Store register REGNO, or all registers if REGNO == -1, from the contents
@@ -528,7 +528,7 @@ sds_store_registers (int regno)
*p++ = 0;
*p++ = 0;
for (i = 0; i < 4 * 6; i++)
- *p++ = registers[i + 4 * 32 + 8 * 32];
+ *p++ = deprecated_registers[i + 4 * 32 + 8 * 32];
for (i = 0; i < 4 * 1; i++)
*p++ = 0;
for (i = 0; i < 4 * 4; i++)
@@ -543,7 +543,7 @@ sds_store_registers (int regno)
*p++ = 0;
*p++ = 0;
for (i = 0; i < 4 * 32; i++)
- *p++ = registers[i];
+ *p++ = deprecated_registers[i];
sds_send (buf, p - buf);
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 221efe45674..3e2a7cdd505 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -361,7 +361,7 @@ gdbsim_store_register (int regno)
{
char tmp[MAX_REGISTER_RAW_SIZE];
int nr_bytes;
- read_register_gen (regno, tmp);
+ deprecated_read_register_gen (regno, tmp);
nr_bytes = sim_store_register (gdbsim_desc,
REGISTER_SIM_REGNO (regno),
tmp, REGISTER_RAW_SIZE (regno));
@@ -897,14 +897,9 @@ init_gdbsim_ops (void)
gdbsim_ops.to_doc = "Use the compiled-in simulator.";
gdbsim_ops.to_open = gdbsim_open;
gdbsim_ops.to_close = gdbsim_close;
- gdbsim_ops.to_attach = NULL;
- gdbsim_ops.to_post_attach = NULL;
- gdbsim_ops.to_require_attach = NULL;
gdbsim_ops.to_detach = gdbsim_detach;
- gdbsim_ops.to_require_detach = NULL;
gdbsim_ops.to_resume = gdbsim_resume;
gdbsim_ops.to_wait = gdbsim_wait;
- gdbsim_ops.to_post_wait = NULL;
gdbsim_ops.to_fetch_registers = gdbsim_fetch_register;
gdbsim_ops.to_store_registers = gdbsim_store_register;
gdbsim_ops.to_prepare_to_store = gdbsim_prepare_to_store;
@@ -912,47 +907,17 @@ init_gdbsim_ops (void)
gdbsim_ops.to_files_info = gdbsim_files_info;
gdbsim_ops.to_insert_breakpoint = gdbsim_insert_breakpoint;
gdbsim_ops.to_remove_breakpoint = gdbsim_remove_breakpoint;
- gdbsim_ops.to_terminal_init = NULL;
- gdbsim_ops.to_terminal_inferior = NULL;
- gdbsim_ops.to_terminal_ours_for_output = NULL;
- gdbsim_ops.to_terminal_ours = NULL;
- gdbsim_ops.to_terminal_info = NULL;
gdbsim_ops.to_kill = gdbsim_kill;
gdbsim_ops.to_load = gdbsim_load;
- gdbsim_ops.to_lookup_symbol = NULL;
gdbsim_ops.to_create_inferior = gdbsim_create_inferior;
- gdbsim_ops.to_post_startup_inferior = NULL;
- gdbsim_ops.to_acknowledge_created_inferior = NULL;
- gdbsim_ops.to_clone_and_follow_inferior = NULL;
- gdbsim_ops.to_post_follow_inferior_by_clone = NULL;
- gdbsim_ops.to_insert_fork_catchpoint = NULL;
- gdbsim_ops.to_remove_fork_catchpoint = NULL;
- gdbsim_ops.to_insert_vfork_catchpoint = NULL;
- gdbsim_ops.to_remove_vfork_catchpoint = NULL;
- gdbsim_ops.to_has_forked = NULL;
- gdbsim_ops.to_has_vforked = NULL;
- gdbsim_ops.to_can_follow_vfork_prior_to_exec = NULL;
- gdbsim_ops.to_post_follow_vfork = NULL;
- gdbsim_ops.to_insert_exec_catchpoint = NULL;
- gdbsim_ops.to_remove_exec_catchpoint = NULL;
- gdbsim_ops.to_has_execd = NULL;
- gdbsim_ops.to_reported_exec_events_per_exec_call = NULL;
- gdbsim_ops.to_has_exited = NULL;
gdbsim_ops.to_mourn_inferior = gdbsim_mourn_inferior;
- gdbsim_ops.to_can_run = 0;
- gdbsim_ops.to_notice_signals = 0;
- gdbsim_ops.to_thread_alive = 0;
gdbsim_ops.to_stop = gdbsim_stop;
- gdbsim_ops.to_pid_to_exec_file = NULL;
gdbsim_ops.to_stratum = process_stratum;
- gdbsim_ops.DONT_USE = NULL;
gdbsim_ops.to_has_all_memory = 1;
gdbsim_ops.to_has_memory = 1;
gdbsim_ops.to_has_stack = 1;
gdbsim_ops.to_has_registers = 1;
gdbsim_ops.to_has_execution = 1;
- gdbsim_ops.to_sections = NULL;
- gdbsim_ops.to_sections_end = NULL;
gdbsim_ops.to_magic = OPS_MAGIC;
#ifdef TARGET_REDEFINE_DEFAULT_OPS
diff --git a/gdb/remote-st.c b/gdb/remote-st.c
index c27ddebbf3b..7c452a27a76 100644
--- a/gdb/remote-st.c
+++ b/gdb/remote-st.c
@@ -767,14 +767,9 @@ Arguments are the name of the device for the serial line,\n\
the speed to connect at in bits per second.";
st2000_ops.to_open = st2000_open;
st2000_ops.to_close = st2000_close;
- st2000_ops.to_attach = 0;
- st2000_run_ops.to_post_attach = NULL;
- st2000_ops.to_require_attach = NULL;
st2000_ops.to_detach = st2000_detach;
- st2000_ops.to_require_detach = NULL;
st2000_ops.to_resume = st2000_resume;
st2000_ops.to_wait = st2000_wait;
- st2000_ops.to_post_wait = NULL;
st2000_ops.to_fetch_registers = st2000_fetch_register;
st2000_ops.to_store_registers = st2000_store_register;
st2000_ops.to_prepare_to_store = st2000_prepare_to_store;
@@ -782,47 +777,15 @@ the speed to connect at in bits per second.";
st2000_ops.to_files_info = st2000_files_info;
st2000_ops.to_insert_breakpoint = st2000_insert_breakpoint;
st2000_ops.to_remove_breakpoint = st2000_remove_breakpoint; /* Breakpoints */
- st2000_ops.to_terminal_init = 0;
- st2000_ops.to_terminal_inferior = 0;
- st2000_ops.to_terminal_ours_for_output = 0;
- st2000_ops.to_terminal_ours = 0;
- st2000_ops.to_terminal_info = 0; /* Terminal handling */
st2000_ops.to_kill = st2000_kill;
- st2000_ops.to_load = 0; /* load */
- st2000_ops.to_lookup_symbol = 0; /* lookup_symbol */
st2000_ops.to_create_inferior = st2000_create_inferior;
- st2000_ops.to_post_startup_inferior = NULL;
- st2000_ops.to_acknowledge_created_inferior = NULL;
- st2000_ops.to_clone_and_follow_inferior = NULL;
- st2000_ops.to_post_follow_inferior_by_clone = NULL;
- st2000_run_ops.to_insert_fork_catchpoint = NULL;
- st2000_run_ops.to_remove_fork_catchpoint = NULL;
- st2000_run_ops.to_insert_vfork_catchpoint = NULL;
- st2000_run_ops.to_remove_vfork_catchpoint = NULL;
- st2000_ops.to_has_forked = NULL;
- st2000_ops.to_has_vforked = NULL;
- st2000_run_ops.to_can_follow_vfork_prior_to_exec = NULL;
- st2000_ops.to_post_follow_vfork = NULL;
- st2000_run_ops.to_insert_exec_catchpoint = NULL;
- st2000_run_ops.to_remove_exec_catchpoint = NULL;
- st2000_run_ops.to_has_execd = NULL;
- st2000_run_ops.to_reported_exec_events_per_exec_call = NULL;
- st2000_run_ops.to_has_exited = NULL;
st2000_ops.to_mourn_inferior = st2000_mourn_inferior;
- st2000_ops.to_can_run = 0; /* can_run */
- st2000_ops.to_notice_signals = 0; /* notice_signals */
- st2000_ops.to_thread_alive = 0; /* thread alive */
- st2000_ops.to_stop = 0; /* to_stop */
- st2000_ops.to_pid_to_exec_file = NULL;
st2000_ops.to_stratum = process_stratum;
- st2000_ops.DONT_USE = 0; /* next */
st2000_ops.to_has_all_memory = 1;
st2000_ops.to_has_memory = 1;
st2000_ops.to_has_stack = 1;
st2000_ops.to_has_registers = 1;
st2000_ops.to_has_execution = 1; /* all mem, mem, stack, regs, exec */
- st2000_ops.to_sections = 0;
- st2000_ops.to_sections_end = 0; /* Section pointers */
st2000_ops.to_magic = OPS_MAGIC; /* Always the last thing */
};
diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c
index 5ec4df42fd7..0bd8c52052a 100644
--- a/gdb/remote-vx.c
+++ b/gdb/remote-vx.c
@@ -466,7 +466,7 @@ static void
vx_prepare_to_store (void)
{
/* Fetch all registers, if any of them are not yet fetched. */
- read_register_bytes (0, NULL, REGISTER_BYTES);
+ deprecated_read_register_bytes (0, NULL, REGISTER_BYTES);
}
/* Copy LEN bytes to or from remote inferior's memory starting at MEMADDR
@@ -820,7 +820,7 @@ net_get_symbols (ldtabl *pLoadTable)
Returns status of symbol read on target side (0=success, -1=fail)
Returns -1 and complain()s if rpc fails. */
-struct complaint cant_contact_target =
+struct deprecated_complaint cant_contact_target =
{"Lost contact with VxWorks target", 0, 0};
static int
diff --git a/gdb/remote-vx68.c b/gdb/remote-vx68.c
index 2ebaa633f77..e7f138d1d35 100644
--- a/gdb/remote-vx68.c
+++ b/gdb/remote-vx68.c
@@ -30,7 +30,7 @@
#include "gdbcore.h"
#include "command.h"
#include "symtab.h"
-#include "symfile.h" /* for struct complaint */
+#include "symfile.h"
#include "regcache.h"
#include "gdb_string.h"
@@ -85,10 +85,13 @@ vx_read_register (int regno)
net_read_registers (mc68k_greg_packet, MC68K_GREG_PLEN, PTRACE_GETREGS);
- bcopy (&mc68k_greg_packet[MC68K_R_D0], registers, 16 * MC68K_GREG_SIZE);
- bcopy (&mc68k_greg_packet[MC68K_R_SR], &registers[REGISTER_BYTE (PS_REGNUM)],
+ bcopy (&mc68k_greg_packet[MC68K_R_D0], deprecated_registers,
+ 16 * MC68K_GREG_SIZE);
+ bcopy (&mc68k_greg_packet[MC68K_R_SR],
+ &deprecated_registers[REGISTER_BYTE (PS_REGNUM)],
MC68K_GREG_SIZE);
- bcopy (&mc68k_greg_packet[MC68K_R_PC], &registers[REGISTER_BYTE (PC_REGNUM)],
+ bcopy (&mc68k_greg_packet[MC68K_R_PC],
+ &deprecated_registers[REGISTER_BYTE (PC_REGNUM)],
MC68K_GREG_SIZE);
/* Get floating-point registers, if the target system has them.
@@ -100,23 +103,23 @@ vx_read_register (int regno)
PTRACE_GETFPREGS);
bcopy (&mc68k_fpreg_packet[MC68K_R_FP0],
- &registers[REGISTER_BYTE (FP0_REGNUM)],
+ &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
MC68K_FPREG_SIZE * 8);
bcopy (&mc68k_fpreg_packet[MC68K_R_FPCR],
- &registers[REGISTER_BYTE (FPC_REGNUM)],
+ &deprecated_registers[REGISTER_BYTE (FPC_REGNUM)],
MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
}
else
{
- bzero (&registers[REGISTER_BYTE (FP0_REGNUM)],
+ bzero (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
MC68K_FPREG_SIZE * 8);
- bzero (&registers[REGISTER_BYTE (FPC_REGNUM)],
+ bzero (&deprecated_registers[REGISTER_BYTE (FPC_REGNUM)],
MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
}
/* Mark the register cache valid. */
- registers_fetched ();
+ deprecated_registers_fetched ();
}
/* Store a register or registers into the VxWorks target.
@@ -131,10 +134,11 @@ vx_write_register (int regno)
/* Store general-purpose registers. */
- bcopy (registers, &mc68k_greg_packet[MC68K_R_D0], 16 * MC68K_GREG_SIZE);
- bcopy (&registers[REGISTER_BYTE (PS_REGNUM)],
+ bcopy (deprecated_registers, &mc68k_greg_packet[MC68K_R_D0],
+ 16 * MC68K_GREG_SIZE);
+ bcopy (&deprecated_registers[REGISTER_BYTE (PS_REGNUM)],
&mc68k_greg_packet[MC68K_R_SR], MC68K_GREG_SIZE);
- bcopy (&registers[REGISTER_BYTE (PC_REGNUM)],
+ bcopy (&deprecated_registers[REGISTER_BYTE (PC_REGNUM)],
&mc68k_greg_packet[MC68K_R_PC], MC68K_GREG_SIZE);
net_write_registers (mc68k_greg_packet, MC68K_GREG_PLEN, PTRACE_SETREGS);
@@ -143,10 +147,10 @@ vx_write_register (int regno)
if (target_has_fp)
{
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)],
+ bcopy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
&mc68k_fpreg_packet[MC68K_R_FP0],
MC68K_FPREG_SIZE * 8);
- bcopy (&registers[REGISTER_BYTE (FPC_REGNUM)],
+ bcopy (&deprecated_registers[REGISTER_BYTE (FPC_REGNUM)],
&mc68k_fpreg_packet[MC68K_R_FPCR],
MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
diff --git a/gdb/remote-vxmips.c b/gdb/remote-vxmips.c
index 8be4a2f9464..441bd9bb2da 100644
--- a/gdb/remote-vxmips.c
+++ b/gdb/remote-vxmips.c
@@ -30,7 +30,7 @@
#include "gdbcore.h"
#include "command.h"
#include "symtab.h"
-#include "symfile.h" /* for struct complaint */
+#include "symfile.h"
#include "regcache.h"
#include "gdb_string.h"
@@ -103,18 +103,19 @@ vx_read_register (int regno)
/* Copy the general registers. */
- bcopy (&mips_greg_packet[MIPS_R_GP0], &registers[0], 32 * MIPS_GREG_SIZE);
+ bcopy (&mips_greg_packet[MIPS_R_GP0], &deprecated_registers[0],
+ 32 * MIPS_GREG_SIZE);
/* Copy SR, LO, HI, and PC. */
bcopy (&mips_greg_packet[MIPS_R_SR],
- &registers[REGISTER_BYTE (PS_REGNUM)], MIPS_GREG_SIZE);
+ &deprecated_registers[REGISTER_BYTE (PS_REGNUM)], MIPS_GREG_SIZE);
bcopy (&mips_greg_packet[MIPS_R_LO],
- &registers[REGISTER_BYTE (LO_REGNUM)], MIPS_GREG_SIZE);
+ &deprecated_registers[REGISTER_BYTE (LO_REGNUM)], MIPS_GREG_SIZE);
bcopy (&mips_greg_packet[MIPS_R_HI],
- &registers[REGISTER_BYTE (HI_REGNUM)], MIPS_GREG_SIZE);
+ &deprecated_registers[REGISTER_BYTE (HI_REGNUM)], MIPS_GREG_SIZE);
bcopy (&mips_greg_packet[MIPS_R_PC],
- &registers[REGISTER_BYTE (PC_REGNUM)], MIPS_GREG_SIZE);
+ &deprecated_registers[REGISTER_BYTE (PC_REGNUM)], MIPS_GREG_SIZE);
/* If the target has floating point registers, fetch them.
Otherwise, zero the floating point register values in
@@ -129,26 +130,26 @@ vx_read_register (int regno)
/* Copy the floating point registers. */
bcopy (&mips_fpreg_packet[MIPS_R_FP0],
- &registers[REGISTER_BYTE (FP0_REGNUM)],
+ &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
/* Copy the floating point control/status register (fpcsr). */
bcopy (&mips_fpreg_packet[MIPS_R_FPCSR],
- &registers[REGISTER_BYTE (FCRCS_REGNUM)],
+ &deprecated_registers[REGISTER_BYTE (FCRCS_REGNUM)],
REGISTER_RAW_SIZE (FCRCS_REGNUM));
}
else
{
- bzero ((char *) &registers[REGISTER_BYTE (FP0_REGNUM)],
+ bzero ((char *) &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
- bzero ((char *) &registers[REGISTER_BYTE (FCRCS_REGNUM)],
+ bzero ((char *) &deprecated_registers[REGISTER_BYTE (FCRCS_REGNUM)],
REGISTER_RAW_SIZE (FCRCS_REGNUM));
}
/* Mark the register cache valid. */
- registers_fetched ();
+ deprecated_registers_fetched ();
}
/* Store a register or registers into the VxWorks target.
@@ -162,17 +163,18 @@ vx_write_register (int regno)
/* Store general registers. */
- bcopy (&registers[0], &mips_greg_packet[MIPS_R_GP0], 32 * MIPS_GREG_SIZE);
+ bcopy (&deprecated_registers[0], &mips_greg_packet[MIPS_R_GP0],
+ 32 * MIPS_GREG_SIZE);
/* Copy SR, LO, HI, and PC. */
- bcopy (&registers[REGISTER_BYTE (PS_REGNUM)],
+ bcopy (&deprecated_registers[REGISTER_BYTE (PS_REGNUM)],
&mips_greg_packet[MIPS_R_SR], MIPS_GREG_SIZE);
- bcopy (&registers[REGISTER_BYTE (LO_REGNUM)],
+ bcopy (&deprecated_registers[REGISTER_BYTE (LO_REGNUM)],
&mips_greg_packet[MIPS_R_LO], MIPS_GREG_SIZE);
- bcopy (&registers[REGISTER_BYTE (HI_REGNUM)],
+ bcopy (&deprecated_registers[REGISTER_BYTE (HI_REGNUM)],
&mips_greg_packet[MIPS_R_HI], MIPS_GREG_SIZE);
- bcopy (&registers[REGISTER_BYTE (PC_REGNUM)],
+ bcopy (&deprecated_registers[REGISTER_BYTE (PC_REGNUM)],
&mips_greg_packet[MIPS_R_PC], MIPS_GREG_SIZE);
net_write_registers (mips_greg_packet, MIPS_GREG_PLEN, PTRACE_SETREGS);
@@ -183,13 +185,13 @@ vx_write_register (int regno)
{
/* Copy the floating point data registers. */
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)],
+ bcopy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
&mips_fpreg_packet[MIPS_R_FP0],
REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
/* Copy the floating point control/status register (fpcsr). */
- bcopy (&registers[REGISTER_BYTE (FCRCS_REGNUM)],
+ bcopy (&deprecated_registers[REGISTER_BYTE (FCRCS_REGNUM)],
&mips_fpreg_packet[MIPS_R_FPCSR],
REGISTER_RAW_SIZE (FCRCS_REGNUM));
diff --git a/gdb/remote-vxsparc.c b/gdb/remote-vxsparc.c
index 294e940f500..eb59b9fb43a 100644
--- a/gdb/remote-vxsparc.c
+++ b/gdb/remote-vxsparc.c
@@ -30,7 +30,7 @@
#include "gdbcore.h"
#include "command.h"
#include "symtab.h"
-#include "symfile.h" /* for struct complaint */
+#include "symfile.h"
#include "regcache.h"
#include "gdb_string.h"
@@ -92,18 +92,19 @@ vx_read_register (int regno)
as defined in "tm-sparc.h". */
bcopy (&sparc_greg_packet[SPARC_R_G0],
- &registers[REGISTER_BYTE (G0_REGNUM)], 32 * SPARC_GREG_SIZE);
+ &deprecated_registers[REGISTER_BYTE (G0_REGNUM)],
+ 32 * SPARC_GREG_SIZE);
bcopy (&sparc_greg_packet[SPARC_R_Y],
- &registers[REGISTER_BYTE (Y_REGNUM)], 6 * SPARC_GREG_SIZE);
+ &deprecated_registers[REGISTER_BYTE (Y_REGNUM)], 6 * SPARC_GREG_SIZE);
/* Now write the local and in registers to the register window
spill area in the frame. VxWorks does not do this for the
active frame automatically; it greatly simplifies debugging
(FRAME_FIND_SAVED_REGS, in particular, depends on this). */
- sp = extract_address (&registers[REGISTER_BYTE (SP_REGNUM)],
+ sp = extract_address (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)],
REGISTER_RAW_SIZE (SP_REGNUM));
- write_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)],
+ write_memory (sp, &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
/* If the target has floating point registers, fetch them.
@@ -116,19 +117,23 @@ vx_read_register (int regno)
net_read_registers (sparc_fpreg_packet, SPARC_FPREG_PLEN,
PTRACE_GETFPREGS);
bcopy (&sparc_fpreg_packet[SPARC_R_FP0],
- &registers[REGISTER_BYTE (FP0_REGNUM)], 32 * SPARC_FPREG_SIZE);
+ &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ 32 * SPARC_FPREG_SIZE);
bcopy (&sparc_fpreg_packet[SPARC_R_FSR],
- &registers[REGISTER_BYTE (FPS_REGNUM)], 1 * SPARC_FPREG_SIZE);
+ &deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
+ 1 * SPARC_FPREG_SIZE);
}
else
{
- bzero (&registers[REGISTER_BYTE (FP0_REGNUM)], 32 * SPARC_FPREG_SIZE);
- bzero (&registers[REGISTER_BYTE (FPS_REGNUM)], 1 * SPARC_FPREG_SIZE);
+ bzero (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ 32 * SPARC_FPREG_SIZE);
+ bzero (&deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
+ 1 * SPARC_FPREG_SIZE);
}
/* Mark the register cache valid. */
- registers_fetched ();
+ deprecated_registers_fetched ();
}
/* Store a register or registers into the VxWorks target.
@@ -160,9 +165,9 @@ vx_write_register (int regno)
}
if (in_gp_regs)
{
- bcopy (&registers[REGISTER_BYTE (G0_REGNUM)],
+ bcopy (&deprecated_registers[REGISTER_BYTE (G0_REGNUM)],
&sparc_greg_packet[SPARC_R_G0], 32 * SPARC_GREG_SIZE);
- bcopy (&registers[REGISTER_BYTE (Y_REGNUM)],
+ bcopy (&deprecated_registers[REGISTER_BYTE (Y_REGNUM)],
&sparc_greg_packet[SPARC_R_Y], 6 * SPARC_GREG_SIZE);
net_write_registers (sparc_greg_packet, SPARC_GREG_PLEN, PTRACE_SETREGS);
@@ -172,9 +177,9 @@ vx_write_register (int regno)
if (regno < 0 || (L0_REGNUM <= regno && regno <= I7_REGNUM))
{
- sp = extract_address (&registers[REGISTER_BYTE (SP_REGNUM)],
+ sp = extract_address (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)],
REGISTER_RAW_SIZE (SP_REGNUM));
- write_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)],
+ write_memory (sp, &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
}
}
@@ -183,9 +188,9 @@ vx_write_register (int regno)
if (in_fp_regs && target_has_fp)
{
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)],
+ bcopy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
&sparc_fpreg_packet[SPARC_R_FP0], 32 * SPARC_FPREG_SIZE);
- bcopy (&registers[REGISTER_BYTE (FPS_REGNUM)],
+ bcopy (&deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
&sparc_fpreg_packet[SPARC_R_FSR], 1 * SPARC_FPREG_SIZE);
net_write_registers (sparc_fpreg_packet, SPARC_FPREG_PLEN,
diff --git a/gdb/remote.c b/gdb/remote.c
index 1584d6bc7d4..d47dad7e9e5 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -3528,7 +3528,8 @@ remote_prepare_to_store (void)
/* NOTE: This isn't rs->sizeof_g_packet because here, we are
forcing the register cache to read its and not the target
registers. */
- read_register_bytes (0, (char *) NULL, REGISTER_BYTES); /* OK use. */
+ deprecated_read_register_bytes (0, (char *) NULL,
+ REGISTER_BYTES); /* OK use. */
break;
case PACKET_ENABLE:
break;
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 53b9dd333e0..26f5e4c891b 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -966,7 +966,7 @@ rs6000_pop_frame (void)
}
/* Make sure that all registers are valid. */
- read_register_bytes (0, NULL, REGISTER_BYTES);
+ deprecated_read_register_bytes (0, NULL, REGISTER_BYTES);
/* Figure out previous %pc value. If the function is frameless, it is
still in the link register, otherwise walk the frames and retrieve the
@@ -995,7 +995,8 @@ rs6000_pop_frame (void)
addr = prev_sp + fdata.gpr_offset;
for (ii = fdata.saved_gpr; ii <= 31; ++ii)
{
- read_memory (addr, &registers[REGISTER_BYTE (ii)], wordsize);
+ read_memory (addr, &deprecated_registers[REGISTER_BYTE (ii)],
+ wordsize);
addr += wordsize;
}
}
@@ -1005,7 +1006,7 @@ rs6000_pop_frame (void)
addr = prev_sp + fdata.fpr_offset;
for (ii = fdata.saved_fpr; ii <= 31; ++ii)
{
- read_memory (addr, &registers[REGISTER_BYTE (ii + FP0_REGNUM)], 8);
+ read_memory (addr, &deprecated_registers[REGISTER_BYTE (ii + FP0_REGNUM)], 8);
addr += 8;
}
}
@@ -1122,7 +1123,7 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
printf_unfiltered (
"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)],
+ memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)],
VALUE_CONTENTS (arg),
len);
++f_argno;
@@ -1134,8 +1135,9 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* Argument takes more than one register. */
while (argbytes < len)
{
- memset (&registers[REGISTER_BYTE (ii + 3)], 0, reg_size);
- memcpy (&registers[REGISTER_BYTE (ii + 3)],
+ memset (&deprecated_registers[REGISTER_BYTE (ii + 3)], 0,
+ reg_size);
+ memcpy (&deprecated_registers[REGISTER_BYTE (ii + 3)],
((char *) VALUE_CONTENTS (arg)) + argbytes,
(len - argbytes) > reg_size
? reg_size : len - argbytes);
@@ -1151,8 +1153,8 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
{
/* Argument can fit in one register. No problem. */
int adj = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? reg_size - len : 0;
- memset (&registers[REGISTER_BYTE (ii + 3)], 0, reg_size);
- memcpy ((char *)&registers[REGISTER_BYTE (ii + 3)] + adj,
+ memset (&deprecated_registers[REGISTER_BYTE (ii + 3)], 0, reg_size);
+ memcpy ((char *)&deprecated_registers[REGISTER_BYTE (ii + 3)] + adj,
VALUE_CONTENTS (arg), len);
}
++argno;
@@ -1234,7 +1236,7 @@ ran_out_of_registers_for_arguments:
printf_unfiltered (
"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)],
+ memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)],
VALUE_CONTENTS (arg),
len);
++f_argno;
@@ -2014,7 +2016,7 @@ e500_store_return_value (struct type *type, char *valbuf)
memcpy (reg_val_buf, valbuf + copied, reg_size);
copied += reg_size;
- write_register_gen (regnum, reg_val_buf);
+ deprecated_write_register_gen (regnum, reg_val_buf);
i++;
}
}
@@ -2030,19 +2032,19 @@ rs6000_store_return_value (struct type *type, char *valbuf)
Say a double_double_double type could be returned in
FPR1/FPR2/FPR3 triple. */
- write_register_bytes (REGISTER_BYTE (FP0_REGNUM + 1), valbuf,
- TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM + 1), valbuf,
+ TYPE_LENGTH (type));
else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
{
if (TYPE_LENGTH (type) == 16
&& TYPE_VECTOR (type))
- write_register_bytes (REGISTER_BYTE (tdep->ppc_vr0_regnum + 2),
- valbuf, TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (tdep->ppc_vr0_regnum + 2),
+ valbuf, TYPE_LENGTH (type));
}
else
/* Everything else is returned in GPR3 and up. */
- write_register_bytes (REGISTER_BYTE (gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum + 3),
- valbuf, TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum + 3),
+ valbuf, TYPE_LENGTH (type));
}
/* Extract from an array REGBUF containing the (raw) register state
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index f19e4ddfdd8..94defe5aee9 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1150,8 +1150,8 @@ s390_store_return_value (struct type *valtype, char *valbuf)
{
if (TYPE_LENGTH (valtype) == 4
|| TYPE_LENGTH (valtype) == 8)
- write_register_bytes (REGISTER_BYTE (S390_FP0_REGNUM), valbuf,
- TYPE_LENGTH (valtype));
+ deprecated_write_register_bytes (REGISTER_BYTE (S390_FP0_REGNUM),
+ valbuf, TYPE_LENGTH (valtype));
else
error ("GDB is unable to return `long double' values "
"on this architecture.");
@@ -1161,8 +1161,8 @@ s390_store_return_value (struct type *valtype, char *valbuf)
value =
s390_promote_integer_argument (valtype, valbuf, reg_buff, &arglen);
/* Everything else is returned in GPR2 and up. */
- write_register_bytes (REGISTER_BYTE (S390_GP0_REGNUM + 2), value,
- arglen);
+ deprecated_write_register_bytes (REGISTER_BYTE (S390_GP0_REGNUM + 2),
+ value, arglen);
}
}
static int
@@ -1575,9 +1575,9 @@ s390_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
{
/* When we store a single-precision value in an FP register,
it occupies the leftmost bits. */
- write_register_bytes (REGISTER_BYTE (S390_FP0_REGNUM + fr),
- VALUE_CONTENTS (arg),
- TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (S390_FP0_REGNUM + fr),
+ VALUE_CONTENTS (arg),
+ TYPE_LENGTH (type));
fr += 2;
}
else if (is_simple_arg (type)
@@ -1595,10 +1595,10 @@ s390_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
else if (is_double_arg (type)
&& gr <= 5)
{
- write_register_gen (S390_GP0_REGNUM + gr,
- VALUE_CONTENTS (arg));
- write_register_gen (S390_GP0_REGNUM + gr + 1,
- VALUE_CONTENTS (arg) + 4);
+ deprecated_write_register_gen (S390_GP0_REGNUM + gr,
+ VALUE_CONTENTS (arg));
+ deprecated_write_register_gen (S390_GP0_REGNUM + gr + 1,
+ VALUE_CONTENTS (arg) + 4);
gr += 2;
}
else
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index c5e5bf457d2..3d6c48845df 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -1874,7 +1874,7 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
if (addrp)
*addrp = REGISTER_BYTE (live_regnum);
if (raw_buffer)
- read_register_gen (live_regnum, raw_buffer);
+ deprecated_read_register_gen (live_regnum, raw_buffer);
}
/* Extract from an array REGBUF containing the (raw) register state
@@ -2223,7 +2223,8 @@ sh64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
if (float_arg_index <= tdep->FLOAT_ARGLAST_REGNUM)
{
/* Goes in FR0...FR11 */
- write_register_gen (FP0_REGNUM + float_arg_index, val);
+ deprecated_write_register_gen (FP0_REGNUM + float_arg_index,
+ val);
fp_args[float_arg_index] = 1;
/* Skip the corresponding general argument register. */
int_argreg ++;
@@ -2266,7 +2267,7 @@ sh64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
call the gdbarch function to do register
writes, and that will properly know how to deal
with pseudoregs. */
- write_register_gen (regnum, val);
+ deprecated_write_register_gen (regnum, val);
fp_args[double_arg_index] = 1;
fp_args[double_arg_index + 1] = 1;
/* Skip the corresponding general argument register. */
@@ -2472,20 +2473,20 @@ sh_default_store_return_value (struct type *type, char *valbuf)
valbuf, TYPE_LENGTH (type));
else
memcpy (buf, valbuf, TYPE_LENGTH (type));
- write_register_bytes (REGISTER_BYTE (R0_REGNUM), buf,
- REGISTER_RAW_SIZE (R0_REGNUM));
+ deprecated_write_register_bytes (REGISTER_BYTE (R0_REGNUM), buf,
+ REGISTER_RAW_SIZE (R0_REGNUM));
}
else
- write_register_bytes (REGISTER_BYTE (R0_REGNUM), valbuf,
- TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (R0_REGNUM), valbuf,
+ TYPE_LENGTH (type));
}
static void
sh3e_sh4_store_return_value (struct type *type, char *valbuf)
{
if (TYPE_CODE (type) == TYPE_CODE_FLT)
- write_register_bytes (REGISTER_BYTE (FP0_REGNUM),
- valbuf, TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM),
+ valbuf, TYPE_LENGTH (type));
else
sh_default_store_return_value (type, valbuf);
}
@@ -2501,7 +2502,7 @@ sh64_store_return_value (struct type *type, char *valbuf)
if (len == 4)
{
/* Return value stored in FP0_REGNUM */
- write_register_gen (FP0_REGNUM, valbuf);
+ deprecated_write_register_gen (FP0_REGNUM, valbuf);
}
if (len == 8)
{
@@ -2524,10 +2525,10 @@ sh64_store_return_value (struct type *type, char *valbuf)
offset = REGISTER_RAW_SIZE (return_register) - len;
memcpy (buf + offset, valbuf, len);
- write_register_gen (return_register, buf);
+ deprecated_write_register_gen (return_register, buf);
}
else
- write_register_gen (return_register, valbuf);
+ deprecated_write_register_gen (return_register, valbuf);
}
}
@@ -4289,10 +4290,10 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pc_regnum (gdbarch, 16);
set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_register_bytes (gdbarch, SH_DEFAULT_NUM_REGS * 4);
- set_gdbarch_do_registers_info (gdbarch, sh_do_registers_info);
+ set_gdbarch_deprecated_do_registers_info (gdbarch, sh_do_registers_info);
set_gdbarch_breakpoint_from_pc (gdbarch, sh_breakpoint_from_pc);
set_gdbarch_frame_chain (gdbarch, sh_frame_chain);
- set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
+ set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
set_gdbarch_init_extra_frame_info (gdbarch, sh_init_extra_frame_info);
set_gdbarch_deprecated_extract_return_value (gdbarch, sh_extract_return_value);
set_gdbarch_push_arguments (gdbarch, sh_push_arguments);
@@ -4516,7 +4517,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pseudo_register_read (gdbarch, sh64_pseudo_register_read);
set_gdbarch_pseudo_register_write (gdbarch, sh64_pseudo_register_write);
- set_gdbarch_do_registers_info (gdbarch, sh64_do_registers_info);
+ set_gdbarch_deprecated_do_registers_info (gdbarch, sh64_do_registers_info);
set_gdbarch_frame_init_saved_regs (gdbarch, sh64_nofp_frame_init_saved_regs);
set_gdbarch_breakpoint_from_pc (gdbarch, sh_sh64_breakpoint_from_pc);
set_gdbarch_init_extra_frame_info (gdbarch, sh64_init_extra_frame_info);
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 35cb5786561..13b95801092 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -648,7 +648,8 @@ sol_thread_store_registers (int regno)
{ /* Not writing all the regs */
/* save new register value */
char* old_value = (char*) alloca (REGISTER_SIZE);
- memcpy (old_value, &registers[REGISTER_BYTE (regno)], REGISTER_SIZE);
+ memcpy (old_value, &deprecated_registers[REGISTER_BYTE (regno)],
+ REGISTER_SIZE);
val = p_td_thr_getgregs (&thandle, gregset);
if (val != TD_OK)
@@ -660,7 +661,8 @@ sol_thread_store_registers (int regno)
td_err_string (val));
/* restore new register value */
- memcpy (&registers[REGISTER_BYTE (regno)], old_value, REGISTER_SIZE);
+ memcpy (&deprecated_registers[REGISTER_BYTE (regno)], old_value,
+ REGISTER_SIZE);
#if 0
/* thread_db doesn't seem to handle this right */
@@ -1540,7 +1542,6 @@ init_sol_thread_ops (void)
sol_thread_ops.to_longname = "Solaris threads and pthread.";
sol_thread_ops.to_doc = "Solaris threads and pthread support.";
sol_thread_ops.to_open = sol_thread_open;
- sol_thread_ops.to_close = 0;
sol_thread_ops.to_attach = sol_thread_attach;
sol_thread_ops.to_detach = sol_thread_detach;
sol_thread_ops.to_resume = sol_thread_resume;
@@ -1559,8 +1560,6 @@ init_sol_thread_ops (void)
sol_thread_ops.to_terminal_save_ours = terminal_save_ours;
sol_thread_ops.to_terminal_info = child_terminal_info;
sol_thread_ops.to_kill = sol_thread_kill_inferior;
- sol_thread_ops.to_load = 0;
- sol_thread_ops.to_lookup_symbol = 0;
sol_thread_ops.to_create_inferior = sol_thread_create_inferior;
sol_thread_ops.to_mourn_inferior = sol_thread_mourn_inferior;
sol_thread_ops.to_can_run = sol_thread_can_run;
@@ -1576,8 +1575,6 @@ init_sol_thread_ops (void)
sol_thread_ops.to_has_registers = 1;
sol_thread_ops.to_has_execution = 1;
sol_thread_ops.to_has_thread_control = tc_none;
- sol_thread_ops.to_sections = 0;
- sol_thread_ops.to_sections_end = 0;
sol_thread_ops.to_find_memory_regions = sol_find_memory_regions;
sol_thread_ops.to_make_corefile_notes = sol_make_note_section;
sol_thread_ops.to_magic = OPS_MAGIC;
@@ -1594,30 +1591,16 @@ init_sol_core_ops (void)
sol_core_ops.to_close = sol_core_close;
sol_core_ops.to_attach = sol_thread_attach;
sol_core_ops.to_detach = sol_core_detach;
- /* sol_core_ops.to_resume = 0; */
- /* sol_core_ops.to_wait = 0; */
sol_core_ops.to_fetch_registers = sol_thread_fetch_registers;
- /* sol_core_ops.to_store_registers = 0; */
- /* sol_core_ops.to_prepare_to_store = 0; */
sol_core_ops.to_xfer_memory = sol_thread_xfer_memory;
sol_core_ops.to_files_info = sol_core_files_info;
sol_core_ops.to_insert_breakpoint = ignore;
sol_core_ops.to_remove_breakpoint = ignore;
- /* sol_core_ops.to_terminal_init = 0; */
- /* sol_core_ops.to_terminal_inferior = 0; */
- /* sol_core_ops.to_terminal_ours_for_output = 0; */
- /* sol_core_ops.to_terminal_ours = 0; */
- /* sol_core_ops.to_terminal_info = 0; */
- /* sol_core_ops.to_kill = 0; */
- /* sol_core_ops.to_load = 0; */
- /* sol_core_ops.to_lookup_symbol = 0; */
sol_core_ops.to_create_inferior = sol_thread_create_inferior;
sol_core_ops.to_stratum = core_stratum;
- sol_core_ops.to_has_all_memory = 0;
sol_core_ops.to_has_memory = 1;
sol_core_ops.to_has_stack = 1;
sol_core_ops.to_has_registers = 1;
- sol_core_ops.to_has_execution = 0;
sol_core_ops.to_has_thread_control = tc_none;
sol_core_ops.to_thread_alive = sol_thread_alive;
sol_core_ops.to_pid_to_str = solaris_pid_to_str;
@@ -1626,8 +1609,6 @@ init_sol_core_ops (void)
<n> in procinfo list" where <n> is the pid of the process that produced
the core file. Disable it for now. */
/* sol_core_ops.to_find_new_threads = sol_find_new_threads; */
- sol_core_ops.to_sections = 0;
- sol_core_ops.to_sections_end = 0;
sol_core_ops.to_magic = OPS_MAGIC;
}
diff --git a/gdb/solib-sunos.c b/gdb/solib-sunos.c
index 374ec253a01..ae115673c2b 100644
--- a/gdb/solib-sunos.c
+++ b/gdb/solib-sunos.c
@@ -39,6 +39,8 @@
#include "gdbcore.h"
#include "inferior.h"
#include "solist.h"
+#include "bcache.h"
+#include "regcache.h"
/* Link map info to include in an allocated so_list entry */
@@ -135,10 +137,8 @@ allocate_rt_common_objfile (void)
objfile = (struct objfile *) xmalloc (sizeof (struct objfile));
memset (objfile, 0, sizeof (struct objfile));
objfile->md = NULL;
- obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0,
- xmalloc, xfree);
- obstack_specify_allocation (&objfile->macro_cache.cache, 0, 0,
- xmalloc, xfree);
+ objfile->psymbol_cache = bcache_xmalloc ();
+ objfile->macro_cache = bcache_xmalloc ();
obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
xfree);
obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 3f98a1eb433..78161e0d249 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -762,6 +762,77 @@ svr4_current_sos (void)
return head;
}
+/* Get the address of the link_map for a given OBJFILE. Loop through
+ the link maps, and return the address of the one corresponding to
+ the given objfile. Note that this function takes into account that
+ objfile can be the main executable, not just a shared library. The
+ main executable has always an empty name field in the linkmap. */
+
+CORE_ADDR
+svr4_fetch_objfile_link_map (struct objfile *objfile)
+{
+ CORE_ADDR lm;
+
+ if ((debug_base = locate_base ()) == 0)
+ return 0; /* failed somehow... */
+
+ /* Position ourselves on the first link map. */
+ lm = first_link_map_member ();
+ while (lm)
+ {
+ /* Get info on the layout of the r_debug and link_map structures. */
+ struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
+ int errcode;
+ char *buffer;
+ struct lm_info objfile_lm_info;
+ struct cleanup *old_chain;
+ CORE_ADDR name_address;
+ char *l_name_buf = xmalloc (lmo->l_name_size);
+ old_chain = make_cleanup (xfree, l_name_buf);
+
+ /* Set up the buffer to contain the portion of the link_map
+ structure that gdb cares about. Note that this is not the
+ whole link_map structure. */
+ objfile_lm_info.lm = xmalloc (lmo->link_map_size);
+ make_cleanup (xfree, objfile_lm_info.lm);
+ memset (objfile_lm_info.lm, 0, lmo->link_map_size);
+
+ /* Read the link map into our internal structure. */
+ read_memory (lm, objfile_lm_info.lm, lmo->link_map_size);
+
+ /* Read address of name from target memory to GDB. */
+ read_memory (lm + lmo->l_name_offset, l_name_buf, lmo->l_name_size);
+
+ /* Extract this object's name. */
+ name_address = extract_address (l_name_buf,
+ lmo->l_name_size);
+ target_read_string (name_address, &buffer,
+ SO_NAME_MAX_PATH_SIZE - 1, &errcode);
+ make_cleanup (xfree, buffer);
+ if (errcode != 0)
+ {
+ warning ("svr4_fetch_objfile_link_map: Can't read pathname for load map: %s\n",
+ safe_strerror (errcode));
+ }
+ else
+ {
+ /* Is this the linkmap for the file we want? */
+ /* If the file is not a shared library and has no name,
+ we are sure it is the main executable, so we return that. */
+ if ((buffer && strcmp (buffer, objfile->name) == 0)
+ || (!(objfile->flags & OBJF_SHARED) && (strcmp (buffer, "") == 0)))
+ {
+ do_cleanups (old_chain);
+ return lm;
+ }
+ }
+ /* Not the file we wanted, continue checking. */
+ lm = extract_address (objfile_lm_info.lm + lmo->l_next_offset,
+ lmo->l_next_size);
+ do_cleanups (old_chain);
+ }
+ return 0;
+}
/* On some systems, the only way to recognize the link map entry for
the main executable file is by looking at its name. Return
diff --git a/gdb/solib-svr4.h b/gdb/solib-svr4.h
index 8611dff8e6e..e41c240f2f8 100644
--- a/gdb/solib-svr4.h
+++ b/gdb/solib-svr4.h
@@ -72,6 +72,10 @@ struct link_map_offsets
extern void set_solib_svr4_fetch_link_map_offsets
(struct gdbarch *gdbarch, struct link_map_offsets *(*func) (void));
+/* This function is called by thread_db.c. Return the address of the
+ link map for the given objfile. */
+extern CORE_ADDR svr4_fetch_objfile_link_map (struct objfile *objfile);
+
/* legacy_svr4_fetch_link_map_offsets_hook is a pointer to a function
which is used to fetch link map offsets. It will only be set
by solib-legacy.c, if at all. */
diff --git a/gdb/source.c b/gdb/source.c
index 5c88a55db81..0107bfa2355 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1197,8 +1197,9 @@ print_source_lines (struct symtab *s, int line, int stopline, int noerror)
/* Print a list of files and line numbers which a user may choose from
in order to list a function which was specified ambiguously (as with
- `list classname::overloadedfuncname', for example). The vector in
- SALS provides the filenames and line numbers. */
+ `list classname::overloadedfuncname', or 'list objectiveCSelector:).
+ The vector in SALS provides the filenames and line numbers.
+ NOTE: some of the SALS may have no filename or line information! */
static void
ambiguous_line_spec (struct symtabs_and_lines *sals)
@@ -1220,7 +1221,7 @@ line_info (char *arg, int from_tty)
CORE_ADDR start_pc, end_pc;
int i;
- INIT_SAL (&sal); /* initialize to zeroes */
+ init_sal (&sal); /* initialize to zeroes */
if (arg == 0)
{
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index e892fe8fbda..b2c6d41430d 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -73,31 +73,34 @@ fetch_inferior_registers (int regno)
to the stack pointer. */
if (regno < O7_REGNUM /* including -1 */
|| regno >= Y_REGNUM
- || (!register_valid[SP_REGNUM] && regno < I7_REGNUM))
+ || (!deprecated_register_valid[SP_REGNUM] && regno < I7_REGNUM))
{
if (0 != ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_registers, 0))
perror ("ptrace_getregs");
- registers[REGISTER_BYTE (0)] = 0;
- memcpy (&registers[REGISTER_BYTE (1)], &inferior_registers.r_g1,
- 15 * REGISTER_RAW_SIZE (G0_REGNUM));
- *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
- *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
- *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc;
+ deprecated_registers[REGISTER_BYTE (0)] = 0;
+ memcpy (&deprecated_registers[REGISTER_BYTE (1)],
+ &inferior_registers.r_g1, 15 * REGISTER_RAW_SIZE (G0_REGNUM));
+ *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)]
+ = inferior_registers.r_ps;
+ *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)]
+ = inferior_registers.r_pc;
+ *(int *) &deprecated_registers[REGISTER_BYTE (NPC_REGNUM)]
+ = inferior_registers.r_npc;
*(int *) &registers[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
for (i = G0_REGNUM; i <= O7_REGNUM; i++)
- register_valid[i] = 1;
- register_valid[Y_REGNUM] = 1;
- register_valid[PS_REGNUM] = 1;
- register_valid[PC_REGNUM] = 1;
- register_valid[NPC_REGNUM] = 1;
+ deprecated_register_valid[i] = 1;
+ deprecated_register_valid[Y_REGNUM] = 1;
+ deprecated_register_valid[PS_REGNUM] = 1;
+ deprecated_register_valid[PC_REGNUM] = 1;
+ deprecated_register_valid[NPC_REGNUM] = 1;
/* If we don't set these valid, read_register_bytes() rereads
all the regs every time it is called! FIXME. */
- register_valid[WIM_REGNUM] = 1; /* Not true yet, FIXME */
- register_valid[TBR_REGNUM] = 1; /* Not true yet, FIXME */
- register_valid[CPS_REGNUM] = 1; /* Not true yet, FIXME */
+ deprecated_register_valid[WIM_REGNUM] = 1; /* Not true yet, FIXME */
+ deprecated_register_valid[TBR_REGNUM] = 1; /* Not true yet, FIXME */
+ deprecated_register_valid[CPS_REGNUM] = 1; /* Not true yet, FIXME */
}
/* Floating point registers */
@@ -109,35 +112,34 @@ fetch_inferior_registers (int regno)
(PTRACE_ARG3_TYPE) & inferior_fp_registers,
0))
perror ("ptrace_getfpregs");
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
- sizeof inferior_fp_registers.fpu_fr);
- memcpy (&registers[REGISTER_BYTE (FPS_REGNUM)],
- &inferior_fp_registers.Fpu_fsr,
- sizeof (FPU_FSR_TYPE));
+ memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ &inferior_fp_registers, sizeof inferior_fp_registers.fpu_fr);
+ memcpy (&deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
+ &inferior_fp_registers.Fpu_fsr, sizeof (FPU_FSR_TYPE));
for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
- register_valid[i] = 1;
- register_valid[FPS_REGNUM] = 1;
+ deprecated_register_valid[i] = 1;
+ deprecated_register_valid[FPS_REGNUM] = 1;
}
/* These regs are saved on the stack by the kernel. Only read them
all (16 ptrace calls!) if we really need them. */
if (regno == -1)
{
- CORE_ADDR sp = *(unsigned int *) & registers[REGISTER_BYTE (SP_REGNUM)];
- target_read_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)],
+ CORE_ADDR sp = *(unsigned int *) & deprecated_registers[REGISTER_BYTE (SP_REGNUM)];
+ target_read_memory (sp, &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
for (i = L0_REGNUM; i <= I7_REGNUM; i++)
- register_valid[i] = 1;
+ deprecated_register_valid[i] = 1;
}
else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
{
- CORE_ADDR sp = *(unsigned int *) & registers[REGISTER_BYTE (SP_REGNUM)];
+ CORE_ADDR sp = *(unsigned int *) & deprecated_registers[REGISTER_BYTE (SP_REGNUM)];
i = REGISTER_BYTE (regno);
- if (register_valid[regno])
+ if (deprecated_register_valid[regno])
printf_unfiltered ("register %d valid and read\n", regno);
target_read_memory (sp + i - REGISTER_BYTE (L0_REGNUM),
- &registers[i], REGISTER_RAW_SIZE (regno));
- register_valid[regno] = 1;
+ &deprecated_registers[i], REGISTER_RAW_SIZE (regno));
+ deprecated_register_valid[regno] = 1;
}
}
@@ -195,22 +197,22 @@ store_inferior_registers (int regno)
if (wanna_store & STACK_REGS)
{
- CORE_ADDR sp = *(unsigned int *) & registers[REGISTER_BYTE (SP_REGNUM)];
+ CORE_ADDR sp = *(unsigned int *) & deprecated_registers[REGISTER_BYTE (SP_REGNUM)];
if (regno < 0 || regno == SP_REGNUM)
{
- if (!register_valid[L0_REGNUM + 5])
+ if (!deprecated_register_valid[L0_REGNUM + 5])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
target_write_memory (sp,
- &registers[REGISTER_BYTE (L0_REGNUM)],
+ &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
}
else
{
- if (!register_valid[regno])
+ if (!deprecated_register_valid[regno])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
target_write_memory (sp + REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM),
- &registers[REGISTER_BYTE (regno)],
+ &deprecated_registers[REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
}
@@ -218,20 +220,21 @@ store_inferior_registers (int regno)
if (wanna_store & INT_REGS)
{
- if (!register_valid[G1_REGNUM])
+ if (!deprecated_register_valid[G1_REGNUM])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
- memcpy (&inferior_registers.r_g1, &registers[REGISTER_BYTE (G1_REGNUM)],
+ memcpy (&inferior_registers.r_g1,
+ &deprecated_registers[REGISTER_BYTE (G1_REGNUM)],
15 * REGISTER_RAW_SIZE (G1_REGNUM));
inferior_registers.r_ps =
- *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
+ *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)];
inferior_registers.r_pc =
- *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
+ *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)];
inferior_registers.r_npc =
- *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)];
+ *(int *) &deprecated_registers[REGISTER_BYTE (NPC_REGNUM)];
inferior_registers.r_y =
- *(int *) &registers[REGISTER_BYTE (Y_REGNUM)];
+ *(int *) &deprecated_registers[REGISTER_BYTE (Y_REGNUM)];
if (0 != ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_registers, 0))
@@ -240,12 +243,14 @@ store_inferior_registers (int regno)
if (wanna_store & FP_REGS)
{
- if (!register_valid[FP0_REGNUM + 9])
+ if (!deprecated_register_valid[FP0_REGNUM + 9])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
- memcpy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (&inferior_fp_registers,
+ &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
sizeof inferior_fp_registers.fpu_fr);
memcpy (&inferior_fp_registers.Fpu_fsr,
- &registers[REGISTER_BYTE (FPS_REGNUM)], sizeof (FPU_FSR_TYPE));
+ &deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
+ sizeof (FPU_FSR_TYPE));
if (0 !=
ptrace (PTRACE_SETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_fp_registers, 0))
@@ -277,15 +282,15 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
#define gregs ((struct regs *)core_reg_sect)
/* G0 *always* holds 0. */
- *(int *) &registers[REGISTER_BYTE (0)] = 0;
+ *(int *) &deprecated_registers[REGISTER_BYTE (0)] = 0;
/* The globals and output registers. */
- memcpy (&registers[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1,
+ memcpy (&deprecated_registers[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1,
15 * REGISTER_RAW_SIZE (G1_REGNUM));
- *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
- *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
- *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc;
- *(int *) &registers[REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
+ *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
+ *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
+ *(int *) &deprecated_registers[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc;
+ *(int *) &deprecated_registers[REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
/* My best guess at where to get the locals and input
registers is exactly where they usually are, right above
@@ -295,8 +300,9 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
{
int sp;
- sp = *(int *) &registers[REGISTER_BYTE (SP_REGNUM)];
- if (0 != target_read_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)],
+ sp = *(int *) &deprecated_registers[REGISTER_BYTE (SP_REGNUM)];
+ if (0 != target_read_memory (sp,
+ &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM)))
{
/* fprintf_unfiltered so user can still use gdb */
@@ -313,10 +319,10 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
#define fpuregs ((struct fpu *) core_reg_sect)
if (core_reg_size >= sizeof (struct fpu))
{
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], fpuregs->fpu_regs,
- sizeof (fpuregs->fpu_regs));
- memcpy (&registers[REGISTER_BYTE (FPS_REGNUM)], &fpuregs->fpu_fsr,
- sizeof (FPU_FSR_TYPE));
+ memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ fpuregs->fpu_regs, sizeof (fpuregs->fpu_regs));
+ memcpy (&deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
+ &fpuregs->fpu_fsr, sizeof (FPU_FSR_TYPE));
}
else
fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 033cc8170bf..af43c9f1ca9 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -315,7 +315,7 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
it later. */
if (fi->next->next != NULL
&& (fi->next->next->signal_handler_caller
- || frame_in_dummy (fi->next->next))
+ || deprecated_frame_in_dummy (fi->next->next))
&& frameless_look_for_prologue (fi->next))
{
/* A frameless function interrupted by a signal did not change
@@ -488,7 +488,7 @@ sparc_frame_saved_pc (struct frame_info *frame)
else if (frame->extra_info->in_prologue ||
(frame->next != NULL &&
(frame->next->signal_handler_caller ||
- frame_in_dummy (frame->next)) &&
+ deprecated_frame_in_dummy (frame->next)) &&
frameless_look_for_prologue (frame)))
{
/* A frameless function interrupted by a signal did not save
@@ -956,7 +956,7 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
*lval = lval_register;
addr = REGISTER_BYTE (regnum);
if (raw_buffer != NULL)
- read_register_gen (regnum, raw_buffer);
+ deprecated_read_register_gen (regnum, raw_buffer);
}
if (addrp != NULL)
*addrp = addr;
@@ -990,32 +990,34 @@ sparc_push_dummy_frame (void)
if (GDB_TARGET_IS_SPARC64)
{
/* PC, NPC, CCR, FSR, FPRS, Y, ASI */
- read_register_bytes (REGISTER_BYTE (PC_REGNUM), &register_temp[0],
- REGISTER_RAW_SIZE (PC_REGNUM) * 7);
- read_register_bytes (REGISTER_BYTE (PSTATE_REGNUM),
- &register_temp[7 * SPARC_INTREG_SIZE],
- REGISTER_RAW_SIZE (PSTATE_REGNUM));
+ deprecated_read_register_bytes (REGISTER_BYTE (PC_REGNUM),
+ &register_temp[0],
+ REGISTER_RAW_SIZE (PC_REGNUM) * 7);
+ deprecated_read_register_bytes (REGISTER_BYTE (PSTATE_REGNUM),
+ &register_temp[7 * SPARC_INTREG_SIZE],
+ REGISTER_RAW_SIZE (PSTATE_REGNUM));
/* FIXME: not sure what needs to be saved here. */
}
else
{
/* Y, PS, WIM, TBR, PC, NPC, FPS, CPS regs */
- read_register_bytes (REGISTER_BYTE (Y_REGNUM), &register_temp[0],
- REGISTER_RAW_SIZE (Y_REGNUM) * 8);
+ deprecated_read_register_bytes (REGISTER_BYTE (Y_REGNUM),
+ &register_temp[0],
+ REGISTER_RAW_SIZE (Y_REGNUM) * 8);
}
- read_register_bytes (REGISTER_BYTE (O0_REGNUM),
- &register_temp[8 * SPARC_INTREG_SIZE],
- SPARC_INTREG_SIZE * 8);
+ deprecated_read_register_bytes (REGISTER_BYTE (O0_REGNUM),
+ &register_temp[8 * SPARC_INTREG_SIZE],
+ SPARC_INTREG_SIZE * 8);
- read_register_bytes (REGISTER_BYTE (G0_REGNUM),
- &register_temp[16 * SPARC_INTREG_SIZE],
- SPARC_INTREG_SIZE * 8);
+ deprecated_read_register_bytes (REGISTER_BYTE (G0_REGNUM),
+ &register_temp[16 * SPARC_INTREG_SIZE],
+ SPARC_INTREG_SIZE * 8);
if (SPARC_HAS_FPU)
- read_register_bytes (REGISTER_BYTE (FP0_REGNUM),
- &register_temp[24 * SPARC_INTREG_SIZE],
- FP_REGISTER_BYTES);
+ deprecated_read_register_bytes (REGISTER_BYTE (FP0_REGNUM),
+ &register_temp[24 * SPARC_INTREG_SIZE],
+ FP_REGISTER_BYTES);
sp -= DUMMY_STACK_SIZE;
@@ -1237,28 +1239,28 @@ sparc_pop_frame (void)
if (fsr[FP0_REGNUM])
{
read_memory (fsr[FP0_REGNUM], raw_buffer, FP_REGISTER_BYTES);
- write_register_bytes (REGISTER_BYTE (FP0_REGNUM),
- raw_buffer, FP_REGISTER_BYTES);
+ deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM),
+ raw_buffer, FP_REGISTER_BYTES);
}
if (!(GDB_TARGET_IS_SPARC64))
{
if (fsr[FPS_REGNUM])
{
read_memory (fsr[FPS_REGNUM], raw_buffer, SPARC_INTREG_SIZE);
- write_register_gen (FPS_REGNUM, raw_buffer);
+ deprecated_write_register_gen (FPS_REGNUM, raw_buffer);
}
if (fsr[CPS_REGNUM])
{
read_memory (fsr[CPS_REGNUM], raw_buffer, SPARC_INTREG_SIZE);
- write_register_gen (CPS_REGNUM, raw_buffer);
+ deprecated_write_register_gen (CPS_REGNUM, raw_buffer);
}
}
}
if (fsr[G1_REGNUM])
{
read_memory (fsr[G1_REGNUM], raw_buffer, 7 * SPARC_INTREG_SIZE);
- write_register_bytes (REGISTER_BYTE (G1_REGNUM), raw_buffer,
- 7 * SPARC_INTREG_SIZE);
+ deprecated_write_register_bytes (REGISTER_BYTE (G1_REGNUM), raw_buffer,
+ 7 * SPARC_INTREG_SIZE);
}
if (frame->extra_info->flat)
@@ -1310,11 +1312,11 @@ sparc_pop_frame (void)
/* Restore the out registers.
Among other things this writes the new stack pointer. */
- write_register_bytes (REGISTER_BYTE (O0_REGNUM), raw_buffer,
- SPARC_INTREG_SIZE * 8);
+ deprecated_write_register_bytes (REGISTER_BYTE (O0_REGNUM), raw_buffer,
+ SPARC_INTREG_SIZE * 8);
- write_register_bytes (REGISTER_BYTE (L0_REGNUM), reg_temp,
- SPARC_INTREG_SIZE * 16);
+ deprecated_write_register_bytes (REGISTER_BYTE (L0_REGNUM), reg_temp,
+ SPARC_INTREG_SIZE * 16);
}
if (!(GDB_TARGET_IS_SPARC64))
@@ -1609,37 +1611,37 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
for (regi = 0; regi <= R_I7; regi++)
if ((regno == -1) || (regno == regi))
- read_register_gen (regi, (char *) (regp + regi) + offset);
+ deprecated_read_register_gen (regi, (char *) (regp + regi) + offset);
if ((regno == -1) || (regno == PC_REGNUM))
- read_register_gen (PC_REGNUM, (char *) (regp + R_PC) + offset);
+ deprecated_read_register_gen (PC_REGNUM, (char *) (regp + R_PC) + offset);
if ((regno == -1) || (regno == NPC_REGNUM))
- read_register_gen (NPC_REGNUM, (char *) (regp + R_nPC) + offset);
+ deprecated_read_register_gen (NPC_REGNUM, (char *) (regp + R_nPC) + offset);
if ((regno == -1) || (regno == Y_REGNUM))
- read_register_gen (Y_REGNUM, (char *) (regp + R_Y) + offset);
+ deprecated_read_register_gen (Y_REGNUM, (char *) (regp + R_Y) + offset);
if (GDB_TARGET_IS_SPARC64)
{
#ifdef R_CCR
if (regno == -1 || regno == CCR_REGNUM)
- read_register_gen (CCR_REGNUM, ((char *) (regp + R_CCR)) + offset);
+ deprecated_read_register_gen (CCR_REGNUM, ((char *) (regp + R_CCR)) + offset);
#endif
#ifdef R_FPRS
if (regno == -1 || regno == FPRS_REGNUM)
- read_register_gen (FPRS_REGNUM, ((char *) (regp + R_FPRS)) + offset);
+ deprecated_read_register_gen (FPRS_REGNUM, ((char *) (regp + R_FPRS)) + offset);
#endif
#ifdef R_ASI
if (regno == -1 || regno == ASI_REGNUM)
- read_register_gen (ASI_REGNUM, ((char *) (regp + R_ASI)) + offset);
+ deprecated_read_register_gen (ASI_REGNUM, ((char *) (regp + R_ASI)) + offset);
#endif
}
else /* sparc32 */
{
#ifdef R_PS
if (regno == -1 || regno == PS_REGNUM)
- read_register_gen (PS_REGNUM, ((char *) (regp + R_PS)) + offset);
+ deprecated_read_register_gen (PS_REGNUM, ((char *) (regp + R_PS)) + offset);
#endif
/* For 64-bit hosts, R_WIM and R_TBR may not be defined.
@@ -1655,18 +1657,18 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
#if defined (R_WIM)
if (regno == -1 || regno == WIM_REGNUM)
- read_register_gen (WIM_REGNUM, ((char *) (regp + R_WIM)) + offset);
+ deprecated_read_register_gen (WIM_REGNUM, ((char *) (regp + R_WIM)) + offset);
#else
if (regno == -1 || regno == WIM_REGNUM)
- read_register_gen (WIM_REGNUM, NULL);
+ deprecated_read_register_gen (WIM_REGNUM, NULL);
#endif
#if defined (R_TBR)
if (regno == -1 || regno == TBR_REGNUM)
- read_register_gen (TBR_REGNUM, ((char *) (regp + R_TBR)) + offset);
+ deprecated_read_register_gen (TBR_REGNUM, ((char *) (regp + R_TBR)) + offset);
#else
if (regno == -1 || regno == TBR_REGNUM)
- read_register_gen (TBR_REGNUM, NULL);
+ deprecated_read_register_gen (TBR_REGNUM, NULL);
#endif
}
}
@@ -1727,7 +1729,7 @@ fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- from = (char *) &registers[REGISTER_BYTE (regi)];
+ from = (char *) &deprecated_registers[REGISTER_BYTE (regi)];
to = (char *) &fpregsetp->pr_fr.pr_regs[regi - FP0_REGNUM];
memcpy (to, from, REGISTER_RAW_SIZE (regi));
}
@@ -1736,7 +1738,7 @@ fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
if (!(GDB_TARGET_IS_SPARC64)) /* FIXME: does Sparc64 have this register? */
if ((regno == -1) || (regno == FPS_REGNUM))
{
- from = (char *)&registers[REGISTER_BYTE (FPS_REGNUM)];
+ from = (char *)&deprecated_registers[REGISTER_BYTE (FPS_REGNUM)];
to = (char *) &fpregsetp->pr_fsr;
memcpy (to, from, REGISTER_RAW_SIZE (FPS_REGNUM));
}
@@ -1858,7 +1860,7 @@ decode_asi (int val)
Pretty print various registers. */
/* FIXME: Would be nice if this did some fancy things for 32 bit sparc. */
-void
+static void
sparc_print_register_hook (int regno)
{
ULONGEST val;
@@ -2028,6 +2030,146 @@ sparc_print_register_hook (int regno)
#undef BITS
}
+
+static void
+sparc_print_registers (struct gdbarch *gdbarch,
+ struct ui_file *file,
+ struct frame_info *frame,
+ int regnum, int print_all,
+ void (*print_register_hook) (int))
+{
+ int i;
+ const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
+
+ for (i = 0; i < numregs; i++)
+ {
+ /* Decide between printing all regs, non-float / vector regs, or
+ specific reg. */
+ if (regnum == -1)
+ {
+ if (!print_all)
+ {
+ if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
+ continue;
+ if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)))
+ continue;
+ }
+ }
+ else
+ {
+ if (i != regnum)
+ continue;
+ }
+
+ /* If the register name is empty, it is undefined for this
+ processor, so don't display anything. */
+ if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0')
+ continue;
+
+ fputs_filtered (REGISTER_NAME (i), file);
+ print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), file);
+
+ /* Get the data in raw format. */
+ if (! frame_register_read (frame, i, raw_buffer))
+ {
+ fprintf_filtered (file, "*value not available*\n");
+ continue;
+ }
+
+ /* FIXME: cagney/2002-08-03: This code shouldn't be necessary.
+ The function frame_register_read() should have returned the
+ pre-cooked register so no conversion is necessary. */
+ /* Convert raw data to virtual format if necessary. */
+ if (REGISTER_CONVERTIBLE (i))
+ {
+ REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i),
+ raw_buffer, virtual_buffer);
+ }
+ else
+ {
+ memcpy (virtual_buffer, raw_buffer,
+ REGISTER_VIRTUAL_SIZE (i));
+ }
+
+ /* If virtual format is floating, print it that way, and in raw
+ hex. */
+ if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
+ {
+ int j;
+
+ val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ file, 0, 1, 0, Val_pretty_default);
+
+ fprintf_filtered (file, "\t(raw 0x");
+ for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
+ {
+ int idx;
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ idx = j;
+ else
+ idx = REGISTER_RAW_SIZE (i) - 1 - j;
+ fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[idx]);
+ }
+ fprintf_filtered (file, ")");
+ }
+ else
+ {
+ /* Print the register in hex. */
+ val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ file, 'x', 1, 0, Val_pretty_default);
+ /* If not a vector register, print it also according to its
+ natural format. */
+ if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)) == 0)
+ {
+ fprintf_filtered (file, "\t");
+ val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ file, 0, 1, 0, Val_pretty_default);
+ }
+ }
+
+ /* Some sparc specific info. */
+ if (print_register_hook != NULL)
+ print_register_hook (i);
+
+ fprintf_filtered (file, "\n");
+ }
+}
+
+static void
+sparc_print_registers_info (struct gdbarch *gdbarch,
+ struct ui_file *file,
+ struct frame_info *frame,
+ int regnum, int print_all)
+{
+ sparc_print_registers (gdbarch, file, frame, regnum, print_all,
+ sparc_print_register_hook);
+}
+
+void
+sparc_do_registers_info (int regnum, int all)
+{
+ sparc_print_registers_info (current_gdbarch, gdb_stdout, selected_frame,
+ regnum, all);
+}
+
+static void
+sparclet_print_registers_info (struct gdbarch *gdbarch,
+ struct ui_file *file,
+ struct frame_info *frame,
+ int regnum, int print_all)
+{
+ sparc_print_registers (gdbarch, file, frame, regnum, print_all, NULL);
+}
+
+void
+sparclet_do_registers_info (int regnum, int all)
+{
+ sparclet_print_registers_info (current_gdbarch, gdb_stdout, selected_frame,
+ regnum, all);
+}
+
int
gdb_print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
@@ -2099,7 +2241,7 @@ sparc32_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
for (j = 0;
j < m_arg->len && oregnum < 6;
j += SPARC_INTREG_SIZE, oregnum++)
- write_register_gen (O0_REGNUM + oregnum, m_arg->contents + j);
+ deprecated_write_register_gen (O0_REGNUM + oregnum, m_arg->contents + j);
}
return sp;
@@ -2155,18 +2297,19 @@ sparc_store_return_value (struct type *type, char *valbuf)
memset (buffer, 0, REGISTER_RAW_SIZE (regno));
memcpy (buffer + REGISTER_RAW_SIZE (regno) - TYPE_LENGTH (type), valbuf,
TYPE_LENGTH (type));
- write_register_gen (regno, buffer);
+ deprecated_write_register_gen (regno, buffer);
}
else
- write_register_bytes (REGISTER_BYTE (regno), valbuf, TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (regno), valbuf,
+ TYPE_LENGTH (type));
}
extern void
sparclet_store_return_value (struct type *type, char *valbuf)
{
/* Other values are returned in register %o0. */
- write_register_bytes (REGISTER_BYTE (O0_REGNUM), valbuf,
- TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (O0_REGNUM), valbuf,
+ TYPE_LENGTH (type));
}
@@ -2427,9 +2570,9 @@ sparc64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
default:
internal_error (__FILE__, __LINE__, "bad switch");
}
- write_register_bytes (REGISTER_BYTE (fpreg),
- VALUE_CONTENTS (args[i]),
- len);
+ deprecated_write_register_bytes (REGISTER_BYTE (fpreg),
+ VALUE_CONTENTS (args[i]),
+ len);
}
}
else /* all other args go into the first six 'o' registers */
@@ -2440,7 +2583,7 @@ sparc64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
{
int oreg = O0_REGNUM + register_counter;
- write_register_gen (oreg, VALUE_CONTENTS (copyarg) + j);
+ deprecated_write_register_gen (oreg, VALUE_CONTENTS (copyarg) + j);
register_counter += 1;
}
}
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 4697b4067e7..fcd6046d8dd 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -169,6 +169,8 @@ static int
read_cfront_member_functions (struct field_info *, char **,
struct type *, struct objfile *);
+static char *find_name_end (char *name);
+
/* end new functions added for cfront support */
static void
@@ -185,10 +187,8 @@ resolve_symbol_reference (struct objfile *, struct symbol *, char *);
void stabsread_clear_cache (void);
-static const char vptr_name[] =
-{'_', 'v', 'p', 't', 'r', CPLUS_MARKER, '\0'};
-static const char vb_name[] =
-{'_', 'v', 'b', CPLUS_MARKER, '\0'};
+static const char vptr_name[] = "_vptr$";
+static const char vb_name[] = "_vb$";
/* Define this as 1 if a pcc declaration of a char or short argument
gives the correct address. Otherwise assume pcc gives the
@@ -202,46 +202,46 @@ static const char vb_name[] =
#define BELIEVE_PCC_PROMOTION_TYPE 0
#endif
-static struct complaint invalid_cpp_abbrev_complaint =
+static struct deprecated_complaint invalid_cpp_abbrev_complaint =
{"invalid C++ abbreviation `%s'", 0, 0};
-static struct complaint invalid_cpp_type_complaint =
+static struct deprecated_complaint invalid_cpp_type_complaint =
{"C++ abbreviated type name unknown at symtab pos %d", 0, 0};
-static struct complaint member_fn_complaint =
+static struct deprecated_complaint member_fn_complaint =
{"member function type missing, got '%c'", 0, 0};
-static struct complaint const_vol_complaint =
+static struct deprecated_complaint const_vol_complaint =
{"const/volatile indicator missing, got '%c'", 0, 0};
-static struct complaint error_type_complaint =
+static struct deprecated_complaint error_type_complaint =
{"couldn't parse type; debugger out of date?", 0, 0};
-static struct complaint invalid_member_complaint =
+static struct deprecated_complaint invalid_member_complaint =
{"invalid (minimal) member type data format at symtab pos %d.", 0, 0};
-static struct complaint range_type_base_complaint =
+static struct deprecated_complaint range_type_base_complaint =
{"base type %d of range type is not defined", 0, 0};
-static struct complaint reg_value_complaint =
+static struct deprecated_complaint reg_value_complaint =
{"register number %d too large (max %d) in symbol %s", 0, 0};
-static struct complaint vtbl_notfound_complaint =
+static struct deprecated_complaint vtbl_notfound_complaint =
{"virtual function table pointer not found when defining class `%s'", 0, 0};
-static struct complaint unrecognized_cplus_name_complaint =
+static struct deprecated_complaint unrecognized_cplus_name_complaint =
{"Unknown C++ symbol name `%s'", 0, 0};
-static struct complaint rs6000_builtin_complaint =
+static struct deprecated_complaint rs6000_builtin_complaint =
{"Unknown builtin type %d", 0, 0};
-static struct complaint unresolved_sym_chain_complaint =
+static struct deprecated_complaint unresolved_sym_chain_complaint =
{"%s: common block `%s' from global_sym_chain unresolved", 0, 0};
-static struct complaint stabs_general_complaint =
+static struct deprecated_complaint stabs_general_complaint =
{"%s", 0, 0};
-static struct complaint lrs_general_complaint =
+static struct deprecated_complaint lrs_general_complaint =
{"%s", 0, 0};
/* Make a list of forward references which haven't been defined. */
@@ -311,7 +311,7 @@ dbx_lookup_type (int typenums[2])
if (filenum < 0 || filenum >= n_this_object_header_files)
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"\
Invalid symbol data: type number (%d,%d) out of range at symtab pos %d.",
0, 0};
@@ -618,11 +618,11 @@ static int
read_cfront_baseclasses (struct field_info *fip, char **pp, struct type *type,
struct objfile *objfile)
{
- static struct complaint msg_unknown =
+ static struct deprecated_complaint msg_unknown =
{"\
Unsupported token in stabs string %s.\n",
0, 0};
- static struct complaint msg_notfound =
+ static struct deprecated_complaint msg_notfound =
{"\
Unable to find base type for %s.\n",
0, 0};
@@ -692,7 +692,7 @@ read_cfront_baseclasses (struct field_info *fip, char **pp, struct type *type,
/* Bad visibility format. Complain and treat it as
public. */
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{
"Unknown visibility `%c' for baseclass", 0, 0};
complain (&msg, new->visibility);
@@ -810,7 +810,7 @@ read_cfront_member_functions (struct field_info *fip, char **pp,
ref_func = lookup_symbol (fname, 0, VAR_NAMESPACE, 0, 0); /* demangled name */
if (!ref_func)
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"\
Unable to find function symbol for %s\n",
0, 0};
@@ -1273,7 +1273,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
struct objfile *objfile)
{
register struct symbol *sym;
- char *p = (char *) strchr (string, ':');
+ char *p = (char *) find_name_end (string);
int deftype;
int synonym = 0;
register int i;
@@ -2006,7 +2006,8 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
a typedef for "foo". Unfortunately, cfront never makes the typedef
when translating C++ into C. We make the typedef here so that
"ptype foo" works as expected for cfront translated code. */
- else if (current_subfile->language == language_cplus)
+ else if ((current_subfile->language == language_cplus)
+ || (current_subfile->language == language_objc))
synonym = 1;
SYMBOL_TYPE (sym) = read_type (&p, objfile);
@@ -2434,7 +2435,7 @@ again:
{
/* Complain and keep going, so compilers can invent new
cross-reference types. */
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"Unrecognized cross-reference type `%c'", 0, 0};
complain (&msg, (*pp)[0]);
code = TYPE_CODE_STRUCT;
@@ -2659,7 +2660,7 @@ again:
++*pp;
else
{
- static struct complaint msg = {
+ static struct deprecated_complaint msg = {
"Prototyped function type didn't end arguments with `#':\n%s",
0, 0
};
@@ -3179,8 +3180,7 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
/* This lets the user type "break operator+".
We could just put in "+" as the name, but that wouldn't
work for "*". */
- static char opname[32] =
- {'o', 'p', CPLUS_MARKER};
+ static char opname[32] = "op$";
char *o = opname + 3;
/* Skip past '::'. */
@@ -4018,7 +4018,7 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type,
default:
/* Unknown character. Complain and treat it as non-virtual. */
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{
"Unknown virtual character `%c' for baseclass", 0, 0};
complain (&msg, **pp);
@@ -4037,7 +4037,7 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type,
/* Bad visibility format. Complain and treat it as
public. */
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{
"Unknown visibility `%c' for baseclass", 0, 0
};
@@ -4138,8 +4138,9 @@ read_tilde_fields (struct field_info *fip, char **pp, struct type *type,
i >= TYPE_N_BASECLASSES (t);
--i)
{
- if (!strncmp (TYPE_FIELD_NAME (t, i), vptr_name,
- sizeof (vptr_name) - 1))
+ char *name = TYPE_FIELD_NAME (t, i);
+ if (!strncmp (name, vptr_name, sizeof (vptr_name) - 2)
+ && is_cplus_marker (name[sizeof (vptr_name) - 2]))
{
TYPE_VPTR_FIELDNO (type) = i;
goto gotit;
@@ -4209,7 +4210,7 @@ read_cfront_static_fields (struct field_info *fip, char **pp, struct type *type,
ref_static = lookup_symbol (sname, 0, VAR_NAMESPACE, 0, 0); /*demangled_name */
if (!ref_static)
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"\
Unable to find symbol for static data field %s\n",
0, 0};
@@ -4388,7 +4389,7 @@ attach_fields_to_type (struct field_info *fip, register struct type *type,
default:
/* Unknown visibility. Complain and treat it as public. */
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{
"Unknown visibility `%c' for field", 0, 0};
complain (&msg, fip->list->visibility);
@@ -4401,7 +4402,7 @@ attach_fields_to_type (struct field_info *fip, register struct type *type,
}
-static struct complaint multiply_defined_struct =
+static struct deprecated_complaint multiply_defined_struct =
{"struct/union type gets multiply defined: %s%s", 0, 0};
@@ -5213,7 +5214,7 @@ common_block_start (char *name, struct objfile *objfile)
{
if (common_block_name != NULL)
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{
"Invalid symbol data: common block within common block",
0, 0};
@@ -5243,7 +5244,7 @@ common_block_end (struct objfile *objfile)
if (common_block_name == NULL)
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"ECOMM symbol unmatched by BCOMM", 0, 0};
complain (&msg);
return;
@@ -5358,7 +5359,7 @@ cleanup_undefined_types (void)
if (typename == NULL)
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"need a type name", 0, 0};
complain (&msg);
break;
@@ -5383,7 +5384,7 @@ cleanup_undefined_types (void)
default:
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"\
GDB internal error. cleanup_undefined_types with bad type %d.", 0, 0};
complain (&msg, TYPE_CODE (*type));
@@ -5618,6 +5619,32 @@ finish_global_stabs (struct objfile *objfile)
}
}
+/* Find the end of the name, delimited by a ':', but don't match
+ ObjC symbols which look like -[Foo bar::]:bla. */
+static char *
+find_name_end (char *name)
+{
+ char *s = name;
+ if (s[0] == '-' || *s == '+')
+ {
+ /* Must be an ObjC method symbol. */
+ if (s[1] != '[')
+ {
+ error ("invalid symbol name \"%s\"", name);
+ }
+ s = strchr (s, ']');
+ if (s == NULL)
+ {
+ error ("invalid symbol name \"%s\"", name);
+ }
+ return strchr (s, ':');
+ }
+ else
+ {
+ return strchr (s, ':');
+ }
+}
+
/* Initializer for this module */
void
diff --git a/gdb/stabsread.h b/gdb/stabsread.h
index d470d477a82..1371f6c56ce 100644
--- a/gdb/stabsread.h
+++ b/gdb/stabsread.h
@@ -128,8 +128,8 @@ EXTERN int n_this_object_header_files;
EXTERN int n_allocated_this_object_header_files;
-extern struct complaint unknown_symtype_complaint;
-extern struct complaint unknown_symchar_complaint;
+extern struct deprecated_complaint unknown_symtype_complaint;
+extern struct deprecated_complaint unknown_symchar_complaint;
extern struct type *read_type (char **, struct objfile *);
diff --git a/gdb/stack.c b/gdb/stack.c
index f36e651a375..b9a3033d87d 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -350,7 +350,7 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args)
to check for a bp_call_dummy breakpoint. */
if (PC_IN_CALL_DUMMY (fi->pc, sp, fi->frame))
#else
- if (frame_in_dummy (fi))
+ if (deprecated_frame_in_dummy (fi))
#endif
{
annotate_frame_begin (level == -1 ? 0 : level, fi->pc);
@@ -394,7 +394,7 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args)
find_pc_line (fi->pc,
fi->next != NULL
&& !fi->next->signal_handler_caller
- && !frame_in_dummy (fi->next));
+ && !deprecated_frame_in_dummy (fi->next));
location_print = (source == LOCATION
|| source == LOC_AND_ADDRESS
@@ -794,7 +794,7 @@ frame_info (char *addr_exp, int from_tty)
sal = find_pc_line (fi->pc,
fi->next != NULL
&& !fi->next->signal_handler_caller
- && !frame_in_dummy (fi->next));
+ && !deprecated_frame_in_dummy (fi->next));
func = get_frame_function (fi);
s = find_pc_symtab (fi->pc);
if (func)
diff --git a/gdb/sun3-nat.c b/gdb/sun3-nat.c
index 988ed37ad06..1df78589bdb 100644
--- a/gdb/sun3-nat.c
+++ b/gdb/sun3-nat.c
@@ -36,7 +36,7 @@ fetch_inferior_registers (int regno)
struct regs inferior_registers;
struct fp_status inferior_fp_registers;
- registers_fetched ();
+ deprecated_registers_fetched ();
ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_registers);
@@ -45,15 +45,15 @@ fetch_inferior_registers (int regno)
ptrace (PTRACE_GETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_fp_registers);
- memcpy (registers, &inferior_registers, 16 * 4);
+ memcpy (deprecated_registers, &inferior_registers, 16 * 4);
if (FP0_REGNUM >= 0)
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
- sizeof inferior_fp_registers.fps_regs);
+ memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ &inferior_fp_registers, sizeof inferior_fp_registers.fps_regs);
- *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
- *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
+ *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
+ *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
if (FP0_REGNUM >= 0)
- memcpy (&registers[REGISTER_BYTE (FPC_REGNUM)],
+ memcpy (&deprecated_registers[REGISTER_BYTE (FPC_REGNUM)],
&inferior_fp_registers.fps_control,
sizeof inferior_fp_registers -
sizeof inferior_fp_registers.fps_regs);
@@ -69,17 +69,18 @@ store_inferior_registers (int regno)
struct regs inferior_registers;
struct fp_status inferior_fp_registers;
- memcpy (&inferior_registers, registers, 16 * 4);
+ memcpy (&inferior_registers, deprecated_registers, 16 * 4);
if (FP0_REGNUM >= 0)
- memcpy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (&inferior_fp_registers,
+ &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
sizeof inferior_fp_registers.fps_regs);
- inferior_registers.r_ps = *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
- inferior_registers.r_pc = *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
+ inferior_registers.r_ps = *(int *) &&deprecated_registers[REGISTER_BYTE (PS_REGNUM)];
+ inferior_registers.r_pc = *(int *) &&deprecated_registers[REGISTER_BYTE (PC_REGNUM)];
if (FP0_REGNUM >= 0)
memcpy (&inferior_fp_registers.fps_control,
- &registers[REGISTER_BYTE (FPC_REGNUM)],
+ &&deprecated_registers[REGISTER_BYTE (FPC_REGNUM)],
sizeof inferior_fp_registers -
sizeof inferior_fp_registers.fps_regs);
@@ -116,7 +117,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
if (core_reg_size < sizeof (struct regs))
error ("Can't find registers in core file");
- memcpy (registers, (char *) regs, 16 * 4);
+ memcpy (&deprecated_registers, (char *) regs, 16 * 4);
supply_register (PS_REGNUM, (char *) &regs->r_ps);
supply_register (PC_REGNUM, (char *) &regs->r_pc);
@@ -130,10 +131,10 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
{
if (FP0_REGNUM >= 0)
{
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (&&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
fpustruct->f_fpstatus.fps_regs,
sizeof fpustruct->f_fpstatus.fps_regs);
- memcpy (&registers[REGISTER_BYTE (FPC_REGNUM)],
+ memcpy (&&deprecated_registers[REGISTER_BYTE (FPC_REGNUM)],
&fpustruct->f_fpstatus.fps_control,
sizeof fpustruct->f_fpstatus -
sizeof fpustruct->f_fpstatus.fps_regs);
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 66bbf714984..28c84f9814e 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -299,16 +299,16 @@ sort_symtab_syms (register struct symtab *s)
may be part of a larger string and we are only saving a substring. */
char *
-obsavestring (char *ptr, int size, struct obstack *obstackp)
+obsavestring (const char *ptr, int size, struct obstack *obstackp)
{
register char *p = (char *) obstack_alloc (obstackp, size + 1);
/* Open-coded memcpy--saves function call time. These strings are usually
short. FIXME: Is this really still true with a compiler that can
inline memcpy? */
{
- register char *p1 = ptr;
+ register const char *p1 = ptr;
register char *p2 = p;
- char *end = ptr + size;
+ const char *end = ptr + size;
while (p1 != end)
*p2++ = *p1++;
}
@@ -1952,6 +1952,7 @@ init_filename_language_table (void)
/* OBSOLETE add_filename_language (".ch", language_chill); */
/* OBSOLETE add_filename_language (".c186", language_chill); */
/* OBSOLETE add_filename_language (".c286", language_chill); */
+ add_filename_language (".m", language_objc);
add_filename_language (".f", language_fortran);
add_filename_language (".F", language_fortran);
add_filename_language (".s", language_asm);
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 39eb3080f13..62dfcefb54b 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -25,6 +25,10 @@
/* This file requires that you first include "bfd.h". */
+/* Opaque declarations. */
+
+struct obstack;
+
/* Partial symbols are stored in the psymbol_cache and pointers to them
are kept in a dynamically grown array that is obtained from malloc and
grown as necessary via realloc. Each objfile typically has two of these,
@@ -208,7 +212,7 @@ extern void sort_symtab_syms (struct symtab *);
(and add a null character at the end in the copy).
Returns the address of the copy. */
-extern char *obsavestring (char *, int, struct obstack *);
+extern char *obsavestring (const char *, int, struct obstack *);
/* Concatenate strings S1, S2 and S3; return the new string.
Space is found in the symbol_obstack. */
diff --git a/gdb/symm-nat.c b/gdb/symm-nat.c
index d6867774310..fb52754d4e7 100644
--- a/gdb/symm-nat.c
+++ b/gdb/symm-nat.c
@@ -68,29 +68,29 @@ store_inferior_registers (int regno)
to the registers array to solve this properly. */
mptrace (XPT_RREGS, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) & regs, 0);
- regs.pr_eax = *(int *) &registers[REGISTER_BYTE (0)];
- regs.pr_ebx = *(int *) &registers[REGISTER_BYTE (5)];
- regs.pr_ecx = *(int *) &registers[REGISTER_BYTE (2)];
- regs.pr_edx = *(int *) &registers[REGISTER_BYTE (1)];
- regs.pr_esi = *(int *) &registers[REGISTER_BYTE (6)];
- regs.pr_edi = *(int *) &registers[REGISTER_BYTE (7)];
- regs.pr_esp = *(int *) &registers[REGISTER_BYTE (14)];
- regs.pr_ebp = *(int *) &registers[REGISTER_BYTE (15)];
- regs.pr_eip = *(int *) &registers[REGISTER_BYTE (16)];
- regs.pr_flags = *(int *) &registers[REGISTER_BYTE (17)];
+ regs.pr_eax = *(int *) &deprecated_registers[REGISTER_BYTE (0)];
+ regs.pr_ebx = *(int *) &deprecated_registers[REGISTER_BYTE (5)];
+ regs.pr_ecx = *(int *) &deprecated_registers[REGISTER_BYTE (2)];
+ regs.pr_edx = *(int *) &deprecated_registers[REGISTER_BYTE (1)];
+ regs.pr_esi = *(int *) &deprecated_registers[REGISTER_BYTE (6)];
+ regs.pr_edi = *(int *) &deprecated_registers[REGISTER_BYTE (7)];
+ regs.pr_esp = *(int *) &deprecated_registers[REGISTER_BYTE (14)];
+ regs.pr_ebp = *(int *) &deprecated_registers[REGISTER_BYTE (15)];
+ regs.pr_eip = *(int *) &deprecated_registers[REGISTER_BYTE (16)];
+ regs.pr_flags = *(int *) &deprecated_registers[REGISTER_BYTE (17)];
for (i = 0; i < 31; i++)
{
regs.pr_fpa.fpa_regs[i] =
- *(int *) &registers[REGISTER_BYTE (FP1_REGNUM + i)];
+ *(int *) &deprecated_registers[REGISTER_BYTE (FP1_REGNUM + i)];
}
- memcpy (regs.pr_fpu.fpu_stack[0], &registers[REGISTER_BYTE (ST0_REGNUM)], 10);
- memcpy (regs.pr_fpu.fpu_stack[1], &registers[REGISTER_BYTE (ST1_REGNUM)], 10);
- memcpy (regs.pr_fpu.fpu_stack[2], &registers[REGISTER_BYTE (ST2_REGNUM)], 10);
- memcpy (regs.pr_fpu.fpu_stack[3], &registers[REGISTER_BYTE (ST3_REGNUM)], 10);
- memcpy (regs.pr_fpu.fpu_stack[4], &registers[REGISTER_BYTE (ST4_REGNUM)], 10);
- memcpy (regs.pr_fpu.fpu_stack[5], &registers[REGISTER_BYTE (ST5_REGNUM)], 10);
- memcpy (regs.pr_fpu.fpu_stack[6], &registers[REGISTER_BYTE (ST6_REGNUM)], 10);
- memcpy (regs.pr_fpu.fpu_stack[7], &registers[REGISTER_BYTE (ST7_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[0], &deprecated_registers[REGISTER_BYTE (ST0_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[1], &deprecated_registers[REGISTER_BYTE (ST1_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[2], &deprecated_registers[REGISTER_BYTE (ST2_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[3], &deprecated_registers[REGISTER_BYTE (ST3_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[4], &deprecated_registers[REGISTER_BYTE (ST4_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[5], &deprecated_registers[REGISTER_BYTE (ST5_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[6], &deprecated_registers[REGISTER_BYTE (ST6_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[7], &deprecated_registers[REGISTER_BYTE (ST7_REGNUM)], 10);
mptrace (XPT_WREGS, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) & regs, 0);
}
@@ -100,32 +100,32 @@ fetch_inferior_registers (int regno)
int i;
struct pt_regset regs;
- registers_fetched ();
+ deprecated_registers_fetched ();
mptrace (XPT_RREGS, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) & regs, 0);
- *(int *) &registers[REGISTER_BYTE (EAX_REGNUM)] = regs.pr_eax;
- *(int *) &registers[REGISTER_BYTE (EBX_REGNUM)] = regs.pr_ebx;
- *(int *) &registers[REGISTER_BYTE (ECX_REGNUM)] = regs.pr_ecx;
- *(int *) &registers[REGISTER_BYTE (EDX_REGNUM)] = regs.pr_edx;
- *(int *) &registers[REGISTER_BYTE (ESI_REGNUM)] = regs.pr_esi;
- *(int *) &registers[REGISTER_BYTE (EDI_REGNUM)] = regs.pr_edi;
- *(int *) &registers[REGISTER_BYTE (EBP_REGNUM)] = regs.pr_ebp;
- *(int *) &registers[REGISTER_BYTE (ESP_REGNUM)] = regs.pr_esp;
- *(int *) &registers[REGISTER_BYTE (EIP_REGNUM)] = regs.pr_eip;
- *(int *) &registers[REGISTER_BYTE (EFLAGS_REGNUM)] = regs.pr_flags;
+ *(int *) &deprecated_registers[REGISTER_BYTE (EAX_REGNUM)] = regs.pr_eax;
+ *(int *) &rdeprecated_egisters[REGISTER_BYTE (EBX_REGNUM)] = regs.pr_ebx;
+ *(int *) &deprecated_registers[REGISTER_BYTE (ECX_REGNUM)] = regs.pr_ecx;
+ *(int *) &deprecated_registers[REGISTER_BYTE (EDX_REGNUM)] = regs.pr_edx;
+ *(int *) &deprecated_registers[REGISTER_BYTE (ESI_REGNUM)] = regs.pr_esi;
+ *(int *) &deprecated_registers[REGISTER_BYTE (EDI_REGNUM)] = regs.pr_edi;
+ *(int *) &deprecated_registers[REGISTER_BYTE (EBP_REGNUM)] = regs.pr_ebp;
+ *(int *) &deprecated_registers[REGISTER_BYTE (ESP_REGNUM)] = regs.pr_esp;
+ *(int *) &deprecated_registers[REGISTER_BYTE (EIP_REGNUM)] = regs.pr_eip;
+ *(int *) &deprecated_registers[REGISTER_BYTE (EFLAGS_REGNUM)] = regs.pr_flags;
for (i = 0; i < FPA_NREGS; i++)
{
- *(int *) &registers[REGISTER_BYTE (FP1_REGNUM + i)] =
+ *(int *) &deprecated_registers[REGISTER_BYTE (FP1_REGNUM + i)] =
regs.pr_fpa.fpa_regs[i];
}
- memcpy (&registers[REGISTER_BYTE (ST0_REGNUM)], regs.pr_fpu.fpu_stack[0], 10);
- memcpy (&registers[REGISTER_BYTE (ST1_REGNUM)], regs.pr_fpu.fpu_stack[1], 10);
- memcpy (&registers[REGISTER_BYTE (ST2_REGNUM)], regs.pr_fpu.fpu_stack[2], 10);
- memcpy (&registers[REGISTER_BYTE (ST3_REGNUM)], regs.pr_fpu.fpu_stack[3], 10);
- memcpy (&registers[REGISTER_BYTE (ST4_REGNUM)], regs.pr_fpu.fpu_stack[4], 10);
- memcpy (&registers[REGISTER_BYTE (ST5_REGNUM)], regs.pr_fpu.fpu_stack[5], 10);
- memcpy (&registers[REGISTER_BYTE (ST6_REGNUM)], regs.pr_fpu.fpu_stack[6], 10);
- memcpy (&registers[REGISTER_BYTE (ST7_REGNUM)], regs.pr_fpu.fpu_stack[7], 10);
+ memcpy (&deprecated_registers[REGISTER_BYTE (ST0_REGNUM)], regs.pr_fpu.fpu_stack[0], 10);
+ memcpy (&deprecated_registers[REGISTER_BYTE (ST1_REGNUM)], regs.pr_fpu.fpu_stack[1], 10);
+ memcpy (&deprecated_registers[REGISTER_BYTE (ST2_REGNUM)], regs.pr_fpu.fpu_stack[2], 10);
+ memcpy (&deprecated_registers[REGISTER_BYTE (ST3_REGNUM)], regs.pr_fpu.fpu_stack[3], 10);
+ memcpy (&deprecated_registers[REGISTER_BYTE (ST4_REGNUM)], regs.pr_fpu.fpu_stack[4], 10);
+ memcpy (&deprecated_registers[REGISTER_BYTE (ST5_REGNUM)], regs.pr_fpu.fpu_stack[5], 10);
+ memcpy (&deprecated_registers[REGISTER_BYTE (ST6_REGNUM)], regs.pr_fpu.fpu_stack[6], 10);
+ memcpy (&deprecated_registers[REGISTER_BYTE (ST7_REGNUM)], regs.pr_fpu.fpu_stack[7], 10);
}
/* FIXME: This should be merged with i387-tdep.c as well. */
diff --git a/gdb/symtab.c b/gdb/symtab.c
index a4322926e2f..ef70e3ff0d1 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -50,11 +50,6 @@
#include <ctype.h>
#include "cp-abi.h"
-/* Prototype for one function in parser-defs.h,
- instead of including that entire file. */
-
-extern char *find_template_name_end (char *);
-
/* Prototypes for local functions */
static void completion_list_add_name (char *, char *, int, char *, char *);
@@ -88,6 +83,25 @@ static struct symbol *lookup_symbol_aux (const char *name,
int *is_a_field_of_this,
struct symtab **symtab);
+static struct symbol *lookup_symbol_aux_local (const char *name,
+ const char *mangled_name,
+ const struct block *block,
+ const namespace_enum namespace,
+ struct symtab **symtab);
+
+static
+struct symbol *lookup_symbol_aux_symtabs (int block_index,
+ const char *name,
+ const char *mangled_name,
+ const namespace_enum namespace,
+ struct symtab **symtab);
+
+static
+struct symbol *lookup_symbol_aux_psymtabs (int block_index,
+ const char *name,
+ const char *mangled_name,
+ const namespace_enum namespace,
+ struct symtab **symtab);
static struct symbol *find_active_alias (struct symbol *sym, CORE_ADDR addr);
@@ -121,19 +135,6 @@ struct type *builtin_type_error;
const struct block *block_found;
-/* While the C++ support is still in flux, issue a possibly helpful hint on
- using the new command completion feature on single quoted demangled C++
- symbols. Remove when loose ends are cleaned up. FIXME -fnf */
-
-static void
-cplusplus_hint (char *name)
-{
- while (*name == '\'')
- name++;
- printf_filtered ("Hint: try '%s<TAB> or '%s<ESC-?>\n", name, name);
- printf_filtered ("(Note leading single quote.)\n");
-}
-
/* Check for a symtab of a specific name; first in symtabs, then in
psymtabs. *If* there is no '/' in the name, a match after a '/'
in the symtab filename will also work. */
@@ -385,6 +386,33 @@ gdb_mangle_name (struct type *type, int method_id, int signature_id)
}
+/* Initialize the language dependent portion of a symbol
+ depending upon the language for the symbol. */
+void
+symbol_init_language_specific (struct general_symbol_info *gsymbol,
+ enum language language)
+{
+ gsymbol->language = language;
+ if (gsymbol->language == language_cplus
+ || gsymbol->language == language_java)
+ {
+ gsymbol->language_specific.cplus_specific.demangled_name = NULL;
+ }
+ else if (gsymbol->language == language_objc)
+ {
+ gsymbol->language_specific.objc_specific.demangled_name = NULL;
+ }
+ /* OBSOLETE else if (SYMBOL_LANGUAGE (symbol) == language_chill) */
+ /* OBSOLETE { */
+ /* OBSOLETE SYMBOL_CHILL_DEMANGLED_NAME (symbol) = NULL; */
+ /* OBSOLETE } */
+ else
+ {
+ memset (&gsymbol->language_specific, 0,
+ sizeof (gsymbol->language_specific));
+ }
+}
+
/* Initialize a symbol's mangled name. */
/* Try to initialize the demangled name for a symbol, based on the
@@ -461,7 +489,35 @@ symbol_init_demangled_name (struct general_symbol_info *gsymbol,
#endif
}
+/* Return the demangled name for a symbol based on the language for
+ that symbol. If no demangled name exists, return NULL. */
+char *
+symbol_demangled_name (struct general_symbol_info *gsymbol)
+{
+ if (gsymbol->language == language_cplus
+ || gsymbol->language == language_java)
+ return gsymbol->language_specific.cplus_specific.demangled_name;
+
+ else if (gsymbol->language == language_objc)
+ return gsymbol->language_specific.objc_specific.demangled_name;
+
+ else
+ return NULL;
+
+ /* OBSOLETE (SYMBOL_LANGUAGE (symbol) == language_chill */
+ /* OBSOLETE ? SYMBOL_CHILL_DEMANGLED_NAME (symbol) */
+}
+/* Initialize the structure fields to zero values. */
+void
+init_sal (struct symtab_and_line *sal)
+{
+ sal->symtab = 0;
+ sal->section = 0;
+ sal->line = 0;
+ sal->pc = 0;
+ sal->end = 0;
+}
@@ -729,43 +785,22 @@ lookup_symbol_aux (const char *name, const char *mangled_name,
const struct block *block, const namespace_enum namespace,
int *is_a_field_of_this, struct symtab **symtab)
{
- register struct symbol *sym;
- register struct symtab *s = NULL;
- register struct partial_symtab *ps;
- register struct blockvector *bv;
- register struct objfile *objfile = NULL;
- register struct block *b;
- register struct minimal_symbol *msymbol;
-
+ struct symbol *sym;
+ struct symtab *s = NULL;
+ struct blockvector *bv;
+ struct minimal_symbol *msymbol;
/* Search specified block and its superiors. */
- while (block != 0)
- {
- sym = lookup_block_symbol (block, name, mangled_name, namespace);
- if (sym)
- {
- block_found = block;
- if (symtab != NULL)
- {
- /* Search the list of symtabs for one which contains the
- address of the start of this block. */
- ALL_SYMTABS (objfile, s)
- {
- bv = BLOCKVECTOR (s);
- b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- if (BLOCK_START (b) <= BLOCK_START (block)
- && BLOCK_END (b) > BLOCK_START (block))
- goto found;
- }
- found:
- *symtab = s;
- }
+ sym = lookup_symbol_aux_local (name, mangled_name, block, namespace,
+ symtab);
+ if (sym != NULL)
+ return sym;
- return fixup_symbol_section (sym, objfile);
- }
- block = BLOCK_SUPERBLOCK (block);
- }
+#if 0
+ /* NOTE: carlton/2002-11-05: At the time that this code was
+ #ifdeffed out, the value of 'block' was always NULL at this
+ point, hence the bemused comments below. */
/* FIXME: this code is never executed--block is always NULL at this
point. What is it trying to do, anyway? We already should have
@@ -806,7 +841,7 @@ lookup_symbol_aux (const char *name, const char *mangled_name,
}
}
}
-
+#endif /* 0 */
/* C++: If requested to do so by the caller,
check to see if NAME is a field of `this'. */
@@ -829,19 +864,10 @@ lookup_symbol_aux (const char *name, const char *mangled_name,
of the desired name as a global, then do psymtab-to-symtab
conversion on the fly and return the found symbol. */
- ALL_SYMTABS (objfile, s)
- {
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, mangled_name, namespace);
- if (sym)
- {
- block_found = block;
- if (symtab != NULL)
- *symtab = s;
- return fixup_symbol_section (sym, objfile);
- }
- }
+ sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, mangled_name,
+ namespace, symtab);
+ if (sym != NULL)
+ return sym;
#ifndef HPUXHPPA
@@ -892,7 +918,7 @@ lookup_symbol_aux (const char *name, const char *mangled_name,
if (symtab != NULL)
*symtab = s;
- return fixup_symbol_section (sym, objfile);
+ return fixup_symbol_section (sym, s->objfile);
}
else if (MSYMBOL_TYPE (msymbol) != mst_text
&& MSYMBOL_TYPE (msymbol) != mst_file_text
@@ -900,7 +926,7 @@ lookup_symbol_aux (const char *name, const char *mangled_name,
{
/* This is a mangled variable, look it up by its
mangled name. */
- return lookup_symbol_aux (SYMBOL_NAME (msymbol), mangled_name, block,
+ return lookup_symbol_aux (SYMBOL_NAME (msymbol), mangled_name, NULL,
namespace, is_a_field_of_this, symtab);
}
/* There are no debug symbols for this file, or we are looking
@@ -911,84 +937,26 @@ lookup_symbol_aux (const char *name, const char *mangled_name,
#endif
- ALL_PSYMTABS (objfile, ps)
- {
- if (!ps->readin && lookup_partial_symbol (ps, name, 1, namespace))
- {
- s = PSYMTAB_TO_SYMTAB (ps);
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, mangled_name, namespace);
- if (!sym)
- {
- /* This shouldn't be necessary, but as a last resort
- * try looking in the statics even though the psymtab
- * claimed the symbol was global. It's possible that
- * the psymtab gets it wrong in some cases.
- */
- block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, mangled_name, namespace);
- if (!sym)
- error ("Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\
-%s may be an inlined function, or may be a template function\n\
-(if a template, try specifying an instantiation: %s<type>).",
- name, ps->filename, name, name);
- }
- if (symtab != NULL)
- *symtab = s;
- return fixup_symbol_section (sym, objfile);
- }
- }
+ sym = lookup_symbol_aux_psymtabs (GLOBAL_BLOCK, name, mangled_name,
+ namespace, symtab);
+ if (sym != NULL)
+ return sym;
- /* Now search all static file-level symbols.
- Not strictly correct, but more useful than an error.
- Do the symtabs first, then check the psymtabs.
- If a psymtab indicates the existence
- of the desired name as a file-level static, then do psymtab-to-symtab
+ /* Now search all static file-level symbols. Not strictly correct,
+ but more useful than an error. Do the symtabs first, then check
+ the psymtabs. If a psymtab indicates the existence of the
+ desired name as a file-level static, then do psymtab-to-symtab
conversion on the fly and return the found symbol. */
- ALL_SYMTABS (objfile, s)
- {
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, mangled_name, namespace);
- if (sym)
- {
- block_found = block;
- if (symtab != NULL)
- *symtab = s;
- return fixup_symbol_section (sym, objfile);
- }
- }
-
- ALL_PSYMTABS (objfile, ps)
- {
- if (!ps->readin && lookup_partial_symbol (ps, name, 0, namespace))
- {
- s = PSYMTAB_TO_SYMTAB (ps);
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, mangled_name, namespace);
- if (!sym)
- {
- /* This shouldn't be necessary, but as a last resort
- * try looking in the globals even though the psymtab
- * claimed the symbol was static. It's possible that
- * the psymtab gets it wrong in some cases.
- */
- block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, mangled_name, namespace);
- if (!sym)
- error ("Internal: static symbol `%s' found in %s psymtab but not in symtab.\n\
-%s may be an inlined function, or may be a template function\n\
-(if a template, try specifying an instantiation: %s<type>).",
- name, ps->filename, name, name);
- }
- if (symtab != NULL)
- *symtab = s;
- return fixup_symbol_section (sym, objfile);
- }
- }
+ sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, mangled_name,
+ namespace, symtab);
+ if (sym != NULL)
+ return sym;
+
+ sym = lookup_symbol_aux_psymtabs (STATIC_BLOCK, name, mangled_name,
+ namespace, symtab);
+ if (sym != NULL)
+ return sym;
#ifdef HPUXHPPA
@@ -1083,7 +1051,7 @@ lookup_symbol_aux (const char *name, const char *mangled_name,
&& !STREQ (name, SYMBOL_NAME (msymbol)))
{
return lookup_symbol_aux (SYMBOL_NAME (msymbol), mangled_name,
- block, namespace, is_a_field_of_this,
+ NULL, namespace, is_a_field_of_this,
symtab);
}
}
@@ -1093,9 +1061,147 @@ lookup_symbol_aux (const char *name, const char *mangled_name,
if (symtab != NULL)
*symtab = NULL;
- return 0;
+ return NULL;
+}
+
+/* Check to see if the symbol is defined in BLOCK or its
+ superiors. */
+
+static struct symbol *
+lookup_symbol_aux_local (const char *name, const char *mangled_name,
+ const struct block *block,
+ const namespace_enum namespace,
+ struct symtab **symtab)
+{
+ struct symbol *sym;
+ struct objfile *objfile = NULL;
+ struct blockvector *bv;
+ struct block *b;
+ struct symtab *s = NULL;
+
+ while (block != 0)
+ {
+ sym = lookup_block_symbol (block, name, mangled_name, namespace);
+ if (sym)
+ {
+ block_found = block;
+ if (symtab != NULL)
+ {
+ /* Search the list of symtabs for one which contains the
+ address of the start of this block. */
+ ALL_SYMTABS (objfile, s)
+ {
+ bv = BLOCKVECTOR (s);
+ b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+ if (BLOCK_START (b) <= BLOCK_START (block)
+ && BLOCK_END (b) > BLOCK_START (block))
+ goto found;
+ }
+ found:
+ *symtab = s;
+ }
+
+ return fixup_symbol_section (sym, objfile);
+ }
+ block = BLOCK_SUPERBLOCK (block);
+ }
+
+ return NULL;
+}
+
+/* Check to see if the symbol is defined in one of the symtabs.
+ BLOCK_INDEX should be either GLOBAL_BLOCK or STATIC_BLOCK,
+ depending on whether or not we want to search global symbols or
+ static symbols. */
+
+static struct symbol *
+lookup_symbol_aux_symtabs (int block_index,
+ const char *name, const char *mangled_name,
+ const namespace_enum namespace,
+ struct symtab **symtab)
+{
+ struct symbol *sym;
+ struct objfile *objfile;
+ struct blockvector *bv;
+ const struct block *block;
+ struct symtab *s;
+
+ ALL_SYMTABS (objfile, s)
+ {
+ bv = BLOCKVECTOR (s);
+ block = BLOCKVECTOR_BLOCK (bv, block_index);
+ sym = lookup_block_symbol (block, name, mangled_name, namespace);
+ if (sym)
+ {
+ block_found = block;
+ if (symtab != NULL)
+ *symtab = s;
+ return fixup_symbol_section (sym, objfile);
+ }
+ }
+
+ return NULL;
+}
+
+/* Check to see if the symbol is defined in one of the partial
+ symtabs. BLOCK_INDEX should be either GLOBAL_BLOCK or
+ STATIC_BLOCK, depending on whether or not we want to search global
+ symbols or static symbols. */
+
+static struct symbol *
+lookup_symbol_aux_psymtabs (int block_index, const char *name,
+ const char *mangled_name,
+ const namespace_enum namespace,
+ struct symtab **symtab)
+{
+ struct symbol *sym;
+ struct objfile *objfile;
+ struct blockvector *bv;
+ const struct block *block;
+ struct partial_symtab *ps;
+ struct symtab *s;
+ const int psymtab_index = (block_index == GLOBAL_BLOCK ? 1 : 0);
+
+ ALL_PSYMTABS (objfile, ps)
+ {
+ if (!ps->readin
+ && lookup_partial_symbol (ps, name, psymtab_index, namespace))
+ {
+ s = PSYMTAB_TO_SYMTAB (ps);
+ bv = BLOCKVECTOR (s);
+ block = BLOCKVECTOR_BLOCK (bv, block_index);
+ sym = lookup_block_symbol (block, name, mangled_name, namespace);
+ if (!sym)
+ {
+ /* This shouldn't be necessary, but as a last resort try
+ looking in the statics even though the psymtab claimed
+ the symbol was global, or vice-versa. It's possible
+ that the psymtab gets it wrong in some cases. */
+
+ /* FIXME: carlton/2002-09-30: Should we really do that?
+ If that happens, isn't it likely to be a GDB error, in
+ which case we should fix the GDB error rather than
+ silently dealing with it here? So I'd vote for
+ removing the check for the symbol in the other
+ block. */
+ block = BLOCKVECTOR_BLOCK (bv,
+ block_index == GLOBAL_BLOCK ?
+ STATIC_BLOCK : GLOBAL_BLOCK);
+ sym = lookup_block_symbol (block, name, mangled_name, namespace);
+ if (!sym)
+ error ("Internal: %s symbol `%s' found in %s psymtab but not in symtab.\n%s may be an inlined function, or may be a template function\n(if a template, try specifying an instantiation: %s<type>).",
+ block_index == GLOBAL_BLOCK ? "global" : "static",
+ name, ps->filename, name, name);
+ }
+ if (symtab != NULL)
+ *symtab = s;
+ return fixup_symbol_section (sym, objfile);
+ }
+ }
+
+ return NULL;
}
-
+
/* Look, in partial_symtab PST, for symbol NAME. Check the global
symbols if GLOBAL, the static symbols if not */
@@ -1655,94 +1761,6 @@ find_pc_symtab (CORE_ADDR pc)
}
-#if 0
-
-/* Find the closest symbol value (of any sort -- function or variable)
- for a given address value. Slow but complete. (currently unused,
- mainly because it is too slow. We could fix it if each symtab and
- psymtab had contained in it the addresses ranges of each of its
- sections, which also would be required to make things like "info
- line *0x2345" cause psymtabs to be converted to symtabs). */
-
-struct symbol *
-find_addr_symbol (CORE_ADDR addr, struct symtab **symtabp, CORE_ADDR *symaddrp)
-{
- struct symtab *symtab, *best_symtab;
- struct objfile *objfile;
- register int bot, top;
- register struct symbol *sym;
- register CORE_ADDR sym_addr;
- struct block *block;
- int blocknum;
-
- /* Info on best symbol seen so far */
-
- register CORE_ADDR best_sym_addr = 0;
- struct symbol *best_sym = 0;
-
- /* FIXME -- we should pull in all the psymtabs, too! */
- ALL_SYMTABS (objfile, symtab)
- {
- /* Search the global and static blocks in this symtab for
- the closest symbol-address to the desired address. */
-
- for (blocknum = GLOBAL_BLOCK; blocknum <= STATIC_BLOCK; blocknum++)
- {
- QUIT;
- block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), blocknum);
- ALL_BLOCK_SYMBOLS (block, bot, sym)
- {
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_STATIC:
- case LOC_LABEL:
- sym_addr = SYMBOL_VALUE_ADDRESS (sym);
- break;
-
- case LOC_INDIRECT:
- sym_addr = SYMBOL_VALUE_ADDRESS (sym);
- /* An indirect symbol really lives at *sym_addr,
- * so an indirection needs to be done.
- * However, I am leaving this commented out because it's
- * expensive, and it's possible that symbolization
- * could be done without an active process (in
- * case this read_memory will fail). RT
- sym_addr = read_memory_unsigned_integer
- (sym_addr, TARGET_PTR_BIT / TARGET_CHAR_BIT);
- */
- break;
-
- case LOC_BLOCK:
- sym_addr = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
- break;
-
- default:
- continue;
- }
-
- if (sym_addr <= addr)
- if (sym_addr > best_sym_addr)
- {
- /* Quit if we found an exact match. */
- best_sym = sym;
- best_sym_addr = sym_addr;
- best_symtab = symtab;
- if (sym_addr == addr)
- goto done;
- }
- }
- }
- }
-
-done:
- if (symtabp)
- *symtabp = best_symtab;
- if (symaddrp)
- *symaddrp = best_sym_addr;
- return best_sym;
-}
-#endif /* 0 */
-
/* Find the source file and line number for a given PC value and SECTION.
Return a structure containing a symtab pointer, a line number,
and a pc range for the entire source line.
@@ -1797,7 +1815,7 @@ find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent)
But what we want is the statement containing the instruction.
Fudge the pc to make sure we get that. */
- INIT_SAL (&val); /* initialize to zeroes */
+ init_sal (&val); /* initialize to zeroes */
/* It's tempting to assume that, if we can't find debugging info for
any function enclosing PC, that we shouldn't search for line
@@ -2952,30 +2970,6 @@ print_symbol_info (namespace_enum kind, struct symtab *s, struct symbol *sym,
printf_filtered (";\n");
}
- else
- {
-#if 0
- /* Tiemann says: "info methods was never implemented." */
- char *demangled_name;
- c_type_print_base (TYPE_FN_FIELD_TYPE (t, block),
- gdb_stdout, 0, 0);
- c_type_print_varspec_prefix (TYPE_FN_FIELD_TYPE (t, block),
- gdb_stdout, 0);
- if (TYPE_FN_FIELD_STUB (t, block))
- check_stub_method (TYPE_DOMAIN_TYPE (type), j, block);
- demangled_name =
- cplus_demangle (TYPE_FN_FIELD_PHYSNAME (t, block),
- DMGL_ANSI | DMGL_PARAMS);
- if (demangled_name == NULL)
- fprintf_filtered (stream, "<badly mangled name %s>",
- TYPE_FN_FIELD_PHYSNAME (t, block));
- else
- {
- fputs_filtered (demangled_name, stream);
- xfree (demangled_name);
- }
-#endif
- }
}
/* This help function for symtab_symbol_info() prints information
@@ -3069,15 +3063,6 @@ types_info (char *regexp, int from_tty)
symtab_symbol_info (regexp, TYPES_NAMESPACE, from_tty);
}
-#if 0
-/* Tiemann says: "info methods was never implemented." */
-static void
-methods_info (char *regexp)
-{
- symtab_symbol_info (regexp, METHODS_NAMESPACE, 0, from_tty);
-}
-#endif /* 0 */
-
/* Breakpoint all functions matching regular expression. */
void
@@ -4037,13 +4022,6 @@ _initialize_symtab (void)
add_info ("types", types_info,
"All type names, or those matching REGEXP.");
-#if 0
- add_info ("methods", methods_info,
- "All method names, or those matching REGEXP::REGEXP.\n\
-If the class qualifier is omitted, it is assumed to be the current scope.\n\
-If the first REGEXP is omitted, then all methods matching the second REGEXP\n\
-are listed.");
-#endif
add_info ("sources", sources_info,
"Source files in the program.");
diff --git a/gdb/symtab.h b/gdb/symtab.h
index a78607d584e..46d3b972096 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -89,6 +89,11 @@ struct general_symbol_info
char *demangled_name;
}
cplus_specific;
+ struct objc_specific
+ {
+ char *demangled_name;
+ }
+ objc_specific;
#if 0
/* OBSOLETE struct chill_specific *//* For Chill */
/* OBSOLETE { */
@@ -121,6 +126,14 @@ struct general_symbol_info
extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *);
+/* Note that all the following SYMBOL_* macros are used with the
+ SYMBOL argument being either a partial symbol, a minimal symbol or
+ a full symbol. All three types have a ginfo field. In particular
+ the SYMBOL_INIT_LANGUAGE_SPECIFIC, SYMBOL_INIT_DEMANGLED_NAME,
+ SYMBOL_DEMANGLED_NAME macros cannot be entirely substituted by
+ functions, unless the callers are changed to pass in the ginfo
+ field only, instead of the SYMBOL parameter. */
+
#define SYMBOL_NAME(symbol) (symbol)->ginfo.name
#define SYMBOL_VALUE(symbol) (symbol)->ginfo.value.ivalue
#define SYMBOL_VALUE_ADDRESS(symbol) (symbol)->ginfo.value.address
@@ -134,49 +147,30 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *);
#define SYMBOL_CPLUS_DEMANGLED_NAME(symbol) \
(symbol)->ginfo.language_specific.cplus_specific.demangled_name
-/* Macro that initializes the language dependent portion of a symbol
+/* Initializes the language dependent portion of a symbol
depending upon the language for the symbol. */
-
-#define SYMBOL_INIT_LANGUAGE_SPECIFIC(symbol,language) \
- do { \
- SYMBOL_LANGUAGE (symbol) = language; \
- if (SYMBOL_LANGUAGE (symbol) == language_cplus \
- || SYMBOL_LANGUAGE (symbol) == language_java \
- ) \
- { \
- SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = NULL; \
- } \
- /* OBSOLETE else if (SYMBOL_LANGUAGE (symbol) == language_chill) */ \
- /* OBSOLETE { */ \
- /* OBSOLETE SYMBOL_CHILL_DEMANGLED_NAME (symbol) = NULL; */ \
- /* OBSOLETE } */ \
- else \
- { \
- memset (&(symbol)->ginfo.language_specific, 0, \
- sizeof ((symbol)->ginfo.language_specific)); \
- } \
- } while (0)
+#define SYMBOL_INIT_LANGUAGE_SPECIFIC(symbol,language) \
+ (symbol_init_language_specific (&(symbol)->ginfo, (language)))
+extern void symbol_init_language_specific (struct general_symbol_info *symbol,
+ enum language language);
#define SYMBOL_INIT_DEMANGLED_NAME(symbol,obstack) \
(symbol_init_demangled_name (&symbol->ginfo, (obstack)))
extern void symbol_init_demangled_name (struct general_symbol_info *symbol,
struct obstack *obstack);
-
-/* Macro that returns the demangled name for a symbol based on the language
- for that symbol. If no demangled name exists, returns NULL. */
-
-#define SYMBOL_DEMANGLED_NAME(symbol) \
- (SYMBOL_LANGUAGE (symbol) == language_cplus \
- || SYMBOL_LANGUAGE (symbol) == language_java \
- ? SYMBOL_CPLUS_DEMANGLED_NAME (symbol) \
- : /* OBSOLETE (SYMBOL_LANGUAGE (symbol) == language_chill */ \
- /* OBSOLETE ? SYMBOL_CHILL_DEMANGLED_NAME (symbol) */ \
- NULL)
+/* Return the demangled name for a symbol based on the language for
+ that symbol. If no demangled name exists, return NULL. */
+#define SYMBOL_DEMANGLED_NAME(symbol) \
+ (symbol_demangled_name (&(symbol)->ginfo))
+extern char *symbol_demangled_name (struct general_symbol_info *symbol);
/* OBSOLETE #define SYMBOL_CHILL_DEMANGLED_NAME(symbol) */
/* OBSOLETE (symbol)->ginfo.language_specific.chill_specific.demangled_name */
+#define SYMBOL_OBJC_DEMANGLED_NAME(symbol) \
+ (symbol)->ginfo.language_specific.objc_specific.demangled_name
+
/* Macro that returns the "natural source name" of a symbol. In C++ this is
the "demangled" form of the name if demangle is on and the "mangled" form
of the name if demangle is off. In other languages this is just the
@@ -611,8 +605,16 @@ enum address_class
LOC_UNRESOLVED,
/* Value is at a thread-specific location calculated by a
- target-specific method. */
+ target-specific method. This is used only by hppa. */
+
+ LOC_HP_THREAD_LOCAL_STATIC,
+ /* Value is at a thread-specific location calculated by a
+ target-specific method. SYMBOL_OBJFILE gives the object file
+ in which the symbol is defined; the symbol's value is the
+ offset into that objfile's thread-local storage for the current
+ thread. */
+
LOC_THREAD_LOCAL_STATIC,
/* The variable does not actually exist in the program.
@@ -684,6 +686,12 @@ struct symbol
{
/* Used by LOC_BASEREG and LOC_BASEREG_ARG. */
short basereg;
+
+ /* Used by LOC_THREAD_LOCAL_STATIC. The objfile in which this
+ symbol is defined. To find a thread-local variable (e.g., a
+ variable declared with the `__thread' storage class), we may
+ need to know which object file it's in. */
+ struct objfile *objfile;
}
aux_value;
@@ -705,6 +713,7 @@ struct symbol
#define SYMBOL_TYPE(symbol) (symbol)->type
#define SYMBOL_LINE(symbol) (symbol)->line
#define SYMBOL_BASEREG(symbol) (symbol)->aux_value.basereg
+#define SYMBOL_OBJFILE(symbol) (symbol)->aux_value.objfile
#define SYMBOL_ALIASES(symbol) (symbol)->aliases
#define SYMBOL_RANGES(symbol) (symbol)->ranges
@@ -736,15 +745,6 @@ struct partial_symbol
#define PSYMBOL_CLASS(psymbol) (psymbol)->aclass
-/* Source-file information. This describes the relation between source files,
- line numbers and addresses in the program text. */
-
-struct sourcevector
-{
- int length; /* Number of source files described */
- struct source *source[1]; /* Descriptions of the files */
-};
-
/* Each item represents a line-->pc (or the reverse) mapping. This is
somewhat more wasteful of space than one might wish, but since only
the files which are actually debugged are read in to core, we don't
@@ -783,14 +783,6 @@ struct linetable
struct linetable_entry item[1];
};
-/* All the information on one source file. */
-
-struct source
-{
- char *name; /* Name of file */
- struct linetable contents;
-};
-
/* How to relocate the symbols from each section in a symbol file.
Each struct contains an array of offsets.
The ordering and meaning of the offsets is file-type-dependent;
@@ -1215,13 +1207,7 @@ struct symtab_and_line
CORE_ADDR end;
};
-#define INIT_SAL(sal) { \
- (sal)->symtab = 0; \
- (sal)->section = 0; \
- (sal)->line = 0; \
- (sal)->pc = 0; \
- (sal)->end = 0; \
-}
+extern void init_sal (struct symtab_and_line *sal);
struct symtabs_and_lines
{
@@ -1275,13 +1261,6 @@ extern struct symtab_and_line find_pc_line (CORE_ADDR, int);
extern struct symtab_and_line find_pc_sect_line (CORE_ADDR, asection *, int);
-/* Given an address, return the nearest symbol at or below it in memory.
- Optionally return the symtab it's from through 2nd arg, and the
- address in inferior memory of the symbol through 3rd arg. */
-
-extern struct symbol *find_addr_symbol (CORE_ADDR, struct symtab **,
- CORE_ADDR *);
-
/* Given a symtab and line number, return the pc there. */
extern int find_line_pc (struct symtab *, int, CORE_ADDR *);
diff --git a/gdb/target.c b/gdb/target.c
index 75d022ff200..51ace7413e6 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -666,6 +666,7 @@ update_current_target (void)
INHERIT (to_async_mask_value, t);
INHERIT (to_find_memory_regions, t);
INHERIT (to_make_corefile_notes, t);
+ INHERIT (to_get_thread_local_address, t);
INHERIT (to_magic, t);
#undef INHERIT
@@ -1733,7 +1734,7 @@ debug_print_register (const char * func, int regno)
{
int i;
unsigned char *buf = alloca (MAX_REGISTER_RAW_SIZE);
- read_register_gen (regno, buf);
+ deprecated_read_register_gen (regno, buf);
fprintf_unfiltered (gdb_stdlog, " = ");
for (i = 0; i < REGISTER_RAW_SIZE (regno); i++)
{
diff --git a/gdb/target.h b/gdb/target.h
index 18b95b0cea9..5cdb76f387d 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -328,6 +328,16 @@ struct target_ops
void *),
void *);
char * (*to_make_corefile_notes) (bfd *, int *);
+
+ /* Return the thread-local address at OFFSET in the
+ thread-local storage for the thread PTID and the shared library
+ or executable file given by OBJFILE. If that block of
+ thread-local storage hasn't been allocated yet, this function
+ may return an error. */
+ CORE_ADDR (*to_get_thread_local_address) (ptid_t ptid,
+ struct objfile *objfile,
+ CORE_ADDR offset);
+
int to_magic;
/* Need sub-structure for target machine related rather than comm related?
*/
@@ -1039,6 +1049,12 @@ extern void (*target_new_objfile_hook) (struct objfile *);
#define target_make_corefile_notes(BFD, SIZE_P) \
(current_target.to_make_corefile_notes) (BFD, SIZE_P)
+/* Thread-local values. */
+#define target_get_thread_local_address \
+ (current_target.to_get_thread_local_address)
+#define target_get_thread_local_address_p() \
+ (target_get_thread_local_address != NULL)
+
/* Hook to call target-dependent code after reading in a new symbol table. */
#ifndef TARGET_SYMFILE_POSTREAD
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 5ca030910ee..394e7dca1f9 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,38 @@
+2002-11-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * lib/mi-support.exp (mi_gdb_start): Verify the startup message
+ for mi1 and current mi is in correct format. New mi startup message
+ should be in mi console format. This is part of fix for PR gdb/604.
+
+2002-09-18 Fernando Nasser <fnasser@redhat.com>
+
+ * gdb.asm/asm-source.exp: Adjust patter to new disassembler routine
+ which explicitly prints the zero offset as "+0".
+
+2002-10-22 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.threads/schedlock.c (args): Make unsigned.
+
+2002-10-21 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.asm/asm-source.exp: Add "mips*-*" pattern. Update line
+ numbers. Allow "foo2|selected stack frame".
+ * gdb.asm/asmsrc1.s: Use gdbasm_declare and gdbasm_end.
+ * gdb.asm/asmsrc2.s: Likewise.
+ * gdb.asm/common.inc: Define gdbasm_declare and gdbasm_end. Update
+ comments.
+ * gdb.asm/mips.inc: New file.
+
+2002-10-18 Adam Fedor <fedor@gnu.org>
+
+ * gdb.base/default.exp: Update expected output to include 'ObjC'.
+ * gdb.base/help.exp: Likewise.
+
+2002-10-17 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/constvars.c (struct crass, struct crisp): New structs.
+ * gdb.base/constvars.exp (ptype crass, ptype crisp): New tests.
+
2002-10-02 Jim Blandy <jimb@redhat.com>
* gdb.c++/casts.cc, gdb.c++/casts.exp: New test.
diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
index f10f4ae2a62..641a7c1056e 100644
--- a/gdb/testsuite/gdb.asm/asm-source.exp
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -57,6 +57,9 @@ if [istarget "i\[3456\]86-*-*"] then {
if [istarget "m32r*-*"] then {
set asm-arch m32r
}
+if [istarget "mips*-*"] then {
+ set asm-arch mips
+}
if [istarget "powerpc*-*"] then {
set asm-arch powerpc
}
@@ -194,7 +197,7 @@ gdb_test "list $entry_symbol" ".*gdbasm_startup.*" "list"
# Now try a source file search
gdb_test "search A routine for foo2 to call" \
- "39\[ \t\]+comment \"A routine for foo2 to call.\"" "search"
+ "40\[ \t\]+comment \"A routine for foo2 to call.\"" "search"
# See if `f' prints the right source file.
gdb_test "f" ".*asmsrc2\[.\]s:8.*" "f in foo2"
@@ -219,7 +222,7 @@ gdb_test "s" "" "s 2"
gdb_test "n" "" "n 2"
# Now see if a capped `bt' is correct.
-gdb_test "bt 3" "\#0.*foo3.*asmsrc1\[.\]s:44.*\#1.*foo2.*asmsrc2\[.\]s:12.*\#2.*main.*asmsrc1\[.\]s:33.*" "bt 3 in foo3"
+gdb_test "bt 3" "\#0.*foo3.*asmsrc1\[.\]s:45.*\#1.*foo2.*asmsrc2\[.\]s:12.*\#2.*main.*asmsrc1\[.\]s:33.*" "bt 3 in foo3"
# Try 'info source' from asmsrc1.s
gdb_test "info source" \
@@ -277,7 +280,7 @@ gdb_test "next" "17\[ \t\]+gdbasm_leave" "next over foo3"
# Try 'return' from foo2
gdb_test "return" "\#0 main .*37\[ \t\]+gdbasm_exit0" "return from foo2" \
- "Make selected stack frame return now\?.*" "y"
+ "Make (foo2|selected stack frame) return now\?.*" "y"
# See if we can look at a global variable
gdb_test "print globalvar" ".* = 11" "look at global variable"
@@ -286,7 +289,7 @@ gdb_test "print globalvar" ".* = 11" "look at global variable"
gdb_test "print staticvar" ".* = 5" "look at static variable"
# See if we can look at a static function
-gdb_test "disassem foostatic" ".*<foostatic>:.*End of assembler dump." \
+gdb_test "disassem foostatic" ".*<foostatic\\+0>:.*End of assembler dump." \
"look at static function"
remote_exec build "rm -f ${subdir}/arch.inc"
diff --git a/gdb/testsuite/gdb.asm/asmsrc1.s b/gdb/testsuite/gdb.asm/asmsrc1.s
index f14cd915921..cba0e90ec2a 100644
--- a/gdb/testsuite/gdb.asm/asmsrc1.s
+++ b/gdb/testsuite/gdb.asm/asmsrc1.s
@@ -10,18 +10,18 @@ comment "This file is not linked with crt0."
comment "Provide very simplistic equivalent."
.global _start
-_start:
+gdbasm_declare _start
gdbasm_startup
gdbasm_call main
gdbasm_exit0
-
+ gdbasm_end _start
comment "main routine for assembly source debugging test"
comment "This particular testcase uses macros in <arch>.inc to achieve"
comment "machine independence."
.global main
-main:
+gdbasm_declare main
gdbasm_enter
comment "Call a macro that consists of several lines of assembler code."
@@ -35,23 +35,27 @@ comment "Call a subroutine in another file."
comment "All done."
gdbasm_exit0
+ gdbasm_end main
comment "A routine for foo2 to call."
.global foo3
-foo3:
+gdbasm_declare foo3
gdbasm_enter
gdbasm_leave
+ gdbasm_end foo3
.global exit
-exit:
+gdbasm_declare exit
gdbasm_exit0
+ gdbasm_end exit
comment "A static function"
-foostatic:
+gdbasm_declare foostatic
gdbasm_enter
gdbasm_leave
+ gdbasm_end foostatic
comment "A global variable"
diff --git a/gdb/testsuite/gdb.asm/asmsrc2.s b/gdb/testsuite/gdb.asm/asmsrc2.s
index 9d7713fad84..4366536acbe 100644
--- a/gdb/testsuite/gdb.asm/asmsrc2.s
+++ b/gdb/testsuite/gdb.asm/asmsrc2.s
@@ -4,7 +4,7 @@
comment "Second file in assembly source debugging testcase."
.global foo2
-foo2:
+gdbasm_declare foo2
gdbasm_enter
comment "Call someplace else (several times)."
@@ -15,3 +15,4 @@ comment "Call someplace else (several times)."
comment "All done, return."
gdbasm_leave
+ gdbasm_end foo2
diff --git a/gdb/testsuite/gdb.asm/common.inc b/gdb/testsuite/gdb.asm/common.inc
index 51493929765..04f08ff9cce 100644
--- a/gdb/testsuite/gdb.asm/common.inc
+++ b/gdb/testsuite/gdb.asm/common.inc
@@ -14,6 +14,15 @@
.word \value
.endm
+ comment "Declare a subroutine"
+ .macro gdbasm_declare name
+\name:
+ .endm
+
+ comment "End a subroutine"
+ .macro gdbasm_end name
+ .endm
+
comment "arch.inc is responsible for defining the following macros:"
comment "enter - subroutine prologue"
comment "leave - subroutine epilogue"
@@ -23,6 +32,5 @@ comment "exit0 - exit (0)"
comment "arch.inc may also override the default definitions of:"
comment "datavar - define a data variable"
-
-comment "macros to label a subroutine may also eventually be needed"
-comment "i.e. .global foo\nfoo:\n"
+comment "declare - declare the start of a subroutine"
+comment "end - end a subroutine"
diff --git a/gdb/testsuite/gdb.asm/mips.inc b/gdb/testsuite/gdb.asm/mips.inc
new file mode 100644
index 00000000000..751f73f859b
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/mips.inc
@@ -0,0 +1,64 @@
+ comment "subroutine declare"
+ .macro gdbasm_declare name
+ .align 2
+ .ent \name
+ .type \name,@function
+\name:
+ .endm
+
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ .frame $fp, 32, $31
+ .mask 0xd0000000,-4
+ .set noreorder
+ .cpload $25
+ .set reorder
+ subu $sp, $sp, 32
+ .cprestore 16
+ sw $31, 28($sp)
+ sw $fp, 24($sp)
+ sw $28, 20($sp)
+ move $fp, $sp
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ lw $31, 28($sp)
+ lw $fp, 24($sp)
+ .set noreorder
+ .set nomacro
+ j $31
+ addu $sp, $sp, 32
+ .set macro
+ .set reorder
+ .endm
+
+ comment "subroutine end"
+ .macro gdbasm_end name
+ .end \name
+ .endm
+
+ .macro gdbasm_call subr
+ la $25, \subr
+ jal $31, $25
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ comment "Don't know how to exit, but this will certainly halt..."
+ lw $2, 0($0)
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ .global __start
+__start:
+ move $fp, $sp
+ .endm
diff --git a/gdb/testsuite/gdb.base/constvars.c b/gdb/testsuite/gdb.base/constvars.c
index b0ce7529ecb..16025770e35 100644
--- a/gdb/testsuite/gdb.base/constvars.c
+++ b/gdb/testsuite/gdb.base/constvars.c
@@ -166,6 +166,11 @@ main (void)
const volatile char * const volatile vagary = &victor;
const volatile unsigned char * const volatile vendor = &vicar;
+
+ /* various structs with const members */
+
+ struct crass { char * const ptr; } crass;
+ struct crisp { char * const *ptr; } crisp;
/* misc. references */
/*
diff --git a/gdb/testsuite/gdb.base/constvars.exp b/gdb/testsuite/gdb.base/constvars.exp
index bb062ef5cb9..897a025af0c 100644
--- a/gdb/testsuite/gdb.base/constvars.exp
+++ b/gdb/testsuite/gdb.base/constvars.exp
@@ -278,6 +278,11 @@ proc do_constvar_tests {} {
gdb_test "print *locust" " = 70"
local_compiler_xfail_check
gdb_test "ptype locust" "type = double \\* const"
+
+ local_compiler_xfail_check
+ gdb_test "ptype crass" "type = struct crass \{\[\r\n\]+\[\ \t\]+char \\* const ptr;\[\r\n\]+\}"
+ local_compiler_xfail_check
+ gdb_test "ptype crisp" "type = struct crisp \{\[\r\n\]+\[\ \t\]+char \\* const \\*ptr;\[\r\n\]+\}"
}
do_constvar_tests
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 078e41688ae..3fc6f0d1f5f 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -636,9 +636,9 @@ gdb_test "show print address" "Printing of addresses is on." "show print address
#test show print array
gdb_test "show print array" "Prettyprinting of arrays is on." "show print array"
#test show print asm-demangle
-gdb_test "show print asm-demangle" "Demangling of C\[+\]+ names in disassembly listings is on." "show print asm-demangle"
+gdb_test "show print asm-demangle" "Demangling of C\[+\]+/ObjC names in disassembly listings is on." "show print asm-demangle"
#test show print demangle
-gdb_test "show print demangle" "Demangling of encoded C\[+\]+ names when displaying symbols is on." "show print demangle"
+gdb_test "show print demangle" "Demangling of encoded C\[+\]+/ObjC names when displaying symbols is on." "show print demangle"
#test show print elements
gdb_test "show print elements" "Limit on string chars or array elements to print is 200." "show print elements"
#test show print object
diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp
index 4b3d2eebd81..50da6774373 100644
--- a/gdb/testsuite/gdb.base/help.exp
+++ b/gdb/testsuite/gdb.base/help.exp
@@ -390,9 +390,9 @@ gdb_test "help set print address" "Set printing of addresses\." "help set print
# test help set print array
gdb_test "help set print array" "Set prettyprinting of arrays\." "help set print array"
# test help set print asm-demangle
-gdb_test "help set print asm-demangle" "Set demangling of C\[+\]+ names in disassembly listings\." "help set print asm-demangle"
+gdb_test "help set print asm-demangle" "Set demangling of C\[+\]+/ObjC names in disassembly listings\." "help set print asm-demangle"
# test help set print demangle
-gdb_test "help set print demangle" "Set demangling of encoded C\[+\]+ names when displaying symbols\." "help set print demangle"
+gdb_test "help set print demangle" "Set demangling of encoded C\[+\]+/ObjC names when displaying symbols\." "help set print demangle"
# test help set print elements
gdb_test "help set print elements" "Set limit on string chars or array elements to print\.\[\r\n\]+\"set print elements 0\" causes there to be no limit\." "help set print elements"
# test help set print object
@@ -482,9 +482,9 @@ gdb_test "help show print address" "Show printing of addresses\." "help show pri
# test help show print array
gdb_test "help show print array" "Show prettyprinting of arrays\." "help show print array"
# test help show print asm-demangle
-gdb_test "help show print asm-demangle" "Show demangling of C\[+\]+ names in disassembly listings\." "help show print asm-demangle"
+gdb_test "help show print asm-demangle" "Show demangling of C\[+\]+/ObjC names in disassembly listings\." "help show print asm-demangle"
# test help show print demangle
-gdb_test "help show print demangle" "Show demangling of encoded C\[+\]+ names when displaying symbols\." "help show print demangle"
+gdb_test "help show print demangle" "Show demangling of encoded C\[+\]+/ObjC names when displaying symbols\." "help show print demangle"
# test help show print elements
gdb_test "help show print elements" "Show limit on string chars or array elements to print\.\[\r\n\]+\"set print elements 0\" causes there to be no limit\." "help show print elements"
# test help show print object
diff --git a/gdb/testsuite/gdb.chill/ChangeLog b/gdb/testsuite/gdb.chill/ChangeLog
index f4f49b188a5..ea0068f4d45 100644
--- a/gdb/testsuite/gdb.chill/ChangeLog
+++ b/gdb/testsuite/gdb.chill/ChangeLog
@@ -1,3 +1,8 @@
+2002-11-09 Klee Dienes <kdienes@apple.com>
+
+ * chexp.exp: Mark as obsolete.
+ * pr-5016.exp: Remove stray trailing newline.
+
2002-08-01 Andrew Cagney <cagney@redhat.com>
* builtins.exp, callch.exp, chillvars.exp: Make files obsolete.
diff --git a/gdb/testsuite/gdb.chill/chexp.exp b/gdb/testsuite/gdb.chill/chexp.exp
index 820ef8334b8..aca5632032e 100644
--- a/gdb/testsuite/gdb.chill/chexp.exp
+++ b/gdb/testsuite/gdb.chill/chexp.exp
@@ -1,450 +1,450 @@
-# Copyright 1992, 1994, 1995, 1998 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
-
-# This file was written by Fred Fish. (fnf@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-set prms_id 0
-set bug_id 0
-
-# Set the current language to chill. This counts as a test. If it
-# fails, then we skip the other tests.
-
-proc set_lang_chill {} {
- global gdb_prompt
-
- send_gdb "set language chill\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language chill (timeout)" ; return 0 }
- }
-
- send_gdb "show language\n"
- gdb_expect {
- -re ".* source language is \"chill\".*$gdb_prompt $" {
- pass "set language to \"chill\""
- return 1
- }
- -re ".*$gdb_prompt $" {
- fail "setting language to \"chill\""
- return 0
- }
- timeout {
- fail "can't show language (timeout)"
- return 0
- }
- }
-}
-
-proc test_integer_literals_accepted {} {
- global gdb_prompt
-
- # Test various decimal values.
-
- gdb_test "p 123" " = 123"
- gdb_test "p -123" " = -123"
- gdb_test "p D'123" " = 123"
- gdb_test "p d'123" " = 123"
- gdb_test "p -D'123" " = -123"
- gdb_test "p -d'123" " = -123"
- gdb_test "p 12_345" " = 12345"
- gdb_test "p __1_2_3__" " = 123"
- gdb_test "p/d 123" " = D'123"
-
- # Test various binary values.
-
- gdb_test "p B'111" " = 7"
- gdb_test "p b'111" " = 7"
- gdb_test "p -B'111" " = -7"
- gdb_test "p B'0111" " = 7"
- gdb_test "p b'0111" " = 7"
- gdb_test "p -b'0111" " = -7"
- gdb_test "p B'_0_1_1_1_" " = 7"
- gdb_test "p b'_0_1_1_1_" " = 7"
- gdb_test "p -b'_0_1_1_1_" " = -7"
- gdb_test "p/t B'111" " = B'111"
-
- # Test various octal values.
-
- gdb_test "p O'123" " = 83"
- gdb_test "p o'123" " = 83"
- gdb_test "p -o'0123" " = -83"
- gdb_test "p O'0123" " = 83"
- gdb_test "p o'0123" " = 83"
- gdb_test "p -o'123" " = -83"
- gdb_test "p O'_1_2_3_" " = 83"
- gdb_test "p o'_1_2_3_" " = 83"
- gdb_test "p -o'_1_2_3_" " = -83"
- gdb_test "p/o O'123" " = O'123"
-
- # Test various hexadecimal values.
-
- gdb_test "p H'123" " = 291"
- gdb_test "p h'123" " = 291"
- gdb_test "p -h'123" " = -291"
- gdb_test "p H'0123" " = 291"
- gdb_test "p h'0123" " = 291"
- gdb_test "p -h'0123" " = -291"
- gdb_test "p H'_1_2_3_" " = 291"
- gdb_test "p h'_1_2_3_" " = 291"
- gdb_test "p -h'_1_2_3_" " = -291"
- gdb_test "p H'ABC" " = 2748"
- gdb_test "p H'abc" " = 2748"
- gdb_test "p H'AbC" " = 2748"
- gdb_test "p H'_A_b_C_" " = 2748"
- gdb_test "p H'_D_e_F_" " = 3567"
- gdb_test "p H'_d_E_f_" " = 3567"
- gdb_test "p/x H'123" " = H'123"
-}
-
-proc test_character_literals_accepted {} {
- global gdb_prompt
-
- # Test various decimal values.
-
- gdb_test "p 'a'" " = 'a'"
- gdb_test "p/x 'a'" " = H'61"
- gdb_test "p/d 'a'" " = D'97"
- gdb_test "p/t 'a'" " = B'1100001"
- # gdb_test "p '^(97)'" " = 'a'" (not in GNU Chill)
- gdb_test "p C'61'" " = 'a'"
- gdb_test "p c'61'" " = 'a'"
- gdb_test "p/x C'FF'" " = H'ff"
- # gdb_test "p/x '^(H'FF)'" " = H'ff" (not in GNU Chill)
- # gdb_test "p/x '^(D'255)'" " = H'ff" (not in GNU Chill)
-}
-
-proc test_integer_literals_rejected {} {
- global gdb_prompt
-
- # These are valid integer literals in Z.200, but not GNU-Chill.
-
- test_print_reject "p _"
- test_print_reject "p __"
-
- test_print_reject "p D'"
- test_print_reject "p D'_"
- test_print_reject "p D'__"
-
- test_print_reject "p B'"
- test_print_reject "p B'_"
- test_print_reject "p B'__"
-
- test_print_reject "p O'"
- test_print_reject "p O'_"
- test_print_reject "p O'__"
-
- test_print_reject "p H'"
- test_print_reject "p H'_"
- test_print_reject "p H'__"
-
- # Test various decimal values.
-
- test_print_reject "p D'DEADBEEF"
- test_print_reject "p D'123DEADBEEF"
-
- # Test various binary values.
-
- test_print_reject "p B'2" "Too-large digit in bitstring or integer."
- test_print_reject "p B'12" "Too-large digit in bitstring or integer."
-
- # Test various octal values.
-
- test_print_reject "p O'9" "Too-large digit in bitstring or integer."
- test_print_reject "p O'79" "Too-large digit in bitstring or integer."
-
- # Test various hexadecimal values.
-
- test_print_reject "p H'G" "Invalid character in bitstring or integer."
- test_print_reject "p H'AG" "Invalid character in bitstring or integer."
-}
-
-proc test_boolean_literals_accepted {} {
- global gdb_prompt
-
- # Test the only possible values for a boolean, TRUE and FALSE.
-
- gdb_test "p TRUE" " = TRUE"
- gdb_test "p FALSE" " = FALSE"
-}
-
-proc test_float_literals_accepted {} {
- global gdb_prompt
-
- # Test various floating point formats
-
- gdb_test "p .44 < .45" " = TRUE"
- gdb_test "p .44 > .45" " = FALSE"
- gdb_test "p 0.44 < 0.45" " = TRUE"
- gdb_test "p 0.44 > 0.45" " = FALSE"
- gdb_test "p 44. < 45." " = TRUE"
- gdb_test "p 44. > 45." " = FALSE"
- gdb_test "p 44.0 < 45.0" " = TRUE"
- gdb_test "p 44.0 > 45.0" " = FALSE"
- gdb_test "p 10D20 < 10D21" " = TRUE"
- gdb_test "p 10D20 > 10D21" " = FALSE"
- gdb_test "p 10d20 < 10d21" " = TRUE"
- gdb_test "p 10d20 > 10d21" " = FALSE"
- gdb_test "p 10E20 < 10E21" " = TRUE"
- gdb_test "p 10E20 > 10E21" " = FALSE"
- gdb_test "p 10e20 < 10e21" " = TRUE"
- gdb_test "p 10e20 > 10e21" " = FALSE"
- gdb_test "p 10.D20 < 10.D21" " = TRUE"
- gdb_test "p 10.D20 > 10.D21" " = FALSE"
- gdb_test "p 10.d20 < 10.d21" " = TRUE"
- gdb_test "p 10.d20 > 10.d21" " = FALSE"
- gdb_test "p 10.E20 < 10.E21" " = TRUE"
- gdb_test "p 10.E20 > 10.E21" " = FALSE"
- gdb_test "p 10.e20 < 10.e21" " = TRUE"
- gdb_test "p 10.e20 > 10.e21" " = FALSE"
- gdb_test "p 10.0D20 < 10.0D21" " = TRUE"
- gdb_test "p 10.0D20 > 10.0D21" " = FALSE"
- gdb_test "p 10.0d20 < 10.0d21" " = TRUE"
- gdb_test "p 10.0d20 > 10.0d21" " = FALSE"
- gdb_test "p 10.0E20 < 10.0E21" " = TRUE"
- gdb_test "p 10.0E20 > 10.0E21" " = FALSE"
- gdb_test "p 10.0e20 < 10.0e21" " = TRUE"
- gdb_test "p 10.0e20 > 10.0e21" " = FALSE"
- gdb_test "p 10.0D+20 < 10.0D+21" " = TRUE"
- gdb_test "p 10.0D+20 > 10.0D+21" " = FALSE"
- gdb_test "p 10.0d+20 < 10.0d+21" " = TRUE"
- gdb_test "p 10.0d+20 > 10.0d+21" " = FALSE"
- gdb_test "p 10.0E+20 < 10.0E+21" " = TRUE"
- gdb_test "p 10.0E+20 > 10.0E+21" " = FALSE"
- gdb_test "p 10.0e+20 < 10.0e+21" " = TRUE"
- gdb_test "p 10.0e+20 > 10.0e+21" " = FALSE"
- gdb_test "p 10.0D-11 < 10.0D-10" " = TRUE"
- gdb_test "p 10.0D-11 > 10.0D-10" " = FALSE"
- gdb_test "p 10.0d-11 < 10.0d-10" " = TRUE"
- gdb_test "p 10.0d-11 > 10.0d-10" " = FALSE"
- gdb_test "p 10.0E-11 < 10.0E-10" " = TRUE"
- gdb_test "p 10.0E-11 > 10.0E-10" " = FALSE"
- gdb_test "p 10.0e-11 < 10.0e-10" " = TRUE"
- gdb_test "p 10.0e-11 > 10.0e-10" " = FALSE"
- # looks funny, but apparently legal
- gdb_test "p _.1e+10 < _.1e+11" " = TRUE"
- gdb_test "p _.1e+10 > _.1e+11" " = FALSE"
- gdb_test "p __.1e-12 < __.1e-11" " = TRUE"
- gdb_test "p __.1e-12 > __.1e-11" " = FALSE"
-}
-
-proc test_convenience_variables {} {
- global gdb_prompt
-
- gdb_test "set \$foo := 101" " := 101\[\r\]*" \
- "Set a new convenience variable"
-
- gdb_test "print \$foo" " = 101" \
- "Print contents of new convenience variable"
-
- gdb_test "set \$foo := 301" " := 301\[\r\]*" \
- "Set convenience variable to a new value"
-
- gdb_test "print \$foo" " = 301" \
- "Print new contents of convenience variable"
-
- gdb_test "set \$_ := 11" " := 11\[\r\]*" \
- "Set convenience variable \$_"
-
- gdb_test "print \$_" " = 11" \
- "Print contents of convenience variable \$_"
-
- gdb_test "print \$foo + 10" " = 311" \
- "Use convenience variable in arithmetic expression"
-
- gdb_test "print (\$foo := 32) + 4" " = 36" \
- "Use convenience variable assignment in arithmetic expression"
-
- gdb_test "print \$bar" " = void" \
- "Print contents of uninitialized convenience variable"
-}
-
-proc test_value_history {} {
- global gdb_prompt
-
- gdb_test "print 101" "\\\$1 = 101" \
- "Set value-history\[1\] using \$1"
-
- gdb_test "print 102" "\\\$2 = 102" \
- "Set value-history\[2\] using \$2"
-
- gdb_test "print 103" "\\\$3 = 103" \
- "Set value-history\[3\] using \$3"
-
- gdb_test "print \$\$" "\\\$4 = 102" \
- "Print value-history\[MAX-1\] using inplicit index \$\$"
-
- gdb_test "print \$\$" "\\\$5 = 103" \
- "Print value-history\[MAX-1\] again using implicit index \$\$"
-
- gdb_test "print \$" "\\\$6 = 103" \
- "Print value-history\[MAX\] using implicit index \$"
-
- gdb_test "print \$\$2" "\\\$7 = 102" \
- "Print value-history\[MAX-2\] using explicit index \$\$2"
-
- gdb_test "print \$0" "\\\$8 = 102" \
- "Print value-history\[MAX\] using explicit index \$0"
-
- gdb_test "print 108" "\\\$9 = 108" ""
-
- gdb_test "print \$\$0" "\\\$10 = 108" \
- "Print value-history\[MAX\] using explicit index \$\$0"
-
- gdb_test "print \$1" "\\\$11 = 101" \
- "Print value-history\[1\] using explicit index \$1"
-
- gdb_test "print \$2" "\\\$12 = 102" \
- "Print value-history\[2\] using explicit index \$2"
-
- gdb_test "print \$3" "\\\$13 = 103" \
- "Print value-history\[3\] using explicit index \$3"
-
- gdb_test "print \$-3" "\\\$14 = 100" \
- "Print (value-history\[MAX\] - 3) using implicit index \$"
-
- gdb_test "print \$1 + 3" "\\\$15 = 104" \
- "Use value-history element in arithmetic expression"
-}
-
-proc test_arithmetic_expressions {} {
- global gdb_prompt
-
- # Test unary minus with various operands
-
-# gdb_test "p -(TRUE)" " = -1" "unary minus applied to bool"
-# gdb_test "p -('a')" " = xxx" "unary minus applied to char"
- gdb_test "p -(1)" " = -1" "unary minus applied to int"
- gdb_test "p -(1.0)" " = -1" "unary minus applied to real"
-
- # Test addition with various operands
-
- gdb_test "p TRUE + 1" " = 2" "bool plus int"
- gdb_test "p 'a' + 1" " = 98" "char plus int"
- gdb_test "p 1 + 1" " = 2" "int plus int"
- gdb_test "p 1.0 + 1" " = 2" "real plus int"
- gdb_test "p 1.0 + 2.0" " = 3" "real plus real"
-
- # Test subtraction with various operands
-
- gdb_test "p TRUE - 1" " = 0" "bool minus int"
- gdb_test "p 'b' - 1" " = 97" "char minus int"
- gdb_test "p 3 - 1" " = 2" "int minus int"
- gdb_test "p 3.0 - 1" " = 2" "real minus int"
- gdb_test "p 5.0 - 2.0" " = 3" "real minus real"
-
- # Test multiplication with various operands
-
- gdb_test "p TRUE * 1" " = 1" "bool times int"
- gdb_test "p 'a' * 2" " = 194" "char times int"
- gdb_test "p 2 * 3" " = 6" "int times int"
- gdb_test "p 2.0 * 3" " = 6" "real times int"
- gdb_test "p 2.0 * 3.0" " = 6" "real times real"
-
- # Test division with various operands
-
- gdb_test "p TRUE / 1" " = 1" "bool divided by int"
- gdb_test "p 'a' / 2" " = 48" "char divided by int"
- gdb_test "p 6 / 3" " = 2" "int divided by int"
- gdb_test "p 6.0 / 3" " = 2" "real divided by int"
- gdb_test "p 6.0 / 3.0" " = 2" "real divided by real"
-
- # Test modulo with various operands
-
- gdb_test "p TRUE MOD 1" " = 0" "bool modulo int"
- gdb_test "p 'a' MOD 2" " = 1" "char modulo int"
- gdb_test "p -5 MOD 3" " = 1" "negative int modulo int"
- gdb_test "p 5 MOD 1" " = 0" "int modulo int"
- gdb_test "p 5 MOD 2" " = 1" "int modulo int"
- gdb_test "p 5 MOD 3" " = 2" "int modulo int"
- gdb_test "p 5 MOD 4" " = 1" "int modulo int"
- gdb_test "p 5 MOD 5" " = 0" "int modulo int"
- gdb_test "p 0 MOD 1" " = 0" "int modulo int"
- gdb_test "p 0 MOD 2" " = 0" "int modulo int"
- gdb_test "p 0 MOD 3" " = 0" "int modulo int"
- gdb_test "p 0 MOD 4" " = 0" "int modulo int"
- gdb_test "p -5 MOD 1" " = 0" "int modulo int"
- gdb_test "p -5 MOD 2" " = 1" "int modulo int"
- gdb_test "p -5 MOD 3" " = 1" "int modulo int"
- gdb_test "p -5 MOD 4" " = 3" "int modulo int"
- gdb_test "p -5 MOD 5" " = 0" "int modulo int"
- gdb_test "p -5 MOD 5" " = 0" "int modulo int"
- test_print_reject "p 6.0 MOD 3" \
- "Integer-only operation on floating point number.*"
- test_print_reject "p 6.0 MOD 3.0" \
- "Integer-only operation on floating point number.*"
- test_print_reject "p -5 MOD -1" \
- "Second operand of MOD must be greater than zero.*"
- test_print_reject "p -5 MOD 0" \
- "Second operand of MOD must be greater than zero.*"
-
- # Test remainder with various operands
-
- gdb_test "p TRUE REM 1" " = 0" "bool remainder int"
- gdb_test "p 'a' REM 2" " = 1" "char remainder int"
- gdb_test "p 5 REM 5" " = 0" "int remainder int"
- gdb_test "p 5 REM 4" " = 1" "int remainder int"
- gdb_test "p 5 REM 3" " = 2" "int remainder int"
- gdb_test "p 5 REM 2" " = 1" "int remainder int"
- gdb_test "p 5 REM 1" " = 0" "int remainder int"
- gdb_test "p 5 REM -1" " = 0" "int remainder int"
- gdb_test "p 5 REM -2" " = 1" "int remainder int"
- gdb_test "p 5 REM -3" " = 2" "int remainder int"
- gdb_test "p 5 REM -4" " = 1" "int remainder int"
- gdb_test "p 5 REM -5" " = 0" "int remainder int"
- gdb_test "p -5 REM 5" " = 0" "int remainder int"
- gdb_test "p -5 REM 4" " = -1" "int remainder int"
- gdb_test "p -5 REM 3" " = -2" "int remainder int"
- gdb_test "p -5 REM 2" " = -1" "int remainder int"
- gdb_test "p -5 REM 1" " = 0" "int remainder int"
- gdb_test "p -5 REM -1" " = 0" "int remainder int"
- gdb_test "p -5 REM -2" " = -1" "int remainder int"
- gdb_test "p -5 REM -3" " = -2" "int remainder int"
- gdb_test "p -5 REM -4" " = -1" "int remainder int"
- gdb_test "p -5 REM -5" " = 0" "int remainder int"
- gdb_test "p 6 REM 3" " = 0" "int remainder int"
- test_print_reject "p 6.0 REM 3" \
- "Integer-only operation on floating point number.*"
- test_print_reject "p 6.0 REM 3.0" \
- "Integer-only operation on floating point number.*"
-}
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ""
-
-if [set_lang_chill] then {
- test_value_history
- test_convenience_variables
- test_integer_literals_accepted
- test_integer_literals_rejected
- test_boolean_literals_accepted
- test_character_literals_accepted
- test_float_literals_accepted
- test_arithmetic_expressions
-} else {
- warning "$test_name tests suppressed." 0
-}
+# OBSOLETE # Copyright 1992, 1994, 1995, 1998 Free Software Foundation, Inc.
+# OBSOLETE
+# OBSOLETE # This program is free software; you can redistribute it and/or modify
+# OBSOLETE # it under the terms of the GNU General Public License as published by
+# OBSOLETE # the Free Software Foundation; either version 2 of the License, or
+# OBSOLETE # (at your option) any later version.
+# OBSOLETE #
+# OBSOLETE # This program is distributed in the hope that it will be useful,
+# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of
+# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# OBSOLETE # GNU General Public License for more details.
+# OBSOLETE #
+# OBSOLETE # You should have received a copy of the GNU General Public License
+# OBSOLETE # along with this program; if not, write to the Free Software
+# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# OBSOLETE
+# OBSOLETE # Please email any bugs, comments, and/or additions to this file to:
+# OBSOLETE # bug-gdb@prep.ai.mit.edu
+# OBSOLETE
+# OBSOLETE # This file was written by Fred Fish. (fnf@cygnus.com)
+# OBSOLETE
+# OBSOLETE if $tracelevel then {
+# OBSOLETE strace $tracelevel
+# OBSOLETE }
+# OBSOLETE
+# OBSOLETE set prms_id 0
+# OBSOLETE set bug_id 0
+# OBSOLETE
+# OBSOLETE # Set the current language to chill. This counts as a test. If it
+# OBSOLETE # fails, then we skip the other tests.
+# OBSOLETE
+# OBSOLETE proc set_lang_chill {} {
+# OBSOLETE global gdb_prompt
+# OBSOLETE
+# OBSOLETE send_gdb "set language chill\n"
+# OBSOLETE gdb_expect {
+# OBSOLETE -re ".*$gdb_prompt $" {}
+# OBSOLETE timeout { fail "set language chill (timeout)" ; return 0 }
+# OBSOLETE }
+# OBSOLETE
+# OBSOLETE send_gdb "show language\n"
+# OBSOLETE gdb_expect {
+# OBSOLETE -re ".* source language is \"chill\".*$gdb_prompt $" {
+# OBSOLETE pass "set language to \"chill\""
+# OBSOLETE return 1
+# OBSOLETE }
+# OBSOLETE -re ".*$gdb_prompt $" {
+# OBSOLETE fail "setting language to \"chill\""
+# OBSOLETE return 0
+# OBSOLETE }
+# OBSOLETE timeout {
+# OBSOLETE fail "can't show language (timeout)"
+# OBSOLETE return 0
+# OBSOLETE }
+# OBSOLETE }
+# OBSOLETE }
+# OBSOLETE
+# OBSOLETE proc test_integer_literals_accepted {} {
+# OBSOLETE global gdb_prompt
+# OBSOLETE
+# OBSOLETE # Test various decimal values.
+# OBSOLETE
+# OBSOLETE gdb_test "p 123" " = 123"
+# OBSOLETE gdb_test "p -123" " = -123"
+# OBSOLETE gdb_test "p D'123" " = 123"
+# OBSOLETE gdb_test "p d'123" " = 123"
+# OBSOLETE gdb_test "p -D'123" " = -123"
+# OBSOLETE gdb_test "p -d'123" " = -123"
+# OBSOLETE gdb_test "p 12_345" " = 12345"
+# OBSOLETE gdb_test "p __1_2_3__" " = 123"
+# OBSOLETE gdb_test "p/d 123" " = D'123"
+# OBSOLETE
+# OBSOLETE # Test various binary values.
+# OBSOLETE
+# OBSOLETE gdb_test "p B'111" " = 7"
+# OBSOLETE gdb_test "p b'111" " = 7"
+# OBSOLETE gdb_test "p -B'111" " = -7"
+# OBSOLETE gdb_test "p B'0111" " = 7"
+# OBSOLETE gdb_test "p b'0111" " = 7"
+# OBSOLETE gdb_test "p -b'0111" " = -7"
+# OBSOLETE gdb_test "p B'_0_1_1_1_" " = 7"
+# OBSOLETE gdb_test "p b'_0_1_1_1_" " = 7"
+# OBSOLETE gdb_test "p -b'_0_1_1_1_" " = -7"
+# OBSOLETE gdb_test "p/t B'111" " = B'111"
+# OBSOLETE
+# OBSOLETE # Test various octal values.
+# OBSOLETE
+# OBSOLETE gdb_test "p O'123" " = 83"
+# OBSOLETE gdb_test "p o'123" " = 83"
+# OBSOLETE gdb_test "p -o'0123" " = -83"
+# OBSOLETE gdb_test "p O'0123" " = 83"
+# OBSOLETE gdb_test "p o'0123" " = 83"
+# OBSOLETE gdb_test "p -o'123" " = -83"
+# OBSOLETE gdb_test "p O'_1_2_3_" " = 83"
+# OBSOLETE gdb_test "p o'_1_2_3_" " = 83"
+# OBSOLETE gdb_test "p -o'_1_2_3_" " = -83"
+# OBSOLETE gdb_test "p/o O'123" " = O'123"
+# OBSOLETE
+# OBSOLETE # Test various hexadecimal values.
+# OBSOLETE
+# OBSOLETE gdb_test "p H'123" " = 291"
+# OBSOLETE gdb_test "p h'123" " = 291"
+# OBSOLETE gdb_test "p -h'123" " = -291"
+# OBSOLETE gdb_test "p H'0123" " = 291"
+# OBSOLETE gdb_test "p h'0123" " = 291"
+# OBSOLETE gdb_test "p -h'0123" " = -291"
+# OBSOLETE gdb_test "p H'_1_2_3_" " = 291"
+# OBSOLETE gdb_test "p h'_1_2_3_" " = 291"
+# OBSOLETE gdb_test "p -h'_1_2_3_" " = -291"
+# OBSOLETE gdb_test "p H'ABC" " = 2748"
+# OBSOLETE gdb_test "p H'abc" " = 2748"
+# OBSOLETE gdb_test "p H'AbC" " = 2748"
+# OBSOLETE gdb_test "p H'_A_b_C_" " = 2748"
+# OBSOLETE gdb_test "p H'_D_e_F_" " = 3567"
+# OBSOLETE gdb_test "p H'_d_E_f_" " = 3567"
+# OBSOLETE gdb_test "p/x H'123" " = H'123"
+# OBSOLETE }
+# OBSOLETE
+# OBSOLETE proc test_character_literals_accepted {} {
+# OBSOLETE global gdb_prompt
+# OBSOLETE
+# OBSOLETE # Test various decimal values.
+# OBSOLETE
+# OBSOLETE gdb_test "p 'a'" " = 'a'"
+# OBSOLETE gdb_test "p/x 'a'" " = H'61"
+# OBSOLETE gdb_test "p/d 'a'" " = D'97"
+# OBSOLETE gdb_test "p/t 'a'" " = B'1100001"
+# OBSOLETE # gdb_test "p '^(97)'" " = 'a'" (not in GNU Chill)
+# OBSOLETE gdb_test "p C'61'" " = 'a'"
+# OBSOLETE gdb_test "p c'61'" " = 'a'"
+# OBSOLETE gdb_test "p/x C'FF'" " = H'ff"
+# OBSOLETE # gdb_test "p/x '^(H'FF)'" " = H'ff" (not in GNU Chill)
+# OBSOLETE # gdb_test "p/x '^(D'255)'" " = H'ff" (not in GNU Chill)
+# OBSOLETE }
+# OBSOLETE
+# OBSOLETE proc test_integer_literals_rejected {} {
+# OBSOLETE global gdb_prompt
+# OBSOLETE
+# OBSOLETE # These are valid integer literals in Z.200, but not GNU-Chill.
+# OBSOLETE
+# OBSOLETE test_print_reject "p _"
+# OBSOLETE test_print_reject "p __"
+# OBSOLETE
+# OBSOLETE test_print_reject "p D'"
+# OBSOLETE test_print_reject "p D'_"
+# OBSOLETE test_print_reject "p D'__"
+# OBSOLETE
+# OBSOLETE test_print_reject "p B'"
+# OBSOLETE test_print_reject "p B'_"
+# OBSOLETE test_print_reject "p B'__"
+# OBSOLETE
+# OBSOLETE test_print_reject "p O'"
+# OBSOLETE test_print_reject "p O'_"
+# OBSOLETE test_print_reject "p O'__"
+# OBSOLETE
+# OBSOLETE test_print_reject "p H'"
+# OBSOLETE test_print_reject "p H'_"
+# OBSOLETE test_print_reject "p H'__"
+# OBSOLETE
+# OBSOLETE # Test various decimal values.
+# OBSOLETE
+# OBSOLETE test_print_reject "p D'DEADBEEF"
+# OBSOLETE test_print_reject "p D'123DEADBEEF"
+# OBSOLETE
+# OBSOLETE # Test various binary values.
+# OBSOLETE
+# OBSOLETE test_print_reject "p B'2" "Too-large digit in bitstring or integer."
+# OBSOLETE test_print_reject "p B'12" "Too-large digit in bitstring or integer."
+# OBSOLETE
+# OBSOLETE # Test various octal values.
+# OBSOLETE
+# OBSOLETE test_print_reject "p O'9" "Too-large digit in bitstring or integer."
+# OBSOLETE test_print_reject "p O'79" "Too-large digit in bitstring or integer."
+# OBSOLETE
+# OBSOLETE # Test various hexadecimal values.
+# OBSOLETE
+# OBSOLETE test_print_reject "p H'G" "Invalid character in bitstring or integer."
+# OBSOLETE test_print_reject "p H'AG" "Invalid character in bitstring or integer."
+# OBSOLETE }
+# OBSOLETE
+# OBSOLETE proc test_boolean_literals_accepted {} {
+# OBSOLETE global gdb_prompt
+# OBSOLETE
+# OBSOLETE # Test the only possible values for a boolean, TRUE and FALSE.
+# OBSOLETE
+# OBSOLETE gdb_test "p TRUE" " = TRUE"
+# OBSOLETE gdb_test "p FALSE" " = FALSE"
+# OBSOLETE }
+# OBSOLETE
+# OBSOLETE proc test_float_literals_accepted {} {
+# OBSOLETE global gdb_prompt
+# OBSOLETE
+# OBSOLETE # Test various floating point formats
+# OBSOLETE
+# OBSOLETE gdb_test "p .44 < .45" " = TRUE"
+# OBSOLETE gdb_test "p .44 > .45" " = FALSE"
+# OBSOLETE gdb_test "p 0.44 < 0.45" " = TRUE"
+# OBSOLETE gdb_test "p 0.44 > 0.45" " = FALSE"
+# OBSOLETE gdb_test "p 44. < 45." " = TRUE"
+# OBSOLETE gdb_test "p 44. > 45." " = FALSE"
+# OBSOLETE gdb_test "p 44.0 < 45.0" " = TRUE"
+# OBSOLETE gdb_test "p 44.0 > 45.0" " = FALSE"
+# OBSOLETE gdb_test "p 10D20 < 10D21" " = TRUE"
+# OBSOLETE gdb_test "p 10D20 > 10D21" " = FALSE"
+# OBSOLETE gdb_test "p 10d20 < 10d21" " = TRUE"
+# OBSOLETE gdb_test "p 10d20 > 10d21" " = FALSE"
+# OBSOLETE gdb_test "p 10E20 < 10E21" " = TRUE"
+# OBSOLETE gdb_test "p 10E20 > 10E21" " = FALSE"
+# OBSOLETE gdb_test "p 10e20 < 10e21" " = TRUE"
+# OBSOLETE gdb_test "p 10e20 > 10e21" " = FALSE"
+# OBSOLETE gdb_test "p 10.D20 < 10.D21" " = TRUE"
+# OBSOLETE gdb_test "p 10.D20 > 10.D21" " = FALSE"
+# OBSOLETE gdb_test "p 10.d20 < 10.d21" " = TRUE"
+# OBSOLETE gdb_test "p 10.d20 > 10.d21" " = FALSE"
+# OBSOLETE gdb_test "p 10.E20 < 10.E21" " = TRUE"
+# OBSOLETE gdb_test "p 10.E20 > 10.E21" " = FALSE"
+# OBSOLETE gdb_test "p 10.e20 < 10.e21" " = TRUE"
+# OBSOLETE gdb_test "p 10.e20 > 10.e21" " = FALSE"
+# OBSOLETE gdb_test "p 10.0D20 < 10.0D21" " = TRUE"
+# OBSOLETE gdb_test "p 10.0D20 > 10.0D21" " = FALSE"
+# OBSOLETE gdb_test "p 10.0d20 < 10.0d21" " = TRUE"
+# OBSOLETE gdb_test "p 10.0d20 > 10.0d21" " = FALSE"
+# OBSOLETE gdb_test "p 10.0E20 < 10.0E21" " = TRUE"
+# OBSOLETE gdb_test "p 10.0E20 > 10.0E21" " = FALSE"
+# OBSOLETE gdb_test "p 10.0e20 < 10.0e21" " = TRUE"
+# OBSOLETE gdb_test "p 10.0e20 > 10.0e21" " = FALSE"
+# OBSOLETE gdb_test "p 10.0D+20 < 10.0D+21" " = TRUE"
+# OBSOLETE gdb_test "p 10.0D+20 > 10.0D+21" " = FALSE"
+# OBSOLETE gdb_test "p 10.0d+20 < 10.0d+21" " = TRUE"
+# OBSOLETE gdb_test "p 10.0d+20 > 10.0d+21" " = FALSE"
+# OBSOLETE gdb_test "p 10.0E+20 < 10.0E+21" " = TRUE"
+# OBSOLETE gdb_test "p 10.0E+20 > 10.0E+21" " = FALSE"
+# OBSOLETE gdb_test "p 10.0e+20 < 10.0e+21" " = TRUE"
+# OBSOLETE gdb_test "p 10.0e+20 > 10.0e+21" " = FALSE"
+# OBSOLETE gdb_test "p 10.0D-11 < 10.0D-10" " = TRUE"
+# OBSOLETE gdb_test "p 10.0D-11 > 10.0D-10" " = FALSE"
+# OBSOLETE gdb_test "p 10.0d-11 < 10.0d-10" " = TRUE"
+# OBSOLETE gdb_test "p 10.0d-11 > 10.0d-10" " = FALSE"
+# OBSOLETE gdb_test "p 10.0E-11 < 10.0E-10" " = TRUE"
+# OBSOLETE gdb_test "p 10.0E-11 > 10.0E-10" " = FALSE"
+# OBSOLETE gdb_test "p 10.0e-11 < 10.0e-10" " = TRUE"
+# OBSOLETE gdb_test "p 10.0e-11 > 10.0e-10" " = FALSE"
+# OBSOLETE # looks funny, but apparently legal
+# OBSOLETE gdb_test "p _.1e+10 < _.1e+11" " = TRUE"
+# OBSOLETE gdb_test "p _.1e+10 > _.1e+11" " = FALSE"
+# OBSOLETE gdb_test "p __.1e-12 < __.1e-11" " = TRUE"
+# OBSOLETE gdb_test "p __.1e-12 > __.1e-11" " = FALSE"
+# OBSOLETE }
+# OBSOLETE
+# OBSOLETE proc test_convenience_variables {} {
+# OBSOLETE global gdb_prompt
+# OBSOLETE
+# OBSOLETE gdb_test "set \$foo := 101" " := 101\[\r\]*" \
+\# OBSOLETE "Set a new convenience variable"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$foo" " = 101" \
+\# OBSOLETE "Print contents of new convenience variable"
+# OBSOLETE
+# OBSOLETE gdb_test "set \$foo := 301" " := 301\[\r\]*" \
+\# OBSOLETE "Set convenience variable to a new value"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$foo" " = 301" \
+\# OBSOLETE "Print new contents of convenience variable"
+# OBSOLETE
+# OBSOLETE gdb_test "set \$_ := 11" " := 11\[\r\]*" \
+\# OBSOLETE "Set convenience variable \$_"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$_" " = 11" \
+\# OBSOLETE "Print contents of convenience variable \$_"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$foo + 10" " = 311" \
+\# OBSOLETE "Use convenience variable in arithmetic expression"
+# OBSOLETE
+# OBSOLETE gdb_test "print (\$foo := 32) + 4" " = 36" \
+\# OBSOLETE "Use convenience variable assignment in arithmetic expression"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$bar" " = void" \
+\# OBSOLETE "Print contents of uninitialized convenience variable"
+# OBSOLETE }
+# OBSOLETE
+# OBSOLETE proc test_value_history {} {
+# OBSOLETE global gdb_prompt
+# OBSOLETE
+# OBSOLETE gdb_test "print 101" "\\\$1 = 101" \
+\# OBSOLETE "Set value-history\[1\] using \$1"
+# OBSOLETE
+# OBSOLETE gdb_test "print 102" "\\\$2 = 102" \
+\# OBSOLETE "Set value-history\[2\] using \$2"
+# OBSOLETE
+# OBSOLETE gdb_test "print 103" "\\\$3 = 103" \
+\# OBSOLETE "Set value-history\[3\] using \$3"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$\$" "\\\$4 = 102" \
+\# OBSOLETE "Print value-history\[MAX-1\] using inplicit index \$\$"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$\$" "\\\$5 = 103" \
+\# OBSOLETE "Print value-history\[MAX-1\] again using implicit index \$\$"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$" "\\\$6 = 103" \
+\# OBSOLETE "Print value-history\[MAX\] using implicit index \$"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$\$2" "\\\$7 = 102" \
+\# OBSOLETE "Print value-history\[MAX-2\] using explicit index \$\$2"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$0" "\\\$8 = 102" \
+\# OBSOLETE "Print value-history\[MAX\] using explicit index \$0"
+# OBSOLETE
+# OBSOLETE gdb_test "print 108" "\\\$9 = 108" ""
+# OBSOLETE
+# OBSOLETE gdb_test "print \$\$0" "\\\$10 = 108" \
+\# OBSOLETE "Print value-history\[MAX\] using explicit index \$\$0"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$1" "\\\$11 = 101" \
+\# OBSOLETE "Print value-history\[1\] using explicit index \$1"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$2" "\\\$12 = 102" \
+\# OBSOLETE "Print value-history\[2\] using explicit index \$2"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$3" "\\\$13 = 103" \
+\# OBSOLETE "Print value-history\[3\] using explicit index \$3"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$-3" "\\\$14 = 100" \
+\# OBSOLETE "Print (value-history\[MAX\] - 3) using implicit index \$"
+# OBSOLETE
+# OBSOLETE gdb_test "print \$1 + 3" "\\\$15 = 104" \
+\# OBSOLETE "Use value-history element in arithmetic expression"
+# OBSOLETE }
+# OBSOLETE
+# OBSOLETE proc test_arithmetic_expressions {} {
+# OBSOLETE global gdb_prompt
+# OBSOLETE
+# OBSOLETE # Test unary minus with various operands
+# OBSOLETE
+# OBSOLETE # gdb_test "p -(TRUE)" " = -1" "unary minus applied to bool"
+# OBSOLETE # gdb_test "p -('a')" " = xxx" "unary minus applied to char"
+# OBSOLETE gdb_test "p -(1)" " = -1" "unary minus applied to int"
+# OBSOLETE gdb_test "p -(1.0)" " = -1" "unary minus applied to real"
+# OBSOLETE
+# OBSOLETE # Test addition with various operands
+# OBSOLETE
+# OBSOLETE gdb_test "p TRUE + 1" " = 2" "bool plus int"
+# OBSOLETE gdb_test "p 'a' + 1" " = 98" "char plus int"
+# OBSOLETE gdb_test "p 1 + 1" " = 2" "int plus int"
+# OBSOLETE gdb_test "p 1.0 + 1" " = 2" "real plus int"
+# OBSOLETE gdb_test "p 1.0 + 2.0" " = 3" "real plus real"
+# OBSOLETE
+# OBSOLETE # Test subtraction with various operands
+# OBSOLETE
+# OBSOLETE gdb_test "p TRUE - 1" " = 0" "bool minus int"
+# OBSOLETE gdb_test "p 'b' - 1" " = 97" "char minus int"
+# OBSOLETE gdb_test "p 3 - 1" " = 2" "int minus int"
+# OBSOLETE gdb_test "p 3.0 - 1" " = 2" "real minus int"
+# OBSOLETE gdb_test "p 5.0 - 2.0" " = 3" "real minus real"
+# OBSOLETE
+# OBSOLETE # Test multiplication with various operands
+# OBSOLETE
+# OBSOLETE gdb_test "p TRUE * 1" " = 1" "bool times int"
+# OBSOLETE gdb_test "p 'a' * 2" " = 194" "char times int"
+# OBSOLETE gdb_test "p 2 * 3" " = 6" "int times int"
+# OBSOLETE gdb_test "p 2.0 * 3" " = 6" "real times int"
+# OBSOLETE gdb_test "p 2.0 * 3.0" " = 6" "real times real"
+# OBSOLETE
+# OBSOLETE # Test division with various operands
+# OBSOLETE
+# OBSOLETE gdb_test "p TRUE / 1" " = 1" "bool divided by int"
+# OBSOLETE gdb_test "p 'a' / 2" " = 48" "char divided by int"
+# OBSOLETE gdb_test "p 6 / 3" " = 2" "int divided by int"
+# OBSOLETE gdb_test "p 6.0 / 3" " = 2" "real divided by int"
+# OBSOLETE gdb_test "p 6.0 / 3.0" " = 2" "real divided by real"
+# OBSOLETE
+# OBSOLETE # Test modulo with various operands
+# OBSOLETE
+# OBSOLETE gdb_test "p TRUE MOD 1" " = 0" "bool modulo int"
+# OBSOLETE gdb_test "p 'a' MOD 2" " = 1" "char modulo int"
+# OBSOLETE gdb_test "p -5 MOD 3" " = 1" "negative int modulo int"
+# OBSOLETE gdb_test "p 5 MOD 1" " = 0" "int modulo int"
+# OBSOLETE gdb_test "p 5 MOD 2" " = 1" "int modulo int"
+# OBSOLETE gdb_test "p 5 MOD 3" " = 2" "int modulo int"
+# OBSOLETE gdb_test "p 5 MOD 4" " = 1" "int modulo int"
+# OBSOLETE gdb_test "p 5 MOD 5" " = 0" "int modulo int"
+# OBSOLETE gdb_test "p 0 MOD 1" " = 0" "int modulo int"
+# OBSOLETE gdb_test "p 0 MOD 2" " = 0" "int modulo int"
+# OBSOLETE gdb_test "p 0 MOD 3" " = 0" "int modulo int"
+# OBSOLETE gdb_test "p 0 MOD 4" " = 0" "int modulo int"
+# OBSOLETE gdb_test "p -5 MOD 1" " = 0" "int modulo int"
+# OBSOLETE gdb_test "p -5 MOD 2" " = 1" "int modulo int"
+# OBSOLETE gdb_test "p -5 MOD 3" " = 1" "int modulo int"
+# OBSOLETE gdb_test "p -5 MOD 4" " = 3" "int modulo int"
+# OBSOLETE gdb_test "p -5 MOD 5" " = 0" "int modulo int"
+# OBSOLETE gdb_test "p -5 MOD 5" " = 0" "int modulo int"
+# OBSOLETE test_print_reject "p 6.0 MOD 3" \
+\# OBSOLETE "Integer-only operation on floating point number.*"
+# OBSOLETE test_print_reject "p 6.0 MOD 3.0" \
+\# OBSOLETE "Integer-only operation on floating point number.*"
+# OBSOLETE test_print_reject "p -5 MOD -1" \
+\# OBSOLETE "Second operand of MOD must be greater than zero.*"
+# OBSOLETE test_print_reject "p -5 MOD 0" \
+\# OBSOLETE "Second operand of MOD must be greater than zero.*"
+# OBSOLETE
+# OBSOLETE # Test remainder with various operands
+# OBSOLETE
+# OBSOLETE gdb_test "p TRUE REM 1" " = 0" "bool remainder int"
+# OBSOLETE gdb_test "p 'a' REM 2" " = 1" "char remainder int"
+# OBSOLETE gdb_test "p 5 REM 5" " = 0" "int remainder int"
+# OBSOLETE gdb_test "p 5 REM 4" " = 1" "int remainder int"
+# OBSOLETE gdb_test "p 5 REM 3" " = 2" "int remainder int"
+# OBSOLETE gdb_test "p 5 REM 2" " = 1" "int remainder int"
+# OBSOLETE gdb_test "p 5 REM 1" " = 0" "int remainder int"
+# OBSOLETE gdb_test "p 5 REM -1" " = 0" "int remainder int"
+# OBSOLETE gdb_test "p 5 REM -2" " = 1" "int remainder int"
+# OBSOLETE gdb_test "p 5 REM -3" " = 2" "int remainder int"
+# OBSOLETE gdb_test "p 5 REM -4" " = 1" "int remainder int"
+# OBSOLETE gdb_test "p 5 REM -5" " = 0" "int remainder int"
+# OBSOLETE gdb_test "p -5 REM 5" " = 0" "int remainder int"
+# OBSOLETE gdb_test "p -5 REM 4" " = -1" "int remainder int"
+# OBSOLETE gdb_test "p -5 REM 3" " = -2" "int remainder int"
+# OBSOLETE gdb_test "p -5 REM 2" " = -1" "int remainder int"
+# OBSOLETE gdb_test "p -5 REM 1" " = 0" "int remainder int"
+# OBSOLETE gdb_test "p -5 REM -1" " = 0" "int remainder int"
+# OBSOLETE gdb_test "p -5 REM -2" " = -1" "int remainder int"
+# OBSOLETE gdb_test "p -5 REM -3" " = -2" "int remainder int"
+# OBSOLETE gdb_test "p -5 REM -4" " = -1" "int remainder int"
+# OBSOLETE gdb_test "p -5 REM -5" " = 0" "int remainder int"
+# OBSOLETE gdb_test "p 6 REM 3" " = 0" "int remainder int"
+# OBSOLETE test_print_reject "p 6.0 REM 3" \
+\# OBSOLETE "Integer-only operation on floating point number.*"
+# OBSOLETE test_print_reject "p 6.0 REM 3.0" \
+\# OBSOLETE "Integer-only operation on floating point number.*"
+# OBSOLETE }
+# OBSOLETE
+# OBSOLETE # Start with a fresh gdb.
+# OBSOLETE
+# OBSOLETE gdb_exit
+# OBSOLETE gdb_start
+# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
+# OBSOLETE
+# OBSOLETE gdb_test "set print sevenbit-strings" ""
+# OBSOLETE
+# OBSOLETE if [set_lang_chill] then {
+# OBSOLETE test_value_history
+# OBSOLETE test_convenience_variables
+# OBSOLETE test_integer_literals_accepted
+# OBSOLETE test_integer_literals_rejected
+# OBSOLETE test_boolean_literals_accepted
+# OBSOLETE test_character_literals_accepted
+# OBSOLETE test_float_literals_accepted
+# OBSOLETE test_arithmetic_expressions
+# OBSOLETE } else {
+# OBSOLETE warning "$test_name tests suppressed." 0
+# OBSOLETE }
diff --git a/gdb/testsuite/gdb.chill/pr-5016.exp b/gdb/testsuite/gdb.chill/pr-5016.exp
index f01c1bf44e1..1d3a5d442c1 100644
--- a/gdb/testsuite/gdb.chill/pr-5016.exp
+++ b/gdb/testsuite/gdb.chill/pr-5016.exp
@@ -60,4 +60,3 @@
# OBSOLETE }
# OBSOLETE
# OBSOLETE do_tests
-
diff --git a/gdb/testsuite/gdb.mi/ChangeLog b/gdb/testsuite/gdb.mi/ChangeLog
index d3830308095..8b4426b3da1 100644
--- a/gdb/testsuite/gdb.mi/ChangeLog
+++ b/gdb/testsuite/gdb.mi/ChangeLog
@@ -1,3 +1,41 @@
+2002-11-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * gdb792.cc: New file to test patch for PR gdb/792.
+ * gdb792.exp: Ditto.
+
+2002-11-04 Elena Zannoni <ezannoni@redhat.com>
+
+ * mi-console.exp: Use mi_runto, mi_run_to_main, mi_next_to,
+ mi_step_to wherever possible. Update copyright notices.
+ * mi-disassemble.exp: Ditto.
+ * mi-eval.exp: Ditto.
+ * mi-read-memory.exp: Ditto.
+ * mi-regs.exp: Ditto.
+ * mi-return.exp: Ditto.
+ * mi-stack.exp: Ditto.
+ * mi-stepi.exp: Ditto.
+ * mi-var-block.exp: Ditto.
+ * mi-var-cmd.exp: Ditto.
+ * mi-watch.exp: Ditto.
+ * mi1-console.exp: Ditto.
+ * mi1-disassemble.exp: Ditto.
+ * mi1-eval.exp: Ditto.
+ * mi1-read-memory.exp: Ditto.
+ * mi1-regs.exp: Ditto.
+ * mi1-return.exp: Ditto.
+ * mi1-stack.exp: Ditto.
+ * mi1-stepi.exp: Ditto.
+ * mi1-var-block.exp: Ditto.
+ * mi1-var-cmd.exp: Ditto.
+ * mi1-watch.exp: Ditto.
+
+2002-10-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * mi-var-cmd.exp: Add tests to verify that a -var-assign that changes
+ a value shows up in the changelist of a -var-update. Part of fix
+ for gdb/702.
+ * mi1-var-cmd.exp: Ditto.
+
2002-10-03 Jeff Johnston <jjohnstn@redhat.com>
* mi-return.exp: Change expected frame output to remove extraneous
diff --git a/gdb/testsuite/gdb.mi/gdb792.cc b/gdb/testsuite/gdb.mi/gdb792.cc
new file mode 100644
index 00000000000..a698a12e0fb
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/gdb792.cc
@@ -0,0 +1,59 @@
+#include <string.h>
+#include <stdio.h>
+
+class Q
+{
+ int v;
+ protected:
+ int qx;
+ int qy;
+ int w;
+};
+
+class B
+{
+ int k;
+ public:
+ int bx;
+ int by;
+};
+
+class A
+{
+ int u;
+
+ public:
+ A()
+ {
+ };
+ int x;
+ char buffer[10];
+
+ protected:
+ int y;
+ B b;
+
+ private:
+ float z;
+};
+
+class C : public A
+{
+ public:
+ C()
+ {
+ };
+ int zzzz;
+ private:
+ int ssss;
+};
+
+int main()
+{
+ A a;
+ C c;
+ Q q;
+ strcpy( a.buffer, "test" );
+ printf ( "%.10s\n", a.buffer );
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.mi/gdb792.exp b/gdb/testsuite/gdb.mi/gdb792.exp
new file mode 100644
index 00000000000..ce5ac313ce5
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/gdb792.exp
@@ -0,0 +1,90 @@
+# 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 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.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# test gdb/792
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile gdb792
+set srcfile "$testfile.cc"
+set binfile $objdir/$subdir/$testfile
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1;
+}
+
+if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable {debug c++}] != ""} {
+ gdb_suppress_entire_file "Testcase compile failed, so all test in this file will automatically fail."
+}
+
+# Test that children of classes are properly reported
+
+# Run to main
+mi_run_to_main
+
+mi_gdb_test "-var-create - * a" \
+ "(&\".*\"\r\n)*\\^done,name=\"var1\",numchild=\"3\",type=\"A\"" \
+ "create var for class A"
+
+mi_gdb_test "-var-list-children var1" \
+ "(&\".*\"\r\n)*\\^done,numchild=\"3\",children=\{child=\{name=\"var1\.public\",exp=\"public\",numchild=\"2\"\},child=\{name=\"var1\.private\",exp=\"private\",numchild=\"2\"\},child=\{name=\"var1\.protected\",exp=\"protected\",numchild=\"2\"\}\}" \
+ "list children of class A"
+
+mi_gdb_test "-var-list-children var1.public" \
+ "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\{child=\{name=\"var1\.public\.x\",exp=\"x\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.public\.buffer\",exp=\"buffer\",numchild=\"10\",type=\"char \\\[10\\\]\"\}\}" \
+ "list children of A.public"
+
+mi_gdb_test "-var-list-children var1.private" \
+ "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\{child=\{name=\"var1\.private\.u\",exp=\"u\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.private\.z\",exp=\"z\",numchild=\"0\",type=\"float\"\}\}" \
+ "list children of A.private"
+
+mi_gdb_test "-var-list-children var1.protected" \
+ "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\{child=\{name=\"var1\.protected\.y\",exp=\"y\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.protected\.b\",exp=\"b\",numchild=\"2\",type=\"B\"\}\}" \
+ "list children of A.protected"
+
+mi_gdb_test "-var-list-children var1.protected.b" \
+ "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\{child=\{name=\"var1\.protected\.b\.public\",exp=\"public\",numchild=\"2\"\},child=\{name=\"var1\.protected\.b\.private\",exp=\"private\",numchild=\"1\"\}\}" \
+ "list children of A.protected.b"
+
+mi_gdb_test "-var-list-children var1.protected.b.public" \
+ "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\{child=\{name=\"var1\.protected\.b\.public\.bx\",exp=\"bx\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.protected\.b\.public\.by\",exp=\"by\",numchild=\"0\",type=\"int\"\}\}" \
+ "list children of A.protected.b.public"
+
+mi_gdb_test "-var-list-children var1.protected.b.private" \
+ "(&\".*\"\r\n)*\\^done,numchild=\"1\",children=\{child=\{name=\"var1\.protected\.b\.private\.k\",exp=\"k\",numchild=\"0\",type=\"int\"\}\}" \
+ "list children of A.protected.b.private"
+
+mi_gdb_test "-var-create - * c" \
+ "(&\".*\"\r\n)*\\^done,name=\"var2\",numchild=\"3\",type=\"C\"" \
+ "create var for class C which has baseclass A"
+
+mi_gdb_test "-var-list-children var2" \
+ "(&\".*\"\r\n)*\\^done,numchild=\"3\",children=\{child=\{name=\"var2\.A\",exp=\"A\",numchild=\"3\",type=\"A\"\},child=\{name=\"var2\.public\",exp=\"public\",numchild=\"1\"\},child=\{name=\"var2\.private\",exp=\"private\",numchild=\"1\"\}\}" \
+ "list children of class C"
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp
index f8bb36efa05..f611aa7046e 100644
--- a/gdb/testsuite/gdb.mi/mi-console.exp
+++ b/gdb/testsuite/gdb.mi/mi-console.exp
@@ -51,22 +51,7 @@ mi_delete_breakpoints
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-# Halt in main
-mi_gdb_test "200-break-insert main" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*mi-console.c\",line=\"13\",times=\"0\"\}" \
- "break-insert operation"
-mi_run_cmd
-gdb_expect {
- -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*mi-console.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
- pass "run to main"
- }
- -re ".*$mi_gdb_prompt$" {
- fail "run to main (2)"
- }
- timeout {
- fail "run to main (timeout)"
- }
-}
+mi_run_to_main
# Next over the hello() call which will produce lots of output
send_gdb "47-exec-next\n"
diff --git a/gdb/testsuite/gdb.mi/mi-disassemble.exp b/gdb/testsuite/gdb.mi/mi-disassemble.exp
index 6f33d67ac6e..46f00ddf51c 100644
--- a/gdb/testsuite/gdb.mi/mi-disassemble.exp
+++ b/gdb/testsuite/gdb.mi/mi-disassemble.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -43,51 +43,6 @@ mi_delete_breakpoints
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-proc test_breakpoints_creation_and_listing {} {
- global mi_gdb_prompt
- global srcfile
- global hex
-
- # Insert some breakpoints and list them
- # Also, disable some so they do not interfere with other tests
- # Tests:
- # -break-insert
- # -break-list
- # -break-disable
- # -break-info
-
- mi_gdb_test "200-break-insert main" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
- "break-insert operation"
-
- mi_gdb_test "204-break-list" \
- "204\\^done,BreakpointTable=\{.*,body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}\\\]\}" \
- "list of breakpoints"
-}
-
-proc test_running_the_program {} {
- global mi_gdb_prompt
- global hex
-
- # Run the program without args
- # Tests:
- # -exec-run
-
- # mi_gdb_test cannot be used for asynchronous commands because there are
- # two prompts involved and this can lead to a race condition.
- # FIXME: We are accepting a duplicate file and line info temporarely.
- # The following is equivalent to a send_gdb "000-exec-run\n"
- mi_run_cmd
- # The running part has been checked already by mi_run_cmd
- gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
- pass "run to main"
- }
- -re ".*$mi_gdb_prompt$" {fail "run to main (2)"}
- timeout {fail "run to main (timeout 2)"}
- }
-}
-
proc test_disassembly_only {} {
global mi_gdb_prompt
global hex
@@ -212,8 +167,7 @@ proc test_disassembly_bogus_args {} {
}
-test_breakpoints_creation_and_listing
-test_running_the_program
+mi_run_to_main
test_disassembly_only
test_disassembly_mixed
test_disassembly_bogus_args
diff --git a/gdb/testsuite/gdb.mi/mi-eval.exp b/gdb/testsuite/gdb.mi/mi-eval.exp
index 2c0141069ad..536dd791530 100644
--- a/gdb/testsuite/gdb.mi/mi-eval.exp
+++ b/gdb/testsuite/gdb.mi/mi-eval.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -46,47 +46,8 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-proc test_running_the_program {} {
- global mi_gdb_prompt
- global hex
-
- # Run the program without args, then specify srgs and rerun the program
- # Tests:
- # -exec-run
-
- mi_gdb_test "300-break-insert callee4" \
- "300\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
- "insert breakpoint at callee4"
-
- # mi_gdb_test cannot be used for asynchronous commands because there are
- # two prompts involved and this can lead to a race condition.
- # The following is equivalent to a send_gdb "000-exec-run\n"
- mi_run_cmd
- # The running part has been checked already by mi_run_cmd
- gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \
- { pass "run to callee4" }
- -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"}
- timeout {fail "run to callee4 (timeout 2)"}
- }
-
- send_gdb "101-exec-next\n"
- gdb_expect {
- -re "101\\^running\r\n$mi_gdb_prompt" {
- gdb_expect {
- -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"9\"\}\r\n$mi_gdb_prompt$" \
- { pass "next in callee4" }
- -re ".*$mi_gdb_prompt$" {fail "next in callee4 (2)"}
- timeout {fail "next in callee4 (timeout 2)"}
- }
- }
- -re ".*$mi_gdb_prompt$" {fail "next in callee4 (1)"}
- timeout {fail "next in callee4 (timeout 1)"}
- }
-
-}
-
-test_running_the_program
+mi_runto callee4
+mi_next_to "callee4" "" "basics.c" "9" "next at callee4"
mi_gdb_test "211-data-evaluate-expression A" "211\\^done,value=\"1\"" "eval A"
diff --git a/gdb/testsuite/gdb.mi/mi-read-memory.exp b/gdb/testsuite/gdb.mi/mi-read-memory.exp
index b4f0c35955f..573c8964c22 100644
--- a/gdb/testsuite/gdb.mi/mi-read-memory.exp
+++ b/gdb/testsuite/gdb.mi/mi-read-memory.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -46,21 +46,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
mi_run_to_main
-
-#mi_next "do initialization"
-send_gdb "101-exec-next\n"
-gdb_expect {
- -re "101\\^running\r\n$mi_gdb_prompt" {
- gdb_expect {
- -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*mi-read-memory.c\",line=\"20\"\}.*$mi_gdb_prompt$" \
- { pass "do initialization" }
- -re ".*$mi_gdb_prompt$" {fail "do initialization (2)"}
- timeout {fail "do initialization (timeout 2)"}
- }
- }
- -re ".*$mi_gdb_prompt$" {fail "do initialization (1)"}
- timeout {fail "do initialization (timeout 1)"}
-}
+mi_next_to "main" "" "mi-read-memory.c" "20" "next at main"
mi_gdb_test "1-data-read-memory" \
"1\\^error,msg=\".*\"" \
diff --git a/gdb/testsuite/gdb.mi/mi-regs.exp b/gdb/testsuite/gdb.mi/mi-regs.exp
index c427677a41b..a6a6406a76d 100644
--- a/gdb/testsuite/gdb.mi/mi-regs.exp
+++ b/gdb/testsuite/gdb.mi/mi-regs.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -45,51 +45,6 @@ mi_delete_breakpoints
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-proc test_breakpoints_creation_and_listing {} {
- global mi_gdb_prompt
- global srcfile
- global hex
-
- # Insert some breakpoints and list them
- # Also, disable some so they do not interfere with other tests
- # Tests:
- # -break-insert
- # -break-list
- # -break-disable
- # -break-info
-
- mi_gdb_test "200-break-insert main" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
- "break-insert operation"
-
- mi_gdb_test "204-break-list" \
- "204\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}\\\]\}" \
- "list of breakpoints"
-}
-
-proc test_running_the_program {} {
- global mi_gdb_prompt
- global hex
-
- # Run the program without args
- # Tests:
- # -exec-run
-
- # mi_gdb_test cannot be used for asynchronous commands because there are
- # two prompts involved and this can lead to a race condition.
- # FIXME: We are accepting a duplicate file and line info temporarely.
- # The following is equivalent to a send_gdb "000-exec-run\n"
- mi_run_cmd
- # The running part has been checked already by mi_run_cmd
- gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
- pass "run to main"
- }
- -re ".*$mi_gdb_prompt$" {fail "run to main (2)"}
- timeout {fail "run to main (timeout 2)"}
- }
-}
-
proc sparc_register_tests_no_exec { } {
# Test the generic IDT chip.
mi_gdb_test "111-data-list-register-values" \
@@ -164,8 +119,7 @@ proc sparc_register_tests { } {
if [istarget "sparc-*-*"] then {
sparc_register_tests_no_exec
- test_breakpoints_creation_and_listing
- test_running_the_program
+ mi_run_to_main
sparc_register_tests
} else {
verbose "mi-regs.exp tests ignored for this target"
diff --git a/gdb/testsuite/gdb.mi/mi-return.exp b/gdb/testsuite/gdb.mi/mi-return.exp
index 1e7c863a7a8..ca37e9fc9fc 100644
--- a/gdb/testsuite/gdb.mi/mi-return.exp
+++ b/gdb/testsuite/gdb.mi/mi-return.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -46,33 +46,6 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-proc test_running_to_callee4 {} {
- global mi_gdb_prompt
- global hex
-
- mi_gdb_test "200-break-insert callee4" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
- "break-insert operation"
-
- mi_run_cmd
-
- gdb_expect {
- -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" {
- pass "run to callee4"
- }
- -re ".*$mi_gdb_prompt$" {
- fail "run to callee4 (2)"
- }
- timeout {
- fail "run to callee4 (timeout)"
- }
- }
-
- mi_gdb_test "205-break-delete" \
- "205\\^done.*" \
- "delete all breakpoints"
-
-}
proc test_return_simple {} {
global mi_gdb_prompt
@@ -87,7 +60,12 @@ proc test_return_simple {} {
}
}
-test_running_to_callee4
+mi_runto callee4
+
+mi_gdb_test "205-break-delete" \
+ "205\\^done.*" \
+ "delete all breakpoints"
+
test_return_simple
mi_gdb_exit
diff --git a/gdb/testsuite/gdb.mi/mi-stack.exp b/gdb/testsuite/gdb.mi/mi-stack.exp
index 4c682e21e2f..92c651df89b 100644
--- a/gdb/testsuite/gdb.mi/mi-stack.exp
+++ b/gdb/testsuite/gdb.mi/mi-stack.exp
@@ -1,4 +1,4 @@
-# Copyright 2000 Free Software Foundation, Inc.
+# Copyright 2000, 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
@@ -46,22 +46,6 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-
-mi_gdb_test "200-break-insert callee4" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
- "break-insert operation"
-
-mi_run_cmd
-# The running part has been checked already by mi_run_cmd
-gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" {
- pass "run to callee4"
- }
- -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"}
- timeout {fail "run to callee4 (timeout 2)"}
-}
-
-
proc test_stack_frame_listing {} {
global mi_gdb_prompt
global hex
@@ -208,6 +192,7 @@ gdb_expect {
}
+mi_runto callee4
test_stack_frame_listing
test_stack_args_listing
test_stack_locals_listing
diff --git a/gdb/testsuite/gdb.mi/mi-stepi.exp b/gdb/testsuite/gdb.mi/mi-stepi.exp
index e0de2f2ccd1..44e6442150a 100644
--- a/gdb/testsuite/gdb.mi/mi-stepi.exp
+++ b/gdb/testsuite/gdb.mi/mi-stepi.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -46,29 +46,6 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-proc test_running_to_main {} {
- global mi_gdb_prompt
- global hex
-
- mi_gdb_test "200-break-insert main" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
- "break-insert operation"
-
- mi_run_cmd
-
- gdb_expect {
- -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
- pass "run to main"
- }
- -re ".*$mi_gdb_prompt$" {
- fail "run to main (2)"
- }
- timeout {
- fail "run to main (timeout)"
- }
- }
-}
-
proc test_stepi_nexti {} {
global mi_gdb_prompt
global hex
@@ -102,7 +79,7 @@ proc test_stepi_nexti {} {
}
}
-test_running_to_main
+mi_run_to_main
test_stepi_nexti
mi_gdb_exit
diff --git a/gdb/testsuite/gdb.mi/mi-var-block.exp b/gdb/testsuite/gdb.mi/mi-var-block.exp
index 506275c94a6..a0b456a90f1 100644
--- a/gdb/testsuite/gdb.mi/mi-var-block.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-block.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 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
@@ -42,19 +42,7 @@ mi_delete_breakpoints
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-mi_gdb_test "200-break-insert do_block_tests" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_block_tests\",file=\".*var-cmd.c\",line=\"154\",times=\"0\"\}" \
- "break-insert operation"
-
-mi_run_cmd
-# The running part has been checked already by mi_run_cmd
-gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"154\"\}\r\n$mi_gdb_prompt$" {
- pass "run to do_block_tests"
- }
- -re ".*$mi_gdb_prompt$" {fail "run to do_block_tests (2)"}
- timeout {fail "run to do_block_tests (timeout 2)"}
-}
+mi_runto do_block_tests
# Test: c_variable-3.2
# Desc: create cb and foo
@@ -67,15 +55,7 @@ mi_gdb_test "-var-create foo * foo" \
"create local variable foo"
# step to "foo = 123;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"158\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_block_tests"
- }
- timeout {
- fail "step at do_block_tests (timeout)"
- }
-}
+mi_step_to "do_block_tests" "" "var-cmd.c" "158" "step at do_block_test"
# Be paranoid and assume 3.2 created foo
@@ -91,15 +71,7 @@ mi_gdb_test "-var-create foo * foo" \
"create local variable foo"
# step to "foo2 = 123;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"161\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_block_tests"
- }
- timeout {
- fail "step at do_block_tests (timeout)"
- }
-}
+mi_step_to "do_block_tests" "" "var-cmd.c" "161" "step at do_block_test"
# Test: c_variable-3.4
# Desc: check foo, cb changed
@@ -108,15 +80,7 @@ mi_gdb_test "-var-update *" \
"update all vars: cb foo changed"
# step to "foo = 321;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"164\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_block_tests"
- }
- timeout {
- fail "step at do_block_tests (timeout)"
- }
-}
+mi_step_to "do_block_tests" "" "var-cmd.c" "164" "step at do_block_test"
# Test: c_variable-3.5
# Desc: create inner block foo
@@ -125,13 +89,7 @@ mi_gdb_test "-var-create inner_foo * foo" \
"create local variable inner_foo"
# step to "foo2 = 0;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"166\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_block_tests"
- }
- timeout { fail "step at do_block_tests (timeout)" }
-}
+mi_step_to "do_block_tests" "" "var-cmd.c" "166" "step at do_block_test"
# Test: c_variable-3.6
# Desc: create foo2
@@ -163,13 +121,7 @@ mi_gdb_test "-var-delete inner_foo" \
"delete var inner_foo"
# step to "foo = 0;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"168\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_block_tests"
- }
- timeout { fail "step at do_block_tests (timeout)" }
-}
+mi_step_to "do_block_tests" "" "var-cmd.c" "168" "step at do_block_test"
# Test: c_variable-3.8
# Desc: check that foo2 out of scope (known gdb problem)
@@ -180,14 +132,7 @@ mi_gdb_test "-var-update foo2" \
clear_xfail *-*-*
# step to "cb = 21;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"171\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_block_tests"
- }
- timeout { fail "step at do_block_tests (timeout)" }
-}
-
+mi_step_to "do_block_tests" "" "var-cmd.c" "171" "step at do_block_test"
# Test: c_variable-3.9
# Desc: check that only cb is in scope (known gdb problem)
diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
index 26a91cf960b..7d02b36943a 100644
--- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 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
@@ -70,19 +70,7 @@ mi_gdb_test "113-var-create argc * argc" \
"&\"mi_cmd_var_create: unable to create variable object\\\\n\".*113\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
"create out of scope variable"
-mi_gdb_test "200-break-insert do_locals_tests" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_locals_tests\",file=\".*var-cmd.c\",line=\"106\",times=\"0\"\}" \
- "break-insert operation"
-
-mi_run_cmd
-# The running part has been checked already by mi_run_cmd
-gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"106\"\}\r\n$mi_gdb_prompt$" {
- pass "run to do_locals_tests"
- }
- -re ".*$mi_gdb_prompt$" {fail "run to do_locals_tests (2)"}
- timeout {fail "run to do_locals_tests (timeout 2)"}
-}
+mi_runto do_locals_tests
# Test: c_variable-1.4
# Desc: create local variables
@@ -288,6 +276,18 @@ mi_gdb_test "-var-assign linteger 3333" \
"\\^done,value=\"3333\"" \
"assign to linteger"
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: linteger changed after assign"
+
+mi_gdb_test "-var-assign linteger 3333" \
+ "\\^done,value=\"3333\"" \
+ "assign to linteger again, same value"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\\\]" \
+ "update all vars: linteger not changed after same assign"
+
mi_gdb_test "-var-evaluate-expression linteger" \
"\\^done,value=\"3333\"" \
"eval linteger"
@@ -296,6 +296,14 @@ mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \
"\\^done,value=\"$hex\"" \
"assign to lpinteger"
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: lpinteger changed after assign"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\\\]" \
+ "update all vars: no changes on second update"
+
mi_gdb_test "-var-evaluate-expression lpinteger" \
"\\^done,value=\"$hex\"" \
"eval lpinteger"
diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp
index 25db59869be..ba243999d19 100644
--- a/gdb/testsuite/gdb.mi/mi-watch.exp
+++ b/gdb/testsuite/gdb.mi/mi-watch.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -115,31 +115,6 @@ proc test_rwatch_creation_and_listing {} {
"delete read watchpoint"
}
-proc test_running_the_program {} {
- global mi_gdb_prompt
- global hex
-
- # Run the program without args, then specify srgs and rerun the program
- # Tests:
- # -exec-run
-
- mi_gdb_test "300-break-insert callee4" \
- "300\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
- "insert breakpoint at callee4"
-
- # mi_gdb_test cannot be used for asynchronous commands because there are
- # two prompts involved and this can lead to a race condition.
- # The following is equivalent to a send_gdb "000-exec-run\n"
- mi_run_cmd
- # The running part has been checked already by mi_run_cmd
- gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \
- { pass "run to callee4" }
- -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"}
- timeout {fail "run to callee4 (timeout 2)"}
- }
-}
-
proc test_watchpoint_triggering {} {
global mi_gdb_prompt
global hex
@@ -181,7 +156,7 @@ proc test_watchpoint_triggering {} {
}
}
-test_running_the_program
+mi_runto callee4
test_watchpoint_creation_and_listing
#test_rwatch_creation_and_listing
#test_awatch_creation_and_listing
diff --git a/gdb/testsuite/gdb.mi/mi1-console.exp b/gdb/testsuite/gdb.mi/mi1-console.exp
index 5a6d6f2b897..25af50a31d1 100644
--- a/gdb/testsuite/gdb.mi/mi1-console.exp
+++ b/gdb/testsuite/gdb.mi/mi1-console.exp
@@ -51,22 +51,7 @@ mi_delete_breakpoints
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-# Halt in main
-mi_gdb_test "200-break-insert main" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*mi-console.c\",line=\"13\",times=\"0\"\}" \
- "break-insert operation"
-mi_run_cmd
-gdb_expect {
- -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*mi-console.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
- pass "run to main"
- }
- -re ".*$mi_gdb_prompt$" {
- fail "run to main (2)"
- }
- timeout {
- fail "run to main (timeout)"
- }
-}
+mi_run_to_main
# Next over the hello() call which will produce lots of output
send_gdb "47-exec-next\n"
diff --git a/gdb/testsuite/gdb.mi/mi1-disassemble.exp b/gdb/testsuite/gdb.mi/mi1-disassemble.exp
index 65af76d245e..7292a350b77 100644
--- a/gdb/testsuite/gdb.mi/mi1-disassemble.exp
+++ b/gdb/testsuite/gdb.mi/mi1-disassemble.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -43,51 +43,6 @@ mi_delete_breakpoints
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-proc test_breakpoints_creation_and_listing {} {
- global mi_gdb_prompt
- global srcfile
- global hex
-
- # Insert some breakpoints and list them
- # Also, disable some so they do not interfere with other tests
- # Tests:
- # -break-insert
- # -break-list
- # -break-disable
- # -break-info
-
- mi_gdb_test "200-break-insert main" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
- "break-insert operation"
-
- mi_gdb_test "204-break-list" \
- "204\\^done,BreakpointTable=\{.*,body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}\\\]\}" \
- "list of breakpoints"
-}
-
-proc test_running_the_program {} {
- global mi_gdb_prompt
- global hex
-
- # Run the program without args
- # Tests:
- # -exec-run
-
- # mi_gdb_test cannot be used for asynchronous commands because there are
- # two prompts involved and this can lead to a race condition.
- # FIXME: We are accepting a duplicate file and line info temporarely.
- # The following is equivalent to a send_gdb "000-exec-run\n"
- mi_run_cmd
- # The running part has been checked already by mi_run_cmd
- gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
- pass "run to main"
- }
- -re ".*$mi_gdb_prompt$" {fail "run to main (2)"}
- timeout {fail "run to main (timeout 2)"}
- }
-}
-
proc test_disassembly_only {} {
global mi_gdb_prompt
global hex
@@ -212,8 +167,7 @@ proc test_disassembly_bogus_args {} {
}
-test_breakpoints_creation_and_listing
-test_running_the_program
+mi_run_to_main
test_disassembly_only
test_disassembly_mixed
test_disassembly_bogus_args
diff --git a/gdb/testsuite/gdb.mi/mi1-eval.exp b/gdb/testsuite/gdb.mi/mi1-eval.exp
index 898c7b78777..330e00de528 100644
--- a/gdb/testsuite/gdb.mi/mi1-eval.exp
+++ b/gdb/testsuite/gdb.mi/mi1-eval.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -46,47 +46,8 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-proc test_running_the_program {} {
- global mi_gdb_prompt
- global hex
-
- # Run the program without args, then specify srgs and rerun the program
- # Tests:
- # -exec-run
-
- mi_gdb_test "300-break-insert callee4" \
- "300\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
- "insert breakpoint at callee4"
-
- # mi_gdb_test cannot be used for asynchronous commands because there are
- # two prompts involved and this can lead to a race condition.
- # The following is equivalent to a send_gdb "000-exec-run\n"
- mi_run_cmd
- # The running part has been checked already by mi_run_cmd
- gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \
- { pass "run to callee4" }
- -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"}
- timeout {fail "run to callee4 (timeout 2)"}
- }
-
- send_gdb "101-exec-next\n"
- gdb_expect {
- -re "101\\^running\r\n$mi_gdb_prompt" {
- gdb_expect {
- -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"9\"\}\r\n$mi_gdb_prompt$" \
- { pass "next in callee4" }
- -re ".*$mi_gdb_prompt$" {fail "next in callee4 (2)"}
- timeout {fail "next in callee4 (timeout 2)"}
- }
- }
- -re ".*$mi_gdb_prompt$" {fail "next in callee4 (1)"}
- timeout {fail "next in callee4 (timeout 1)"}
- }
-
-}
-
-test_running_the_program
+mi_runto callee4
+mi_next_to "callee4" "" "basics.c" "9" "next at callee4"
mi_gdb_test "211-data-evaluate-expression A" "211\\^done,value=\"1\"" "eval A"
diff --git a/gdb/testsuite/gdb.mi/mi1-read-memory.exp b/gdb/testsuite/gdb.mi/mi1-read-memory.exp
index 27960783216..9a0acf43825 100644
--- a/gdb/testsuite/gdb.mi/mi1-read-memory.exp
+++ b/gdb/testsuite/gdb.mi/mi1-read-memory.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -48,19 +48,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
mi_run_to_main
#mi_next "do initialization"
-send_gdb "101-exec-next\n"
-gdb_expect {
- -re "101\\^running\r\n$mi_gdb_prompt" {
- gdb_expect {
- -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*mi-read-memory.c\",line=\"20\"\}.*$mi_gdb_prompt$" \
- { pass "do initialization" }
- -re ".*$mi_gdb_prompt$" {fail "do initialization (2)"}
- timeout {fail "do initialization (timeout 2)"}
- }
- }
- -re ".*$mi_gdb_prompt$" {fail "do initialization (1)"}
- timeout {fail "do initialization (timeout 1)"}
-}
+
+mi_next_to "main" "" "mi-read-memory.c" "20" "next at main"
mi_gdb_test "1-data-read-memory" \
"1\\^error,msg=\".*\"" \
diff --git a/gdb/testsuite/gdb.mi/mi1-regs.exp b/gdb/testsuite/gdb.mi/mi1-regs.exp
index b4baa18b3b0..bf59907780e 100644
--- a/gdb/testsuite/gdb.mi/mi1-regs.exp
+++ b/gdb/testsuite/gdb.mi/mi1-regs.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -45,51 +45,6 @@ mi_delete_breakpoints
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-proc test_breakpoints_creation_and_listing {} {
- global mi_gdb_prompt
- global srcfile
- global hex
-
- # Insert some breakpoints and list them
- # Also, disable some so they do not interfere with other tests
- # Tests:
- # -break-insert
- # -break-list
- # -break-disable
- # -break-info
-
- mi_gdb_test "200-break-insert main" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
- "break-insert operation"
-
- mi_gdb_test "204-break-list" \
- "204\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}\\\]\}" \
- "list of breakpoints"
-}
-
-proc test_running_the_program {} {
- global mi_gdb_prompt
- global hex
-
- # Run the program without args
- # Tests:
- # -exec-run
-
- # mi_gdb_test cannot be used for asynchronous commands because there are
- # two prompts involved and this can lead to a race condition.
- # FIXME: We are accepting a duplicate file and line info temporarely.
- # The following is equivalent to a send_gdb "000-exec-run\n"
- mi_run_cmd
- # The running part has been checked already by mi_run_cmd
- gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
- pass "run to main"
- }
- -re ".*$mi_gdb_prompt$" {fail "run to main (2)"}
- timeout {fail "run to main (timeout 2)"}
- }
-}
-
proc sparc_register_tests_no_exec { } {
# Test the generic IDT chip.
mi_gdb_test "111-data-list-register-values" \
@@ -164,8 +119,7 @@ proc sparc_register_tests { } {
if [istarget "sparc-*-*"] then {
sparc_register_tests_no_exec
- test_breakpoints_creation_and_listing
- test_running_the_program
+ mi_run_to_main
sparc_register_tests
} else {
verbose "mi-regs.exp tests ignored for this target"
diff --git a/gdb/testsuite/gdb.mi/mi1-return.exp b/gdb/testsuite/gdb.mi/mi1-return.exp
index 0fcbbfe62f4..539a61cbf44 100644
--- a/gdb/testsuite/gdb.mi/mi1-return.exp
+++ b/gdb/testsuite/gdb.mi/mi1-return.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -46,33 +46,6 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-proc test_running_to_callee4 {} {
- global mi_gdb_prompt
- global hex
-
- mi_gdb_test "200-break-insert callee4" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
- "break-insert operation"
-
- mi_run_cmd
-
- gdb_expect {
- -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" {
- pass "run to callee4"
- }
- -re ".*$mi_gdb_prompt$" {
- fail "run to callee4 (2)"
- }
- timeout {
- fail "run to callee4 (timeout)"
- }
- }
-
- mi_gdb_test "205-break-delete" \
- "205\\^done.*" \
- "delete all breakpoints"
-
-}
proc test_return_simple {} {
global mi_gdb_prompt
@@ -87,7 +60,12 @@ proc test_return_simple {} {
}
}
-test_running_to_callee4
+mi_runto callee4
+
+mi_gdb_test "205-break-delete" \
+ "205\\^done.*" \
+ "delete all breakpoints"
+
test_return_simple
mi_gdb_exit
diff --git a/gdb/testsuite/gdb.mi/mi1-stack.exp b/gdb/testsuite/gdb.mi/mi1-stack.exp
index 45b8b83a367..b8c7cab5ce3 100644
--- a/gdb/testsuite/gdb.mi/mi1-stack.exp
+++ b/gdb/testsuite/gdb.mi/mi1-stack.exp
@@ -1,4 +1,4 @@
-# Copyright 2000 Free Software Foundation, Inc.
+# Copyright 2000, 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
@@ -46,22 +46,6 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-
-mi_gdb_test "200-break-insert callee4" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
- "break-insert operation"
-
-mi_run_cmd
-# The running part has been checked already by mi_run_cmd
-gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" {
- pass "run to callee4"
- }
- -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"}
- timeout {fail "run to callee4 (timeout 2)"}
-}
-
-
proc test_stack_frame_listing {} {
global mi_gdb_prompt
global hex
@@ -208,6 +192,7 @@ gdb_expect {
}
+mi_runto callee4
test_stack_frame_listing
test_stack_args_listing
test_stack_locals_listing
diff --git a/gdb/testsuite/gdb.mi/mi1-stepi.exp b/gdb/testsuite/gdb.mi/mi1-stepi.exp
index 56344798038..a7066370f19 100644
--- a/gdb/testsuite/gdb.mi/mi1-stepi.exp
+++ b/gdb/testsuite/gdb.mi/mi1-stepi.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -46,29 +46,6 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-proc test_running_to_main {} {
- global mi_gdb_prompt
- global hex
-
- mi_gdb_test "200-break-insert main" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
- "break-insert operation"
-
- mi_run_cmd
-
- gdb_expect {
- -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
- pass "run to main"
- }
- -re ".*$mi_gdb_prompt$" {
- fail "run to main (2)"
- }
- timeout {
- fail "run to main (timeout)"
- }
- }
-}
-
proc test_stepi_nexti {} {
global mi_gdb_prompt
global hex
@@ -102,7 +79,7 @@ proc test_stepi_nexti {} {
}
}
-test_running_to_main
+mi_run_to_main
test_stepi_nexti
mi_gdb_exit
diff --git a/gdb/testsuite/gdb.mi/mi1-var-block.exp b/gdb/testsuite/gdb.mi/mi1-var-block.exp
index 1478280334b..0ff9356ccf2 100644
--- a/gdb/testsuite/gdb.mi/mi1-var-block.exp
+++ b/gdb/testsuite/gdb.mi/mi1-var-block.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 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
@@ -42,19 +42,7 @@ mi_delete_breakpoints
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-mi_gdb_test "200-break-insert do_block_tests" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_block_tests\",file=\".*var-cmd.c\",line=\"154\",times=\"0\"\}" \
- "break-insert operation"
-
-mi_run_cmd
-# The running part has been checked already by mi_run_cmd
-gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"154\"\}\r\n$mi_gdb_prompt$" {
- pass "run to do_block_tests"
- }
- -re ".*$mi_gdb_prompt$" {fail "run to do_block_tests (2)"}
- timeout {fail "run to do_block_tests (timeout 2)"}
-}
+mi_runto do_block_tests
# Test: c_variable-3.2
# Desc: create cb and foo
@@ -67,15 +55,7 @@ mi_gdb_test "-var-create foo * foo" \
"create local variable foo"
# step to "foo = 123;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"158\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_block_tests"
- }
- timeout {
- fail "step at do_block_tests (timeout)"
- }
-}
+mi_step_to "do_block_tests" "" "var-cmd.c" "158" "step at do_block_test"
# Be paranoid and assume 3.2 created foo
@@ -91,15 +71,7 @@ mi_gdb_test "-var-create foo * foo" \
"create local variable foo"
# step to "foo2 = 123;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"161\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_block_tests"
- }
- timeout {
- fail "step at do_block_tests (timeout)"
- }
-}
+mi_step_to "do_block_tests" "" "var-cmd.c" "161" "step at do_block_test"
# Test: c_variable-3.4
# Desc: check foo, cb changed
@@ -108,15 +80,7 @@ mi_gdb_test "-var-update *" \
"update all vars: cb foo changed"
# step to "foo = 321;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"164\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_block_tests"
- }
- timeout {
- fail "step at do_block_tests (timeout)"
- }
-}
+mi_step_to "do_block_tests" "" "var-cmd.c" "164" "step at do_block_test"
# Test: c_variable-3.5
# Desc: create inner block foo
@@ -125,13 +89,7 @@ mi_gdb_test "-var-create inner_foo * foo" \
"create local variable inner_foo"
# step to "foo2 = 0;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"166\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_block_tests"
- }
- timeout { fail "step at do_block_tests (timeout)" }
-}
+mi_step_to "do_block_tests" "" "var-cmd.c" "166" "step at do_block_test"
# Test: c_variable-3.6
# Desc: create foo2
@@ -163,13 +121,7 @@ mi_gdb_test "-var-delete inner_foo" \
"delete var inner_foo"
# step to "foo = 0;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"168\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_block_tests"
- }
- timeout { fail "step at do_block_tests (timeout)" }
-}
+mi_step_to "do_block_tests" "" "var-cmd.c" "168" "step at do_block_test"
# Test: c_variable-3.8
# Desc: check that foo2 out of scope (known gdb problem)
@@ -180,14 +132,7 @@ mi_gdb_test "-var-update foo2" \
clear_xfail *-*-*
# step to "cb = 21;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"171\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_block_tests"
- }
- timeout { fail "step at do_block_tests (timeout)" }
-}
-
+mi_step_to "do_block_tests" "" "var-cmd.c" "171" "step at do_block_test"
# Test: c_variable-3.9
# Desc: check that only cb is in scope (known gdb problem)
diff --git a/gdb/testsuite/gdb.mi/mi1-var-cmd.exp b/gdb/testsuite/gdb.mi/mi1-var-cmd.exp
index 4ca8d16d5f8..c6a88b6bd93 100644
--- a/gdb/testsuite/gdb.mi/mi1-var-cmd.exp
+++ b/gdb/testsuite/gdb.mi/mi1-var-cmd.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 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
@@ -70,19 +70,7 @@ mi_gdb_test "113-var-create argc * argc" \
"&\"mi_cmd_var_create: unable to create variable object\\\\n\".*113\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
"create out of scope variable"
-mi_gdb_test "200-break-insert do_locals_tests" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_locals_tests\",file=\".*var-cmd.c\",line=\"106\",times=\"0\"\}" \
- "break-insert operation"
-
-mi_run_cmd
-# The running part has been checked already by mi_run_cmd
-gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"106\"\}\r\n$mi_gdb_prompt$" {
- pass "run to do_locals_tests"
- }
- -re ".*$mi_gdb_prompt$" {fail "run to do_locals_tests (2)"}
- timeout {fail "run to do_locals_tests (timeout 2)"}
-}
+mi_runto do_locals_tests
# Test: c_variable-1.4
# Desc: create local variables
@@ -288,6 +276,18 @@ mi_gdb_test "-var-assign linteger 3333" \
"\\^done,value=\"3333\"" \
"assign to linteger"
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: linteger changed after assign"
+
+mi_gdb_test "-var-assign linteger 3333" \
+ "\\^done,value=\"3333\"" \
+ "assign to linteger again, same value"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{\}" \
+ "update all vars: linteger not changed after same assign"
+
mi_gdb_test "-var-evaluate-expression linteger" \
"\\^done,value=\"3333\"" \
"eval linteger"
@@ -296,6 +296,14 @@ mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \
"\\^done,value=\"$hex\"" \
"assign to lpinteger"
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: lpinteger changed after assign"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{\}" \
+ "update all vars: no changes for second update"
+
mi_gdb_test "-var-evaluate-expression lpinteger" \
"\\^done,value=\"$hex\"" \
"eval lpinteger"
diff --git a/gdb/testsuite/gdb.mi/mi1-watch.exp b/gdb/testsuite/gdb.mi/mi1-watch.exp
index 937eb2c807c..dfb97ae59d0 100644
--- a/gdb/testsuite/gdb.mi/mi1-watch.exp
+++ b/gdb/testsuite/gdb.mi/mi1-watch.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 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
@@ -115,31 +115,6 @@ proc test_rwatch_creation_and_listing {} {
"delete read watchpoint"
}
-proc test_running_the_program {} {
- global mi_gdb_prompt
- global hex
-
- # Run the program without args, then specify srgs and rerun the program
- # Tests:
- # -exec-run
-
- mi_gdb_test "300-break-insert callee4" \
- "300\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
- "insert breakpoint at callee4"
-
- # mi_gdb_test cannot be used for asynchronous commands because there are
- # two prompts involved and this can lead to a race condition.
- # The following is equivalent to a send_gdb "000-exec-run\n"
- mi_run_cmd
- # The running part has been checked already by mi_run_cmd
- gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \
- { pass "run to callee4" }
- -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"}
- timeout {fail "run to callee4 (timeout 2)"}
- }
-}
-
proc test_watchpoint_triggering {} {
global mi_gdb_prompt
global hex
@@ -181,7 +156,7 @@ proc test_watchpoint_triggering {} {
}
}
-test_running_the_program
+mi_runto callee4
test_watchpoint_creation_and_listing
#test_rwatch_creation_and_listing
#test_awatch_creation_and_listing
diff --git a/gdb/testsuite/gdb.threads/schedlock.c b/gdb/testsuite/gdb.threads/schedlock.c
index df361d0e0a7..033131c2a52 100644
--- a/gdb/testsuite/gdb.threads/schedlock.c
+++ b/gdb/testsuite/gdb.threads/schedlock.c
@@ -7,7 +7,7 @@ void *thread_function(void *arg); /* Pointer to function executed by each thread
#define NUM 5
-int args[NUM+1];
+unsigned int args[NUM+1];
int main() {
int res;
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 0395afab890..de775b6c423 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -123,7 +123,26 @@ proc mi_gdb_start { } {
return 1;
}
gdb_expect {
- -re ".*$mi_gdb_prompt$" {
+ -re "~\"GNU.*\r\n~\".*$mi_gdb_prompt$" {
+ # We have a new format mi startup prompt. If we are
+ # running mi1, then this is an error as we should be
+ # using the old-style prompt.
+ if { $MIFLAGS == "-i=mi1" } {
+ perror "(mi startup) Got unexpected new mi prompt."
+ remote_close host;
+ return -1;
+ }
+ verbose "GDB initialized."
+ }
+ -re "\[^~\].*$mi_gdb_prompt$" {
+ # We have an old format mi startup prompt. If we are
+ # not running mi1, then this is an error as we should be
+ # using the new-style prompt.
+ if { $MIFLAGS != "-i=mi1" } {
+ perror "(mi startup) Got unexpected old mi prompt."
+ remote_close host;
+ return -1;
+ }
verbose "GDB initialized."
}
-re ".*$gdb_prompt $" {
diff --git a/gdb/thread-db.c b/gdb/thread-db.c
index d38db74b4b1..9338c57da00 100644
--- a/gdb/thread-db.c
+++ b/gdb/thread-db.c
@@ -32,6 +32,7 @@
#include "objfiles.h"
#include "target.h"
#include "regcache.h"
+#include "solib-svr4.h"
#ifndef LIBTHREAD_DB_SO
#define LIBTHREAD_DB_SO "libthread_db.so.1"
@@ -108,6 +109,11 @@ static td_err_e (*td_thr_setgregs_p) (const td_thrhandle_t *th,
prgregset_t gregs);
static td_err_e (*td_thr_event_enable_p) (const td_thrhandle_t *th, int event);
+static td_err_e (*td_thr_tls_get_addr_p) (const td_thrhandle_t *th,
+ void *map_address,
+ size_t offset,
+ void **address);
+
/* Location of the thread creation event breakpoint. The code at this
location in the child process will be called by the pthread library
whenever a new thread is created. By setting a special breakpoint
@@ -348,6 +354,7 @@ thread_db_load (void)
td_ta_set_event_p = dlsym (handle, "td_ta_set_event");
td_ta_event_getmsg_p = dlsym (handle, "td_ta_event_getmsg");
td_thr_event_enable_p = dlsym (handle, "td_thr_event_enable");
+ td_thr_tls_get_addr_p = dlsym (handle, "td_thr_tls_get_addr");
return 1;
}
@@ -829,7 +836,7 @@ thread_db_store_registers (int regno)
{
char raw[MAX_REGISTER_RAW_SIZE];
- read_register_gen (regno, raw);
+ deprecated_read_register_gen (regno, raw);
thread_db_fetch_registers (-1);
supply_register (regno, raw);
}
@@ -1003,6 +1010,97 @@ thread_db_pid_to_str (ptid_t ptid)
return normal_pid_to_str (ptid);
}
+/* Get the address of the thread local variable in OBJFILE which is
+ stored at OFFSET within the thread local storage for thread PTID. */
+
+static CORE_ADDR
+thread_db_get_thread_local_address (ptid_t ptid, struct objfile *objfile,
+ CORE_ADDR offset)
+{
+ if (is_thread (ptid))
+ {
+ int objfile_is_library = (objfile->flags & OBJF_SHARED);
+ td_err_e err;
+ td_thrhandle_t th;
+ void *address;
+ CORE_ADDR lm;
+
+ /* glibc doesn't provide the needed interface. */
+ if (! td_thr_tls_get_addr_p)
+ error ("Cannot find thread-local variables in this thread library.");
+
+ /* Get the address of the link map for this objfile. */
+ lm = svr4_fetch_objfile_link_map (objfile);
+
+ /* Whoops, we couldn't find one. Bail out. */
+ if (!lm)
+ {
+ if (objfile_is_library)
+ error ("Cannot find shared library `%s' link_map in dynamic"
+ " linker's module list", objfile->name);
+ else
+ error ("Cannot find executable file `%s' link_map in dynamic"
+ " linker's module list", objfile->name);
+ }
+
+ /* Get info about the thread. */
+ err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
+ if (err != TD_OK)
+ error ("Cannot find thread %ld: %s",
+ (long) GET_THREAD (ptid), thread_db_err_str (err));
+
+ /* Finally, get the address of the variable. */
+ err = td_thr_tls_get_addr_p (&th, (void *) lm, offset, &address);
+
+#ifdef THREAD_DB_HAS_TD_NOTALLOC
+ /* The memory hasn't been allocated, yet. */
+ if (err == TD_NOTALLOC)
+ {
+ /* Now, if libthread_db provided the initialization image's
+ address, we *could* try to build a non-lvalue value from
+ the initialization image. */
+ if (objfile_is_library)
+ error ("The inferior has not yet allocated storage for"
+ " thread-local variables in\n"
+ "the shared library `%s'\n"
+ "for the thread %ld",
+ objfile->name, (long) GET_THREAD (ptid));
+ else
+ error ("The inferior has not yet allocated storage for"
+ " thread-local variables in\n"
+ "the executable `%s'\n"
+ "for the thread %ld",
+ objfile->name, (long) GET_THREAD (ptid));
+ }
+#endif
+
+ /* Something else went wrong. */
+ if (err != TD_OK)
+ {
+ if (objfile_is_library)
+ error ("Cannot find thread-local storage for thread %ld, "
+ "shared library %s:\n%s",
+ (long) GET_THREAD (ptid),
+ objfile->name,
+ thread_db_err_str (err));
+ else
+ error ("Cannot find thread-local storage for thread %ld, "
+ "executable file %s:\n%s",
+ (long) GET_THREAD (ptid),
+ objfile->name,
+ thread_db_err_str (err));
+ }
+
+ /* Cast assuming host == target. Joy. */
+ return (CORE_ADDR) address;
+ }
+
+ if (target_beneath->to_get_thread_local_address)
+ return target_beneath->to_get_thread_local_address (ptid, objfile, offset);
+
+ error ("Cannot find thread-local values on this target.");
+}
+
static void
init_thread_db_ops (void)
{
@@ -1025,6 +1123,8 @@ init_thread_db_ops (void)
thread_db_ops.to_pid_to_str = thread_db_pid_to_str;
thread_db_ops.to_stratum = thread_stratum;
thread_db_ops.to_has_thread_control = tc_schedlock;
+ thread_db_ops.to_get_thread_local_address
+ = thread_db_get_thread_local_address;
thread_db_ops.to_magic = OPS_MAGIC;
}
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index 8fdc4bcdfc3..df138d04020 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,3 +1,25 @@
+2002-11-10 Andrew Cagney <ac131313@redhat.com>
+
+ * tuiStack.c (tuiShowFrameInfo): Replace frame_in_dummy with
+ deprecated_frame_in_dummy.
+
+2002-10-26 Stephane Carrez <stcarrez@nerim.fr>
+
+ * tuiIO.c (tui_prep_terminal): Save the prompt registered in readline.
+ (tui_redisplay_readline): Use the last saved prompt.
+ (tui_rl_saved_prompt): New.
+
+2002-10-25 Stephane Carrez <stcarrez@nerim.fr>
+
+ Fix PR gdb/787
+ * tuiWin.c (ACS_LRCORNER, ACS_LLCORNER, ACS_ULCORNER, ACS_URCORNER,
+ ACS_HLINE, ACS_VLINE): Define if they don't exist.
+
+2002-10-25 Stephane Carrez <stcarrez@nerim.fr>
+
+ Fix PR gdb/478
+ * tuiIO.c (tui_initialize_io): Use setvbuf since this is portable.
+
2002-10-02 Elena Zannoni <ezannoni@redhat.com>
* tui-hooks.c (selected_frame_level_changed_hook): Use the one
diff --git a/gdb/tui/tuiIO.c b/gdb/tui/tuiIO.c
index f70df8f4748..b9b373c6646 100644
--- a/gdb/tui/tuiIO.c
+++ b/gdb/tui/tuiIO.c
@@ -124,6 +124,10 @@ static FILE *tui_old_rl_outstream;
static int tui_readline_pipe[2];
#endif
+/* The last gdb prompt that was registered in readline.
+ This may be the main gdb prompt or a secondary prompt. */
+static char *tui_rl_saved_prompt;
+
static unsigned int _tuiHandleResizeDuringIO (unsigned int);
static void
@@ -194,7 +198,7 @@ tui_redisplay_readline (void)
if (tui_current_key_mode == tui_single_key_mode)
prompt = "";
else
- prompt = get_prompt ();
+ prompt = tui_rl_saved_prompt;
c_pos = -1;
c_line = -1;
@@ -256,10 +260,15 @@ tui_redisplay_readline (void)
}
/* Readline callback to prepare the terminal. It is called once
- each time we enter readline. There is nothing to do in curses mode. */
+ each time we enter readline. Terminal is already setup in curses mode. */
static void
tui_prep_terminal (void)
{
+ /* Save the prompt registered in readline to correctly display it.
+ (we can't use gdb_prompt() due to secondary prompts and can't use
+ rl_prompt because it points to an alloca buffer). */
+ xfree (tui_rl_saved_prompt);
+ tui_rl_saved_prompt = xstrdup (rl_prompt);
}
/* Readline callback to restore the terminal. It is called once
@@ -600,7 +609,7 @@ tui_initialize_io ()
fprintf_unfiltered (gdb_stderr, "Cannot redirect readline output");
exit (1);
}
- setlinebuf (tui_rl_outstream);
+ setvbuf (tui_rl_outstream, (char*) NULL, _IOLBF, 0);
#ifdef O_NONBLOCK
(void) fcntl (tui_readline_pipe[0], F_SETFL, O_NONBLOCK);
diff --git a/gdb/tui/tuiStack.c b/gdb/tui/tuiStack.c
index 1d3856daa5c..506cdab2a9e 100644
--- a/gdb/tui/tuiStack.c
+++ b/gdb/tui/tuiStack.c
@@ -352,7 +352,7 @@ tuiShowFrameInfo (struct frame_info *fi)
sal = find_pc_line (fi->pc,
(fi->next != (struct frame_info *) NULL &&
!fi->next->signal_handler_caller &&
- !frame_in_dummy (fi->next)));
+ !deprecated_frame_in_dummy (fi->next)));
sourceAlreadyDisplayed = sal.symtab != 0
&& tuiSourceIsDisplayed (sal.symtab->filename);
diff --git a/gdb/tui/tuiWin.c b/gdb/tui/tuiWin.c
index 38283b59da1..484c60a6204 100644
--- a/gdb/tui/tuiWin.c
+++ b/gdb/tui/tuiWin.c
@@ -96,6 +96,25 @@ static void _parseScrollingArgs (char *, TuiWinInfoPtr *, int *);
** PUBLIC FUNCTIONS
***************************************/
+#ifndef ACS_LRCORNER
+# define ACS_LRCORNER '+'
+#endif
+#ifndef ACS_LLCORNER
+# define ACS_LLCORNER '+'
+#endif
+#ifndef ACS_ULCORNER
+# define ACS_ULCORNER '+'
+#endif
+#ifndef ACS_URCORNER
+# define ACS_URCORNER '+'
+#endif
+#ifndef ACS_HLINE
+# define ACS_HLINE '-'
+#endif
+#ifndef ACS_VLINE
+# define ACS_VLINE '|'
+#endif
+
/* Possible values for tui-border-kind variable. */
static const char *tui_border_kind_enums[] = {
"space",
diff --git a/gdb/utils.c b/gdb/utils.c
index 9aab625f63c..06fb5938d5b 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -153,13 +153,13 @@ int quit_flag;
int immediate_quit;
-/* Nonzero means that encoded C++ names should be printed out in their
- C++ form rather than raw. */
+/* Nonzero means that encoded C++/ObjC names should be printed out in their
+ C++/ObjC form rather than raw. */
int demangle = 1;
-/* Nonzero means that encoded C++ names should be printed out in their
- C++ form even in assembler language displays. If this is set, but
+/* Nonzero means that encoded C++/ObjC names should be printed out in their
+ C++/ObjC form even in assembler language displays. If this is set, but
DEMANGLE is zero, names are printed raw, i.e. DEMANGLE controls. */
int asm_demangle = 0;
@@ -1817,6 +1817,51 @@ wrap_here (char *indent)
}
}
+/* Print input string to gdb_stdout, filtered, with wrap,
+ arranging strings in columns of n chars. String can be
+ right or left justified in the column. Never prints
+ trailing spaces. String should never be longer than
+ width. FIXME: this could be useful for the EXAMINE
+ command, which currently doesn't tabulate very well */
+
+void
+puts_filtered_tabular (char *string, int width, int right)
+{
+ int spaces = 0;
+ int stringlen;
+ char *spacebuf;
+
+ gdb_assert (chars_per_line > 0);
+ if (chars_per_line == UINT_MAX)
+ {
+ fputs_filtered (string, gdb_stdout);
+ fputs_filtered ("\n", gdb_stdout);
+ return;
+ }
+
+ if (((chars_printed - 1) / width + 2) * width >= chars_per_line)
+ fputs_filtered ("\n", gdb_stdout);
+
+ if (width >= chars_per_line)
+ width = chars_per_line - 1;
+
+ stringlen = strlen (string);
+
+ if (chars_printed > 0)
+ spaces = width - (chars_printed - 1) % width - 1;
+ if (right)
+ spaces += width - stringlen;
+
+ spacebuf = alloca (spaces + 1);
+ spacebuf[spaces] = '\0';
+ while (spaces--)
+ spacebuf[spaces] = ' ';
+
+ fputs_filtered (spacebuf, gdb_stdout);
+ fputs_filtered (string, gdb_stdout);
+}
+
+
/* Ensure that whatever gets printed next, using the filtered output
commands, starts at the beginning of the line. I.E. if there is
any pending output for the current line, flush it and start a new
@@ -2244,7 +2289,7 @@ print_spaces_filtered (int n, struct ui_file *stream)
fputs_filtered (n_spaces (n), stream);
}
-/* C++ demangler stuff. */
+/* C++/ObjC demangler stuff. */
/* fprintf_symbol_filtered attempts to demangle NAME, a symbol in language
LANG, using demangling args ARG_MODE, and print it filtered to STREAM.
@@ -2274,6 +2319,10 @@ fprintf_symbol_filtered (struct ui_file *stream, char *name, enum language lang,
case language_java:
demangled = cplus_demangle (name, arg_mode | DMGL_JAVA);
break;
+ case language_objc:
+ /* Commented out until ObjC handling is enabled. */
+ /*demangled = objc_demangle (name);*/
+ /*break;*/
#if 0
/* OBSOLETE case language_chill: */
/* OBSOLETE demangled = chill_demangle (name); */
@@ -2393,7 +2442,7 @@ initialize_utils (void)
add_show_from_set
(add_set_cmd ("demangle", class_support, var_boolean,
(char *) &demangle,
- "Set demangling of encoded C++ names when displaying symbols.",
+ "Set demangling of encoded C++/ObjC names when displaying symbols.",
&setprintlist),
&showprintlist);
@@ -2421,7 +2470,7 @@ initialize_utils (void)
add_show_from_set
(add_set_cmd ("asm-demangle", class_support, var_boolean,
(char *) &asm_demangle,
- "Set demangling of C++ names in disassembly listings.",
+ "Set demangling of C++/ObjC names in disassembly listings.",
&setprintlist),
&showprintlist);
}
@@ -2655,31 +2704,73 @@ string_to_core_addr (const char *my_string)
char *
gdb_realpath (const char *filename)
{
+ /* Method 1: The system has a compile time upper bound on a filename
+ path. Use that and realpath() to canonicalize the name. This is
+ the most common case. Note that, if there isn't a compile time
+ upper bound, you want to avoid realpath() at all costs. */
#if defined(HAVE_REALPATH)
+ {
# if defined (PATH_MAX)
- char buf[PATH_MAX];
+ char buf[PATH_MAX];
# define USE_REALPATH
# elif defined (MAXPATHLEN)
- char buf[MAXPATHLEN];
-# define USE_REALPATH
-# elif defined (HAVE_UNISTD_H) && defined(HAVE_ALLOCA)
- char *buf = alloca ((size_t)pathconf ("/", _PC_PATH_MAX));
+ char buf[MAXPATHLEN];
# define USE_REALPATH
# endif
+# if defined (USE_REALPATH)
+ const char *rp = realpath (filename, buf);
+ if (rp == NULL)
+ rp = filename;
+ return xstrdup (rp);
+ }
+# endif
#endif /* HAVE_REALPATH */
-#if defined(USE_REALPATH)
- char *rp = realpath (filename, buf);
- return xstrdup (rp ? rp : filename);
-#elif defined(HAVE_CANONICALIZE_FILE_NAME)
- char *rp = canonicalize_file_name (filename);
- if (rp == NULL)
- return xstrdup (filename);
- else
- return rp;
-#else
- return xstrdup (filename);
+ /* Method 2: The host system (i.e., GNU) has the function
+ canonicalize_file_name() which malloc's a chunk of memory and
+ returns that, use that. */
+#if defined(HAVE_CANONICALIZE_FILE_NAME)
+ {
+ char *rp = canonicalize_file_name (filename);
+ if (rp == NULL)
+ return xstrdup (filename);
+ else
+ return rp;
+ }
#endif
+
+ /* FIXME: cagney/2002-11-13:
+
+ Method 2a: Use realpath() with a NULL buffer. Some systems, due
+ to the problems described in in method 3, have modified their
+ realpath() implementation so that it will allocate a buffer when
+ NULL is passed in. Before this can be used, though, some sort of
+ configure time test would need to be added. Otherwize the code
+ will likely core dump. */
+
+ /* Method 3: Now we're getting desperate! The system doesn't have a
+ compile time buffer size and no alternative function. Query the
+ OS, using pathconf(), for the buffer limit. Care is needed
+ though, some systems do not limit PATH_MAX (return -1 for
+ pathconf()) making it impossible to pass a correctly sized buffer
+ to realpath() (it could always overflow). On those systems, we
+ skip this. */
+#if defined (HAVE_REALPATH) && defined (HAVE_UNISTD_H) && defined(HAVE_ALLOCA)
+ {
+ /* Find out the max path size. */
+ long path_max = pathconf ("/", _PC_PATH_MAX);
+ if (path_max > 0)
+ {
+ /* PATH_MAX is bounded. */
+ char *buf = alloca (path_max);
+ char *rp = realpath (filename, buf);
+ return xstrdup (rp ? rp : filename);
+ }
+ }
+#endif
+
+ /* This system is a lost cause, just dup the buffer. */
+ return xstrdup (filename);
}
/* Return a copy of FILENAME, with its directory prefix canonicalized
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 6aea8866413..eae7db6958a 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -1089,8 +1089,8 @@ v850_store_return_value (struct type *type, char *valbuf)
CORE_ADDR return_buffer;
if (!v850_use_struct_convention (0, type))
- write_register_bytes (REGISTER_BYTE (E_V0_REGNUM), valbuf,
- TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (E_V0_REGNUM), valbuf,
+ TYPE_LENGTH (type));
else
{
return_buffer = read_register (E_V0_REGNUM);
diff --git a/gdb/v850ice.c b/gdb/v850ice.c
index 958eac331b8..2e68cff14a2 100644
--- a/gdb/v850ice.c
+++ b/gdb/v850ice.c
@@ -560,7 +560,7 @@ v850ice_store_registers (int regno)
return;
}
- regval = extract_unsigned_integer (&registers[REGISTER_BYTE (regno)],
+ regval = extract_unsigned_integer (&deprecated_registers[REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
strcpy (cmd, "reg ");
if (!convert_register (regno, &cmd[4]))
@@ -897,14 +897,9 @@ init_850ice_ops (void)
v850ice_ops.to_doc = "Debug a system controlled by a NEC 850 ICE.";
v850ice_ops.to_open = v850ice_open;
v850ice_ops.to_close = v850ice_close;
- v850ice_ops.to_attach = NULL;
- v850ice_ops.to_post_attach = NULL;
- v850ice_ops.to_require_attach = NULL;
v850ice_ops.to_detach = v850ice_detach;
- v850ice_ops.to_require_detach = NULL;
v850ice_ops.to_resume = v850ice_resume;
v850ice_ops.to_wait = v850ice_wait;
- v850ice_ops.to_post_wait = NULL;
v850ice_ops.to_fetch_registers = v850ice_fetch_registers;
v850ice_ops.to_store_registers = v850ice_store_registers;
v850ice_ops.to_prepare_to_store = v850ice_prepare_to_store;
@@ -912,30 +907,16 @@ init_850ice_ops (void)
v850ice_ops.to_files_info = v850ice_files_info;
v850ice_ops.to_insert_breakpoint = v850ice_insert_breakpoint;
v850ice_ops.to_remove_breakpoint = v850ice_remove_breakpoint;
- v850ice_ops.to_terminal_init = NULL;
- v850ice_ops.to_terminal_inferior = NULL;
- v850ice_ops.to_terminal_ours_for_output = NULL;
- v850ice_ops.to_terminal_ours = NULL;
- v850ice_ops.to_terminal_info = NULL;
v850ice_ops.to_kill = v850ice_kill;
v850ice_ops.to_load = v850ice_load;
- v850ice_ops.to_lookup_symbol = NULL;
- v850ice_ops.to_create_inferior = NULL;
v850ice_ops.to_mourn_inferior = v850ice_mourn;
- v850ice_ops.to_can_run = 0;
- v850ice_ops.to_notice_signals = 0;
- v850ice_ops.to_thread_alive = NULL;
v850ice_ops.to_stop = v850ice_stop;
- v850ice_ops.to_pid_to_exec_file = NULL;
v850ice_ops.to_stratum = process_stratum;
- v850ice_ops.DONT_USE = NULL;
v850ice_ops.to_has_all_memory = 1;
v850ice_ops.to_has_memory = 1;
v850ice_ops.to_has_stack = 1;
v850ice_ops.to_has_registers = 1;
v850ice_ops.to_has_execution = 1;
- v850ice_ops.to_sections = NULL;
- v850ice_ops.to_sections_end = NULL;
v850ice_ops.to_magic = OPS_MAGIC;
}
diff --git a/gdb/valops.c b/gdb/valops.c
index eaf42953108..2249e8a15d7 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -630,132 +630,120 @@ value_assign (struct value *toval, struct value *fromval)
}
break;
- case lval_register:
- if (VALUE_BITSIZE (toval))
- {
- char buffer[sizeof (LONGEST)];
- int len =
- REGISTER_RAW_SIZE (VALUE_REGNO (toval)) - VALUE_OFFSET (toval);
-
- if (len > (int) sizeof (LONGEST))
- error ("Can't handle bitfields in registers larger than %d bits.",
- (int) sizeof (LONGEST) * HOST_CHAR_BIT);
-
- if (VALUE_BITPOS (toval) + VALUE_BITSIZE (toval)
- > len * HOST_CHAR_BIT)
- /* Getting this right would involve being very careful about
- byte order. */
- error ("Can't assign to bitfields that cross register "
- "boundaries.");
-
- read_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
- buffer, len);
- modify_field (buffer, value_as_long (fromval),
- VALUE_BITPOS (toval), VALUE_BITSIZE (toval));
- write_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
- buffer, len);
- }
- else if (use_buffer)
- write_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
- raw_buffer, use_buffer);
- else
- {
- /* Do any conversion necessary when storing this type to more
- than one register. */
-#ifdef REGISTER_CONVERT_FROM_TYPE
- memcpy (raw_buffer, VALUE_CONTENTS (fromval), TYPE_LENGTH (type));
- REGISTER_CONVERT_FROM_TYPE (VALUE_REGNO (toval), type, raw_buffer);
- write_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
- raw_buffer, TYPE_LENGTH (type));
-#else
- write_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
- VALUE_CONTENTS (fromval), TYPE_LENGTH (type));
-#endif
- }
-
- target_changed_event ();
-
- /* Assigning to the stack pointer, frame pointer, and other
- (architecture and calling convention specific) registers may
- cause the frame cache to be out of date. We just do this
- on all assignments to registers for simplicity; I doubt the slowdown
- matters. */
- reinit_frame_cache ();
- break;
-
case lval_reg_frame_relative:
+ case lval_register:
{
+ struct frame_id old_frame;
/* value is stored in a series of registers in the frame
specified by the structure. Copy that value out, modify
it, and copy it back in. */
- int amount_to_copy = (VALUE_BITSIZE (toval) ? 1 : TYPE_LENGTH (type));
- int reg_size = REGISTER_RAW_SIZE (VALUE_FRAME_REGNUM (toval));
- int byte_offset = VALUE_OFFSET (toval) % reg_size;
- int reg_offset = VALUE_OFFSET (toval) / reg_size;
int amount_copied;
-
- /* Make the buffer large enough in all cases. */
- /* FIXME (alloca): Not safe for very large data types. */
- char *buffer = (char *) alloca (amount_to_copy
- + sizeof (LONGEST)
- + MAX_REGISTER_RAW_SIZE);
-
+ int amount_to_copy;
+ char *buffer;
+ int value_reg;
+ int reg_offset;
+ int byte_offset;
int regno;
struct frame_info *frame;
+ /* Since modifying a register can trash the frame chain, we
+ save the old frame and then restore the new frame
+ afterwards. */
+ get_frame_id (selected_frame, &old_frame);
+
/* Figure out which frame this is in currently. */
- for (frame = get_current_frame ();
- frame && FRAME_FP (frame) != VALUE_FRAME (toval);
- frame = get_prev_frame (frame))
- ;
+ if (VALUE_LVAL (toval) == lval_register)
+ {
+ frame = get_current_frame ();
+ value_reg = VALUE_REGNO (toval);
+ }
+ else
+ {
+ for (frame = get_current_frame ();
+ frame && FRAME_FP (frame) != VALUE_FRAME (toval);
+ frame = get_prev_frame (frame))
+ ;
+ value_reg = VALUE_FRAME_REGNUM (toval);
+ }
if (!frame)
error ("Value being assigned to is no longer active.");
- amount_to_copy += (reg_size - amount_to_copy % reg_size);
+ /* Locate the first register that falls in the value that
+ needs to be transfered. Compute the offset of the value in
+ that register. */
+ {
+ int offset;
+ for (reg_offset = value_reg, offset = 0;
+ offset + REGISTER_RAW_SIZE (reg_offset) <= VALUE_OFFSET (toval);
+ reg_offset++);
+ byte_offset = VALUE_OFFSET (toval) - offset;
+ }
- /* Copy it out. */
- for ((regno = VALUE_FRAME_REGNUM (toval) + reg_offset,
- amount_copied = 0);
+ /* Compute the number of register aligned values that need to
+ be copied. */
+ if (VALUE_BITSIZE (toval))
+ amount_to_copy = byte_offset + 1;
+ else
+ amount_to_copy = byte_offset + TYPE_LENGTH (type);
+
+ /* And a bounce buffer. Be slightly over generous. */
+ buffer = (char *) alloca (amount_to_copy
+ + MAX_REGISTER_RAW_SIZE);
+
+ /* Copy it in. */
+ for (regno = reg_offset, amount_copied = 0;
amount_copied < amount_to_copy;
- amount_copied += reg_size, regno++)
+ amount_copied += REGISTER_RAW_SIZE (regno), regno++)
{
- get_saved_register (buffer + amount_copied,
- (int *) NULL, (CORE_ADDR *) NULL,
- frame, regno, (enum lval_type *) NULL);
+ frame_register_read (frame, regno, buffer + amount_copied);
}
-
+
/* Modify what needs to be modified. */
if (VALUE_BITSIZE (toval))
- modify_field (buffer + byte_offset,
- value_as_long (fromval),
- VALUE_BITPOS (toval), VALUE_BITSIZE (toval));
+ {
+ modify_field (buffer + byte_offset,
+ value_as_long (fromval),
+ VALUE_BITPOS (toval), VALUE_BITSIZE (toval));
+ }
else if (use_buffer)
- memcpy (buffer + byte_offset, raw_buffer, use_buffer);
+ {
+ memcpy (buffer + VALUE_OFFSET (toval), raw_buffer, use_buffer);
+ }
else
- memcpy (buffer + byte_offset, VALUE_CONTENTS (fromval),
- TYPE_LENGTH (type));
+ {
+ memcpy (buffer + byte_offset, VALUE_CONTENTS (fromval),
+ TYPE_LENGTH (type));
+ /* Do any conversion necessary when storing this type to
+ more than one register. */
+#ifdef REGISTER_CONVERT_FROM_TYPE
+ REGISTER_CONVERT_FROM_TYPE (value_reg, type,
+ (buffer + byte_offset));
+#endif
+ }
- /* Copy it back. */
- for ((regno = VALUE_FRAME_REGNUM (toval) + reg_offset,
- amount_copied = 0);
+ /* Copy it out. */
+ for (regno = reg_offset, amount_copied = 0;
amount_copied < amount_to_copy;
- amount_copied += reg_size, regno++)
+ amount_copied += REGISTER_RAW_SIZE (regno), regno++)
{
enum lval_type lval;
CORE_ADDR addr;
int optim;
-
+ int realnum;
+
/* Just find out where to put it. */
- get_saved_register ((char *) NULL,
- &optim, &addr, frame, regno, &lval);
-
+ frame_register (frame, regno, &optim, &lval, &addr, &realnum,
+ NULL);
+
if (optim)
error ("Attempt to assign to a value that was optimized out.");
if (lval == lval_memory)
- write_memory (addr, buffer + amount_copied, reg_size);
+ write_memory (addr, buffer + amount_copied,
+ REGISTER_RAW_SIZE (regno));
else if (lval == lval_register)
- write_register_bytes (addr, buffer + amount_copied, reg_size);
+ regcache_cooked_write (current_regcache, realnum,
+ (buffer + amount_copied));
else
error ("Attempt to assign to an unmodifiable value.");
}
@@ -763,10 +751,31 @@ value_assign (struct value *toval, struct value *fromval)
if (register_changed_hook)
register_changed_hook (-1);
target_changed_event ();
+
+ /* Assigning to the stack pointer, frame pointer, and other
+ (architecture and calling convention specific) registers
+ may cause the frame cache to be out of date. We just do
+ this on all assignments to registers for simplicity; I
+ doubt the slowdown matters. */
+ reinit_frame_cache ();
+
+ /* Having destoroyed the frame cache, restore the selected
+ frame. */
+ /* FIXME: cagney/2002-11-02: There has to be a better way of
+ doing this. Instead of constantly saving/restoring the
+ frame. Why not create a get_selected_frame() function
+ that, having saved the selected frame's ID can
+ automatically re-find the previously selected frame
+ automatically. */
+ {
+ struct frame_info *fi = frame_find_by_id (old_frame);
+ if (fi != NULL)
+ select_frame (fi);
+ }
}
break;
-
-
+
+
default:
error ("Left operand of assignment is not an lvalue.");
}
@@ -3306,18 +3315,17 @@ value_full_object (struct value *argp, struct type *rtype, int xfull, int xtop,
-/* C++: return the value of the class instance variable, if one exists.
+/* Return the value of the local variable, if one exists.
Flag COMPLAIN signals an error if the request is made in an
inappropriate context. */
struct value *
-value_of_this (int complain)
+value_of_local (const char *name, int complain)
{
struct symbol *func, *sym;
struct block *b;
int i;
- static const char funny_this[] = "this";
- struct value *this;
+ struct value * ret;
if (selected_frame == 0)
{
@@ -3331,7 +3339,7 @@ value_of_this (int complain)
if (!func)
{
if (complain)
- error ("no `this' in nameless context");
+ error ("no `%s' in nameless context", name);
else
return 0;
}
@@ -3341,26 +3349,39 @@ value_of_this (int complain)
if (i <= 0)
{
if (complain)
- error ("no args, no `this'");
+ error ("no args, no `%s'", name);
else
return 0;
}
/* Calling lookup_block_symbol is necessary to get the LOC_REGISTER
symbol instead of the LOC_ARG one (if both exist). */
- sym = lookup_block_symbol (b, funny_this, NULL, VAR_NAMESPACE);
+ sym = lookup_block_symbol (b, name, NULL, VAR_NAMESPACE);
if (sym == NULL)
{
if (complain)
- error ("current stack frame not in method");
+ error ("current stack frame does not contain a variable named `%s'", name);
else
return NULL;
}
- this = read_var_value (sym, selected_frame);
- if (this == 0 && complain)
- error ("`this' argument at unknown address");
- return this;
+ ret = read_var_value (sym, selected_frame);
+ if (ret == 0 && complain)
+ error ("`%s' argument unreadable", name);
+ return ret;
+}
+
+/* C++/Objective-C: return the value of the class instance variable,
+ if one exists. Flag COMPLAIN signals an error if the request is
+ made in an inappropriate context. */
+
+struct value *
+value_of_this (int complain)
+{
+ if (current_language->la_language == language_objc)
+ return value_of_local ("self", complain);
+ else
+ return value_of_local ("this", complain);
}
/* Create a slice (sub-string, sub-array) of ARRAY, that is LENGTH elements
diff --git a/gdb/value.h b/gdb/value.h
index efabecb8806..a38b576947b 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -566,4 +566,6 @@ extern CORE_ADDR default_push_arguments (int nargs, struct value ** args,
CORE_ADDR sp, int struct_return,
CORE_ADDR struct_addr);
+extern struct value *value_of_local (const char *name, int complain);
+
#endif /* !defined (VALUE_H) */
diff --git a/gdb/values.c b/gdb/values.c
index c943f28fa46..950dee68e99 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -862,7 +862,9 @@ value_change_enclosing_type (struct value *val, struct type *new_encl_type)
struct value *prev;
new_val = (struct value *) xrealloc (val, sizeof (struct value) + TYPE_LENGTH (new_encl_type));
-
+
+ VALUE_ENCLOSING_TYPE (new_val) = new_encl_type;
+
/* We have to make sure this ends up in the same place in the value
chain as the original copy, so it's clean-up behavior is the same.
If the value has been released, this is a waste of time, but there
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 16ba528afe6..cd15f7c5c26 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -111,6 +111,9 @@ struct varobj
/* The format of the output for this object */
enum varobj_display_formats format;
+
+ /* Was this variable updated via a varobj_set_value operation */
+ int updated;
};
/* Every variable keeps a linked list of its children, described
@@ -753,6 +756,7 @@ int
varobj_set_value (struct varobj *var, char *expression)
{
struct value *val;
+ int error;
int offset = 0;
/* The argument "expression" contains the variable's new value.
@@ -778,6 +782,8 @@ varobj_set_value (struct varobj *var, char *expression)
return 0;
}
+ if (!my_value_equal (var->value, value, &error))
+ var->updated = 1;
if (!gdb_value_assign (var->value, value, &val))
return 0;
value_free (var->value);
@@ -893,10 +899,11 @@ varobj_update (struct varobj **varp, struct varobj ***changelist)
/* If values are not equal, note that it's changed.
There a couple of exceptions here, though.
We don't want some types to be reported as "changed". */
- else if (type_changeable (*varp)
- && !my_value_equal ((*varp)->value, new, &error2))
+ else if (type_changeable (*varp) &&
+ ((*varp)->updated || !my_value_equal ((*varp)->value, new, &error2)))
{
vpush (&result, *varp);
+ (*varp)->updated = 0;
changed++;
/* error2 replaces var->error since this new value
WILL replace the old one. */
@@ -933,10 +940,12 @@ varobj_update (struct varobj **varp, struct varobj ***changelist)
/* Update this variable */
new = value_of_child (v->parent, v->index);
- if (type_changeable (v) && !my_value_equal (v->value, new, &error2))
+ if (type_changeable (v) &&
+ (v->updated || !my_value_equal (v->value, new, &error2)))
{
/* Note that it's changed */
vpush (&result, v);
+ v->updated = 0;
changed++;
}
/* error2 replaces v->error since this new value
@@ -1194,7 +1203,7 @@ child_exists (struct varobj *var, char *name)
for (vc = var->children; vc != NULL; vc = vc->next)
{
- if (STREQ (vc->child->name, name))
+ if (strcmp (vc->child->name, name) == 0)
return vc->child;
}
@@ -1294,6 +1303,7 @@ new_variable (void)
var->children = NULL;
var->format = 0;
var->root = NULL;
+ var->updated = 0;
return var;
}
@@ -2113,9 +2123,9 @@ cplus_number_of_children (struct varobj *var)
type = get_type_deref (var->parent);
cplus_class_num_children (type, kids);
- if (STREQ (var->name, "public"))
+ if (strcmp (var->name, "public") == 0)
children = kids[v_public];
- else if (STREQ (var->name, "private"))
+ else if (strcmp (var->name, "private") == 0)
children = kids[v_private];
else
children = kids[v_protected];
@@ -2166,7 +2176,6 @@ cplus_name_of_child (struct varobj *parent, int index)
{
char *name;
struct type *type;
- int children[3];
if (CPLUS_FAKE_CHILD (parent))
{
@@ -2181,55 +2190,97 @@ cplus_name_of_child (struct varobj *parent, int index)
{
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
- cplus_class_num_children (type, children);
-
if (CPLUS_FAKE_CHILD (parent))
{
- int i;
-
- /* Skip over vptr, if it exists. */
- if (TYPE_VPTR_BASETYPE (type) == type
- && index >= TYPE_VPTR_FIELDNO (type))
- index++;
-
- /* FIXME: This assumes that type orders
- inherited, public, private, protected */
- i = index + TYPE_N_BASECLASSES (type);
- if (STREQ (parent->name, "private")
- || STREQ (parent->name, "protected"))
- i += children[v_public];
- if (STREQ (parent->name, "protected"))
- i += children[v_private];
-
- name = TYPE_FIELD_NAME (type, i);
+ /* The fields of the class type are ordered as they
+ appear in the class. We are given an index for a
+ particular access control type ("public","protected",
+ or "private"). We must skip over fields that don't
+ have the access control we are looking for to properly
+ find the indexed field. */
+ int type_index = TYPE_N_BASECLASSES (type);
+ if (strcmp (parent->name, "private") == 0)
+ {
+ while (index >= 0)
+ {
+ if (TYPE_VPTR_BASETYPE (type) == type
+ && type_index == TYPE_VPTR_FIELDNO (type))
+ ; /* ignore vptr */
+ else if (TYPE_FIELD_PRIVATE (type, type_index))
+ --index;
+ ++type_index;
+ }
+ --type_index;
+ }
+ else if (strcmp (parent->name, "protected") == 0)
+ {
+ while (index >= 0)
+ {
+ if (TYPE_VPTR_BASETYPE (type) == type
+ && type_index == TYPE_VPTR_FIELDNO (type))
+ ; /* ignore vptr */
+ else if (TYPE_FIELD_PROTECTED (type, type_index))
+ --index;
+ ++type_index;
+ }
+ --type_index;
+ }
+ else
+ {
+ while (index >= 0)
+ {
+ if (TYPE_VPTR_BASETYPE (type) == type
+ && type_index == TYPE_VPTR_FIELDNO (type))
+ ; /* ignore vptr */
+ else if (!TYPE_FIELD_PRIVATE (type, type_index) &&
+ !TYPE_FIELD_PROTECTED (type, type_index))
+ --index;
+ ++type_index;
+ }
+ --type_index;
+ }
+
+ name = TYPE_FIELD_NAME (type, type_index);
}
else if (index < TYPE_N_BASECLASSES (type))
+ /* We are looking up the name of a base class */
name = TYPE_FIELD_NAME (type, index);
else
{
+ int children[3];
+ cplus_class_num_children(type, children);
+
/* Everything beyond the baseclasses can
- only be "public", "private", or "protected" */
+ only be "public", "private", or "protected"
+
+ The special "fake" children are always output by varobj in
+ this order. So if INDEX == 2, it MUST be "protected". */
index -= TYPE_N_BASECLASSES (type);
switch (index)
{
case 0:
- if (children[v_public] != 0)
- {
- name = "public";
- break;
- }
+ if (children[v_public] > 0)
+ name = "public";
+ else if (children[v_private] > 0)
+ name = "private";
+ else
+ name = "protected";
+ break;
case 1:
- if (children[v_private] != 0)
+ if (children[v_public] > 0)
{
- name = "private";
- break;
+ if (children[v_private] > 0)
+ name = "private";
+ else
+ name = "protected";
}
+ else if (children[v_private] > 0)
+ name = "protected";
+ break;
case 2:
- if (children[v_protected] != 0)
- {
- name = "protected";
- break;
- }
+ /* Must be protected */
+ name = "protected";
+ break;
default:
/* error! */
break;
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index 2f517edb379..e82227fe5e2 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -298,7 +298,7 @@ vax_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
static void
vax_store_return_value (struct type *valtype, char *valbuf)
{
- write_register_bytes (0, valbuf, TYPE_LENGTH (valtype));
+ deprecated_write_register_bytes (0, valbuf, TYPE_LENGTH (valtype));
}
static CORE_ADDR
diff --git a/gdb/version.in b/gdb/version.in
index a00b4a329c1..5d8bf3d1df7 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-2002-10-04-cvs
+2002-11-15-cvs
diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c
index e2a85e138dc..93bd10897f2 100644
--- a/gdb/win32-nat.c
+++ b/gdb/win32-nat.c
@@ -383,7 +383,7 @@ static void
do_child_store_inferior_registers (int r)
{
if (r >= 0)
- read_register_gen (r, ((char *) &current_thread->context) + mappings[r]);
+ deprecated_read_register_gen (r, ((char *) &current_thread->context) + mappings[r]);
else
{
for (r = 0; r < NUM_REGS; r++)
@@ -1828,24 +1828,18 @@ init_child_ops (void)
child_ops.to_terminal_save_ours = terminal_save_ours;
child_ops.to_terminal_info = child_terminal_info;
child_ops.to_kill = child_kill_inferior;
- child_ops.to_load = 0;
- child_ops.to_lookup_symbol = 0;
child_ops.to_create_inferior = child_create_inferior;
child_ops.to_mourn_inferior = child_mourn_inferior;
child_ops.to_can_run = child_can_run;
- child_ops.to_notice_signals = 0;
child_ops.to_thread_alive = win32_child_thread_alive;
child_ops.to_pid_to_str = cygwin_pid_to_str;
child_ops.to_stop = child_stop;
child_ops.to_stratum = process_stratum;
- child_ops.DONT_USE = 0;
child_ops.to_has_all_memory = 1;
child_ops.to_has_memory = 1;
child_ops.to_has_stack = 1;
child_ops.to_has_registers = 1;
child_ops.to_has_execution = 1;
- child_ops.to_sections = 0;
- child_ops.to_sections_end = 0;
child_ops.to_magic = OPS_MAGIC;
}
diff --git a/gdb/wince.c b/gdb/wince.c
index 92c115820b4..322564e015e 100644
--- a/gdb/wince.c
+++ b/gdb/wince.c
@@ -1139,7 +1139,7 @@ static void
do_child_store_inferior_registers (int r)
{
if (r >= 0)
- read_register_gen (r, ((char *) &current_thread->context) + mappings[r]);
+ deprecated_read_register_gen (r, ((char *) &current_thread->context) + mappings[r]);
else
{
for (r = 0; r < NUM_REGS; r++)
@@ -1924,8 +1924,6 @@ init_child_ops (void)
child_ops.to_has_stack = 1;
child_ops.to_has_registers = 1;
child_ops.to_has_execution = 1;
- child_ops.to_sections = 0;
- child_ops.to_sections_end = 0;
child_ops.to_magic = OPS_MAGIC;
}
diff --git a/gdb/x86-64-linux-nat.c b/gdb/x86-64-linux-nat.c
index 7e6417b1cc9..78e9c495af6 100644
--- a/gdb/x86-64-linux-nat.c
+++ b/gdb/x86-64-linux-nat.c
@@ -158,7 +158,7 @@ fill_gregset (elf_gregset_t * gregsetp, int regno)
for (i = 0; i < x86_64_num_gregs; i++)
if ((regno == -1 || regno == i))
- read_register_gen (i, (char *) (regp + x86_64_regmap[i]));
+ deprecated_read_register_gen (i, (char *) (regp + x86_64_regmap[i]));
}
/* Fetch all general-purpose registers from process/thread TID and
diff --git a/gdb/x86-64-linux-tdep.c b/gdb/x86-64-linux-tdep.c
index ac41daa8849..b8385a6c756 100644
--- a/gdb/x86-64-linux-tdep.c
+++ b/gdb/x86-64-linux-tdep.c
@@ -35,8 +35,10 @@
#define LINUX_SIGTRAMP_OFFSET1 (7)
static const unsigned char linux_sigtramp_code[] = {
- LINUX_SIGTRAMP_INSN0, 0xc7, 0xc0, 0x89, 0x00, 0x00, 0x00, /* mov $0x89,%rax */
- LINUX_SIGTRAMP_INSN1, 0x05 /* syscall */
+ /* mov $__NR_rt_sigreturn,%rax */
+ LINUX_SIGTRAMP_INSN0, 0xc7, 0xc0, 0x0f, 0x00, 0x00, 0x00,
+ /* syscall */
+ LINUX_SIGTRAMP_INSN1, 0x05
};
#define LINUX_SIGTRAMP_LEN (sizeof linux_sigtramp_code)
@@ -68,17 +70,22 @@ x86_64_linux_sigtramp_start (CORE_ADDR pc)
return pc;
}
-#define LINUX_SIGINFO_SIZE 128
+#define LINUX_SIGINFO_SIZE 0
/* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>. */
-#define LINUX_UCONTEXT_SIGCONTEXT_OFFSET (36)
+#define LINUX_UCONTEXT_SIGCONTEXT_OFFSET 40
+
+/* Offset to saved PC in sigcontext, from <asm/sigcontext.h>. */
+#define LINUX_SIGCONTEXT_PC_OFFSET 128
+#define LINUX_SIGCONTEXT_FP_OFFSET 120
/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
address of the associated sigcontext structure. */
-CORE_ADDR
+static CORE_ADDR
x86_64_linux_sigcontext_addr (struct frame_info *frame)
{
CORE_ADDR pc;
+ ULONGEST rsp;
pc = x86_64_linux_sigtramp_start (frame->pc);
if (pc)
@@ -92,8 +99,8 @@ x86_64_linux_sigcontext_addr (struct frame_info *frame)
/* This is the top frame. */
- return read_register (SP_REGNUM) + LINUX_SIGINFO_SIZE +
- LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
+ rsp = read_register (SP_REGNUM);
+ return rsp + LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
}
@@ -101,13 +108,10 @@ x86_64_linux_sigcontext_addr (struct frame_info *frame)
return 0;
}
-/* Offset to saved PC in sigcontext, from <asm/sigcontext.h>. */
-#define LINUX_SIGCONTEXT_PC_OFFSET (136)
-
/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
saved program counter. */
-CORE_ADDR
+static CORE_ADDR
x86_64_linux_sigtramp_saved_pc (struct frame_info *frame)
{
CORE_ADDR addr;
@@ -135,3 +139,53 @@ x86_64_linux_frame_saved_pc (struct frame_info *frame)
return x86_64_linux_sigtramp_saved_pc (frame);
return cfi_get_ra (frame);
}
+
+/* Return whether PC is in a GNU/Linux sigtramp routine. */
+
+int
+x86_64_linux_in_sigtramp (CORE_ADDR pc, char *name)
+{
+ if (name)
+ return STREQ ("__restore_rt", name);
+
+ return (x86_64_linux_sigtramp_start (pc) != 0);
+}
+
+CORE_ADDR
+x86_64_linux_frame_chain (struct frame_info *fi)
+{
+ ULONGEST addr;
+ CORE_ADDR fp, pc;
+
+ if (!fi->signal_handler_caller)
+ {
+ fp = cfi_frame_chain (fi);
+ if (fp)
+ return fp;
+ else
+ addr = fi->frame;
+ }
+ else
+ addr = fi->next->frame;
+
+ addr += LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
+
+ fp = read_memory_integer (addr + LINUX_SIGCONTEXT_FP_OFFSET, 8) + 8;
+
+ return fp;
+}
+
+void
+x86_64_init_frame_pc (int fromleaf, struct frame_info *fi)
+{
+ CORE_ADDR addr;
+
+ if (fi->next && fi->next->signal_handler_caller)
+ {
+ addr = fi->next->next->frame
+ + LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
+ fi->pc = read_memory_integer (addr + LINUX_SIGCONTEXT_PC_OFFSET, 8);
+ }
+ else
+ cfi_init_frame_pc (fromleaf, fi);
+}
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index dbc5611cb0d..ad97f167047 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -1,7 +1,6 @@
/* Target-dependent code for the x86-64 for GDB, the GNU debugger.
Copyright 2001, 2002 Free Software Foundation, Inc.
-
Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.
@@ -176,6 +175,15 @@ x86_64_register_virtual_type (int regno)
return *x86_64_register_info_table[regno].type;
}
+/* FIXME: cagney/2002-11-11: Once the i386 and x86-64 targets are
+ merged, this function can go away. */
+int
+i386_fp_regnum_p (int regnum)
+{
+ return (regnum < NUM_REGS
+ && (FP0_REGNUM && FP0_REGNUM <= (regnum) && (regnum) < FPC_REGNUM));
+}
+
/* x86_64_register_convertible is true if register N's virtual format is
different from its raw format. Note that this definition assumes
that the host supports IEEE 32-bit floats, since it doesn't say
@@ -251,18 +259,20 @@ static const char *valid_flavours[] = {
};
static const char *disassembly_flavour = att_flavour;
+/* Push the return address (pointing to the call dummy) onto the stack
+ and return the new value for the stack pointer. */
+
static CORE_ADDR
x86_64_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
char buf[8];
store_unsigned_integer (buf, 8, CALL_DUMMY_ADDRESS ());
-
write_memory (sp - 8, buf, 8);
return sp - 8;
}
-void
+static void
x86_64_pop_frame (void)
{
generic_pop_current_frame (cfi_pop_frame);
@@ -300,8 +310,8 @@ merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2)
if (class1 == class2)
return class1;
- /* Rule #2: If one of the classes is NO_CLASS, the resulting class is
- the other class. */
+ /* Rule #2: If one of the classes is NO_CLASS, the resulting class
+ is the other class. */
if (class1 == X86_64_NO_CLASS)
return class2;
if (class2 == X86_64_NO_CLASS)
@@ -328,15 +338,13 @@ merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2)
return X86_64_SSE_CLASS;
}
+/* Classify the argument type. CLASSES will be filled by the register
+ class used to pass each word of the operand. The number of words
+ is returned. In case the parameter should be passed in memory, 0
+ is returned. As a special case for zero sized containers,
+ classes[0] will be NO_CLASS and 1 is returned.
-/* Classify the argument type.
- CLASSES will be filled by the register class used to pass each word
- of the operand. The number of words is returned. In case the parameter
- should be passed in memory, 0 is returned. As a special case for zero
- sized containers, classes[0] will be NO_CLASS and 1 is returned.
-
- See the x86-64 PS ABI for details.
-*/
+ See the x86-64 psABI for details. */
static int
classify_argument (struct type *type,
@@ -361,8 +369,8 @@ classify_argument (struct type *type,
for (i = 0; i < words; i++)
classes[i] = X86_64_NO_CLASS;
- /* Zero sized arrays or structures are NO_CLASS. We return 0 to
- signalize memory class, so handle it as special case. */
+ /* Zero sized arrays or structures are NO_CLASS. We return 0
+ to signalize memory class, so handle it as special case. */
if (!words)
{
classes[0] = X86_64_NO_CLASS;
@@ -445,7 +453,7 @@ classify_argument (struct type *type,
&& (i == 0 || classes[i - 1] != X86_64_SSE_CLASS))
classes[i] = X86_64_SSE_CLASS;
- /* X86_64_X87UP_CLASS should be preceeded by X86_64_X87_CLASS. */
+ /* X86_64_X87UP_CLASS should be preceeded by X86_64_X87_CLASS. */
if (classes[i] == X86_64_X87UP_CLASS
&& (i == 0 || classes[i - 1] != X86_64_X87_CLASS))
classes[i] = X86_64_SSE_CLASS;
@@ -499,8 +507,9 @@ classify_argument (struct type *type,
"classify_argument: unknown argument type");
}
-/* Examine the argument and return set number of register required in each
- class. Return 0 ifif parameter should be passed in memory. */
+/* Examine the argument and set *INT_NREGS and *SSE_NREGS to the
+ number of registers required based on the information passed in
+ CLASSES. Return 0 if parameter should be passed in memory. */
static int
examine_argument (enum x86_64_reg_class classes[MAX_CLASSES],
@@ -538,9 +547,9 @@ examine_argument (enum x86_64_reg_class classes[MAX_CLASSES],
#define RET_SSE_REGS 2
/* Check if the structure in value_type is returned in registers or in
- memory. If this function returns 1, gdb will call STORE_STRUCT_RETURN and
- EXTRACT_STRUCT_VALUE_ADDRESS else STORE_RETURN_VALUE and EXTRACT_RETURN_VALUE
- will be used. */
+ memory. If this function returns 1, GDB will call
+ STORE_STRUCT_RETURN and EXTRACT_STRUCT_VALUE_ADDRESS else
+ STORE_RETURN_VALUE and EXTRACT_RETURN_VALUE will be used. */
int
x86_64_use_struct_convention (int gcc_p, struct type *value_type)
{
@@ -554,7 +563,6 @@ x86_64_use_struct_convention (int gcc_p, struct type *value_type)
needed_intregs > RET_INT_REGS || needed_sseregs > RET_SSE_REGS);
}
-
/* Extract from an array REGBUF containing the (raw) register state, a
function return value of TYPE, and copy that, in virtual format,
into VALBUF. */
@@ -637,10 +645,10 @@ x86_64_extract_return_value (struct type *type, char *regbuf, char *valbuf)
}
}
-/* Handled by unwind informations. */
static void
x86_64_frame_init_saved_regs (struct frame_info *fi)
{
+ /* Do nothing. Everything is handled by the stack unwinding code. */
}
#define INT_REGS 6
@@ -693,30 +701,30 @@ x86_64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
case X86_64_NO_CLASS:
break;
case X86_64_INTEGER_CLASS:
- write_register_gen (int_parameter_registers
- [(intreg + 1) / 2],
- VALUE_CONTENTS_ALL (args[i]) + offset);
+ deprecated_write_register_gen (int_parameter_registers
+ [(intreg + 1) / 2],
+ VALUE_CONTENTS_ALL (args[i]) + offset);
offset += 8;
intreg += 2;
break;
case X86_64_INTEGERSI_CLASS:
- write_register_gen (int_parameter_registers[intreg / 2],
- VALUE_CONTENTS_ALL (args[i]) + offset);
+ deprecated_write_register_gen (int_parameter_registers[intreg / 2],
+ VALUE_CONTENTS_ALL (args[i]) + offset);
offset += 8;
intreg++;
break;
case X86_64_SSEDF_CLASS:
case X86_64_SSESF_CLASS:
case X86_64_SSE_CLASS:
- write_register_gen (sse_parameter_registers
- [(ssereg + 1) / 2],
- VALUE_CONTENTS_ALL (args[i]) + offset);
+ deprecated_write_register_gen (sse_parameter_registers
+ [(ssereg + 1) / 2],
+ VALUE_CONTENTS_ALL (args[i]) + offset);
offset += 8;
ssereg += 2;
break;
case X86_64_SSEUP_CLASS:
- write_register_gen (sse_parameter_registers[ssereg / 2],
- VALUE_CONTENTS_ALL (args[i]) + offset);
+ deprecated_write_register_gen (sse_parameter_registers[ssereg / 2],
+ VALUE_CONTENTS_ALL (args[i]) + offset);
offset += 8;
ssereg++;
break;
@@ -761,8 +769,8 @@ x86_64_store_return_value (struct type *type, char *valbuf)
&& TARGET_LONG_DOUBLE_FORMAT == &floatformat_i387_ext)
{
/* Copy straight over. */
- write_register_bytes (REGISTER_BYTE (FP0_REGNUM), valbuf,
- FPU_REG_RAW_SIZE);
+ deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), valbuf,
+ FPU_REG_RAW_SIZE);
}
else
{
@@ -775,8 +783,8 @@ x86_64_store_return_value (struct type *type, char *valbuf)
it is the best we can do. */
val = extract_floating (valbuf, TYPE_LENGTH (type));
floatformat_from_doublest (&floatformat_i387_ext, &val, buf);
- write_register_bytes (REGISTER_BYTE (FP0_REGNUM), buf,
- FPU_REG_RAW_SIZE);
+ deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), buf,
+ FPU_REG_RAW_SIZE);
}
}
else
@@ -785,12 +793,13 @@ x86_64_store_return_value (struct type *type, char *valbuf)
int high_size = REGISTER_RAW_SIZE (1);
if (len <= low_size)
- write_register_bytes (REGISTER_BYTE (0), valbuf, len);
+ deprecated_write_register_bytes (REGISTER_BYTE (0), valbuf, len);
else if (len <= (low_size + high_size))
{
- write_register_bytes (REGISTER_BYTE (0), valbuf, low_size);
- write_register_bytes (REGISTER_BYTE (1),
- valbuf + low_size, len - low_size);
+ deprecated_write_register_bytes (REGISTER_BYTE (0), valbuf,
+ low_size);
+ deprecated_write_register_bytes (REGISTER_BYTE (1),
+ valbuf + low_size, len - low_size);
}
else
internal_error (__FILE__, __LINE__,
@@ -862,34 +871,35 @@ x86_64_skip_prologue (CORE_ADDR pc)
struct symtab_and_line v_sal;
struct symbol *v_function;
CORE_ADDR endaddr;
+ unsigned char prolog_buf[PROLOG_BUFSIZE];
- /* We will handle only functions beginning with:
- 55 pushq %rbp
- 48 89 e5 movq %rsp,%rbp
- */
- unsigned char prolog_expect[PROLOG_BUFSIZE] = { 0x55, 0x48, 0x89, 0xe5 },
- prolog_buf[PROLOG_BUFSIZE];
+ /* We will handle only functions starting with: */
+ static unsigned char prolog_expect[PROLOG_BUFSIZE] =
+ {
+ 0x55, /* pushq %rbp */
+ 0x48, 0x89, 0xe5 /* movq %rsp, %rbp */
+ };
read_memory (pc, (char *) prolog_buf, PROLOG_BUFSIZE);
- /* First check, whether pc points to pushq %rbp, movq %rsp,%rbp. */
+ /* First check, whether pc points to pushq %rbp, movq %rsp, %rbp. */
for (i = 0; i < PROLOG_BUFSIZE; i++)
if (prolog_expect[i] != prolog_buf[i])
- return pc; /* ... no, it doesn't. Nothing to skip. */
+ return pc; /* ... no, it doesn't. Nothing to skip. */
- /* OK, we have found the prologue and want PC of the first
+ /* OK, we have found the prologue and want PC of the first
non-prologue instruction. */
pc += PROLOG_BUFSIZE;
v_function = find_pc_function (pc);
v_sal = find_pc_line (pc, 0);
- /* If pc doesn't point to a function with debuginfo,
- some of the following may be NULL. */
+ /* If pc doesn't point to a function with debuginfo, some of the
+ following may be NULL. */
if (!v_function || !v_function->ginfo.value.block || !v_sal.symtab)
return pc;
- endaddr = v_function->ginfo.value.block->endaddr;
+ endaddr = BLOCK_END (SYMBOL_BLOCK_VALUE (v_function));
for (i = 0; i < v_sal.symtab->linetable->nitems; i++)
if (v_sal.symtab->linetable->item[i].pc >= pc
@@ -903,224 +913,207 @@ x86_64_skip_prologue (CORE_ADDR pc)
}
/* Sequence of bytes for breakpoint instruction. */
-static unsigned char *
-x86_64_breakpoint_from_pc (CORE_ADDR * pc, int *lenptr)
+static const unsigned char *
+x86_64_breakpoint_from_pc (CORE_ADDR *pc, int *lenptr)
{
static unsigned char breakpoint[] = { 0xcc };
*lenptr = 1;
return breakpoint;
}
-static struct gdbarch *
-x86_64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+static void
+x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
- struct gdbarch *gdbarch;
- struct gdbarch_tdep *tdep;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
int i, sum;
- /* Find a candidate among the list of pre-declared architectures. */
- for (arches = gdbarch_list_lookup_by_info (arches, &info);
- arches != NULL;
- arches = gdbarch_list_lookup_by_info (arches->next, &info))
- {
- switch (info.bfd_arch_info->mach)
- {
- case bfd_mach_x86_64:
- case bfd_mach_x86_64_intel_syntax:
- switch (gdbarch_bfd_arch_info (arches->gdbarch)->mach)
- {
- case bfd_mach_x86_64:
- case bfd_mach_x86_64_intel_syntax:
- return arches->gdbarch;
- case bfd_mach_i386_i386:
- case bfd_mach_i386_i8086:
- case bfd_mach_i386_i386_intel_syntax:
- break;
- default:
- internal_error (__FILE__, __LINE__,
- "x86_64_gdbarch_init: unknown machine type");
- }
- break;
- case bfd_mach_i386_i386:
- case bfd_mach_i386_i8086:
- case bfd_mach_i386_i386_intel_syntax:
- switch (gdbarch_bfd_arch_info (arches->gdbarch)->mach)
- {
- case bfd_mach_x86_64:
- case bfd_mach_x86_64_intel_syntax:
- break;
- case bfd_mach_i386_i386:
- case bfd_mach_i386_i8086:
- case bfd_mach_i386_i386_intel_syntax:
- return arches->gdbarch;
- default:
- internal_error (__FILE__, __LINE__,
- "x86_64_gdbarch_init: unknown machine type");
- }
- break;
- default:
- internal_error (__FILE__, __LINE__,
- "x86_64_gdbarch_init: unknown machine type");
- }
- }
-
- tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
- gdbarch = gdbarch_alloc (&info, tdep);
-
- switch (info.bfd_arch_info->mach)
- {
- case bfd_mach_x86_64:
- case bfd_mach_x86_64_intel_syntax:
- tdep->num_xmm_regs = 16;
- break;
- case bfd_mach_i386_i386:
- case bfd_mach_i386_i8086:
- case bfd_mach_i386_i386_intel_syntax:
- /* This is place for definition of i386 target vector. */
- break;
- default:
- internal_error (__FILE__, __LINE__,
- "x86_64_gdbarch_init: unknown machine type");
- }
+ /* The x86-64 has 16 SSE registers. */
+ tdep->num_xmm_regs = 16;
+ /* This is what all the fuss is about. */
set_gdbarch_long_bit (gdbarch, 64);
set_gdbarch_long_long_bit (gdbarch, 64);
set_gdbarch_ptr_bit (gdbarch, 64);
- set_gdbarch_long_double_format (gdbarch, &floatformat_i387_ext);
+ /* In contrast to the i386, on the x86-64 a `long double' actually
+ takes up 128 bits, even though it's still based on the i387
+ extended floating-point format which has only 80 significant bits. */
+ set_gdbarch_long_double_bit (gdbarch, 128);
set_gdbarch_num_regs (gdbarch, X86_64_NUM_REGS);
+
+ /* Register numbers of various important registers. */
+ set_gdbarch_sp_regnum (gdbarch, 7); /* %rsp */
+ set_gdbarch_fp_regnum (gdbarch, 6); /* %rbp */
+ set_gdbarch_pc_regnum (gdbarch, 16); /* %rip */
+ set_gdbarch_ps_regnum (gdbarch, 17); /* %eflags */
+ set_gdbarch_fp0_regnum (gdbarch, X86_64_NUM_GREGS); /* %st(0) */
+
+ /* The "default" register numbering scheme for the x86-64 is
+ referred to as the "DWARF register number mapping" in the psABI.
+ The preferred debugging format for all known x86-64 targets is
+ actually DWARF2, and GCC doesn't seem to support DWARF (that is
+ DWARF-1), but we provide the same mapping just in case. This
+ mapping is also used for stabs, which GCC does support. */
+ set_gdbarch_stab_reg_to_regnum (gdbarch, x86_64_dwarf2_reg_to_regnum);
+ set_gdbarch_dwarf_reg_to_regnum (gdbarch, x86_64_dwarf2_reg_to_regnum);
+ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, x86_64_dwarf2_reg_to_regnum);
+
+ /* We don't override SDB_REG_RO_REGNUM, sice COFF doesn't seem to be
+ in use on any of the supported x86-64 targets. */
+
set_gdbarch_register_name (gdbarch, x86_64_register_name);
set_gdbarch_register_size (gdbarch, 8);
- set_gdbarch_register_raw_size (gdbarch, x86_64_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, 16);
- set_gdbarch_register_byte (gdbarch, x86_64_register_byte);
- /* Total amount of space needed to store our copies of the machine's register
- (SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS + SIZEOF_SSE_REGS) */
+ /* Total amount of space needed to store our copies of the machine's
+ register (SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS +
+ SIZEOF_SSE_REGS) */
for (i = 0, sum = 0; i < X86_64_NUM_REGS; i++)
sum += x86_64_register_info_table[i].size;
set_gdbarch_register_bytes (gdbarch, sum);
- set_gdbarch_register_virtual_size (gdbarch, generic_register_size);
- set_gdbarch_max_register_virtual_size (gdbarch, 16);
+ set_gdbarch_register_raw_size (gdbarch, x86_64_register_raw_size);
+ set_gdbarch_register_byte (gdbarch, x86_64_register_byte);
set_gdbarch_register_virtual_type (gdbarch, x86_64_register_virtual_type);
+ /* FIXME: kettenis/20021026: As long as we don't support longjmp,
+ that is, as long as we have `tdep->jb_pc_offset == -1', using
+ i386_get_longjmp_target is fine. */
+
set_gdbarch_register_convertible (gdbarch, x86_64_register_convertible);
set_gdbarch_register_convert_to_virtual (gdbarch,
x86_64_register_convert_to_virtual);
set_gdbarch_register_convert_to_raw (gdbarch,
x86_64_register_convert_to_raw);
-/* Register numbers of various important registers. */
- set_gdbarch_sp_regnum (gdbarch, 7); /* (rsp) Contains address of top of stack. */
- set_gdbarch_fp_regnum (gdbarch, 6); /* (rbp) */
- set_gdbarch_pc_regnum (gdbarch, 16); /* (rip) Contains program counter. */
-
- set_gdbarch_fp0_regnum (gdbarch, X86_64_NUM_GREGS); /* First FPU floating-point register. */
+ /* Getting saved registers is handled by unwind information. */
+ set_gdbarch_get_saved_register (gdbarch, cfi_get_saved_register);
+ /* FIXME: kettenis/20021026: Should we set parm_boundary to 64 here? */
set_gdbarch_read_fp (gdbarch, cfi_read_fp);
-/* Discard from the stack the innermost frame, restoring all registers. */
+ /* FIXME: kettenis/20021026: Should be undeprecated. */
+ set_gdbarch_extract_return_value (gdbarch, NULL);
+ set_gdbarch_deprecated_extract_return_value (gdbarch,
+ x86_64_extract_return_value);
+ set_gdbarch_push_arguments (gdbarch, x86_64_push_arguments);
+ set_gdbarch_push_return_address (gdbarch, x86_64_push_return_address);
set_gdbarch_pop_frame (gdbarch, x86_64_pop_frame);
+ set_gdbarch_store_struct_return (gdbarch, x86_64_store_struct_return);
+ /* FIXME: kettenis/20021026: Should be undeprecated. */
+ set_gdbarch_store_return_value (gdbarch, NULL);
+ set_gdbarch_deprecated_store_return_value (gdbarch,
+ x86_64_store_return_value);
+ /* Override, since this is handled by x86_64_extract_return_value. */
+ set_gdbarch_extract_struct_value_address (gdbarch, NULL);
+ set_gdbarch_use_struct_convention (gdbarch, x86_64_use_struct_convention);
- /* FRAME_CHAIN takes a frame's nominal address and produces the frame's
- chain-pointer. */
- set_gdbarch_frame_chain (gdbarch, cfi_frame_chain);
+ set_gdbarch_frame_init_saved_regs (gdbarch, x86_64_frame_init_saved_regs);
+ set_gdbarch_skip_prologue (gdbarch, x86_64_skip_prologue);
+ set_gdbarch_frame_chain (gdbarch, x86_64_linux_frame_chain);
set_gdbarch_frameless_function_invocation (gdbarch,
- x86_64_frameless_function_invocation);
+ x86_64_frameless_function_invocation);
+ /* FIXME: kettenis/20021025: Shouldn't this be set to
+ generic_file_frame_chain_valid? */
+ set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
+ /* FIXME: kettenis/20021026: These two are GNU/Linux-specific and
+ should be moved elsewhere. */
set_gdbarch_frame_saved_pc (gdbarch, x86_64_linux_frame_saved_pc);
+ set_gdbarch_saved_pc_after_call (gdbarch, x86_64_linux_saved_pc_after_call);
+ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
+ /* FIXME: kettenis/20021026: This one is GNU/Linux-specific too. */
+ set_gdbarch_pc_in_sigtramp (gdbarch, x86_64_linux_in_sigtramp);
- set_gdbarch_frame_args_address (gdbarch, default_frame_address);
- set_gdbarch_frame_locals_address (gdbarch, default_frame_address);
-
-/* Return number of bytes at start of arglist that are not really args. */
- set_gdbarch_frame_args_skip (gdbarch, 8);
-
- set_gdbarch_frame_init_saved_regs (gdbarch, x86_64_frame_init_saved_regs);
-
-/* Frame pc initialization is handled by unwind informations. */
- set_gdbarch_init_frame_pc (gdbarch, cfi_init_frame_pc);
+ /* Build call frame information (CFI) from DWARF2 frame debug info. */
+ set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info);
-/* Initialization of unwind informations. */
+ /* Initialization of per-frame CFI. */
set_gdbarch_init_extra_frame_info (gdbarch, cfi_init_extra_frame_info);
-/* Getting saved registers is handled by unwind informations. */
- set_gdbarch_get_saved_register (gdbarch, cfi_get_saved_register);
-
- set_gdbarch_frame_init_saved_regs (gdbarch, x86_64_frame_init_saved_regs);
+ /* Frame PC initialization is handled by using CFI. */
+ set_gdbarch_init_frame_pc (gdbarch, x86_64_init_frame_pc);
-/* Cons up virtual frame pointer for trace */
+ /* Cons up virtual frame pointer for trace. */
set_gdbarch_virtual_frame_pointer (gdbarch, cfi_virtual_frame_pointer);
+ /* FIXME: kettenis/20021026: This is ELF-specific. Fine for now,
+ since all supported x86-64 targets are ELF, but that might change
+ in the future. */
+ set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
+}
- set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid);
+static struct gdbarch *
+x86_64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+ struct gdbarch_tdep *tdep;
+ struct gdbarch *gdbarch;
+ enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
- set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
- set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
- set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
- set_gdbarch_call_dummy_length (gdbarch, 0);
- set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
- set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
- set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point);
- set_gdbarch_call_dummy_words (gdbarch, 0);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
- set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
- set_gdbarch_call_dummy_p (gdbarch, 1);
- set_gdbarch_call_dummy_start_offset (gdbarch, 0);
- set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
- set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
- set_gdbarch_push_return_address (gdbarch, x86_64_push_return_address);
- set_gdbarch_push_arguments (gdbarch, x86_64_push_arguments);
+ /* Try to determine the OS ABI of the object we're loading. */
+ if (info.abfd != NULL)
+ osabi = gdbarch_lookup_osabi (info.abfd);
-/* Return number of args passed to a frame, no way to tell. */
- set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
-/* Don't use default structure extract routine */
- set_gdbarch_deprecated_extract_struct_value_address (gdbarch, 0);
+ /* Find a candidate among extant architectures. */
+ for (arches = gdbarch_list_lookup_by_info (arches, &info);
+ arches != NULL;
+ arches = gdbarch_list_lookup_by_info (arches->next, &info))
+ {
+ /* Make sure the OS ABI selection matches. */
+ tdep = gdbarch_tdep (arches->gdbarch);
+ if (tdep && tdep->osabi == osabi)
+ return arches->gdbarch;
+ }
-/* If USE_STRUCT_CONVENTION retruns 0, then gdb uses STORE_RETURN_VALUE
- and EXTRACT_RETURN_VALUE to store/fetch the functions return value. It is
- the case when structure is returned in registers. */
- set_gdbarch_use_struct_convention (gdbarch, x86_64_use_struct_convention);
+ /* Allocate space for the new architecture. */
+ tdep = XMALLOC (struct gdbarch_tdep);
+ gdbarch = gdbarch_alloc (&info, tdep);
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
- set_gdbarch_store_struct_return (gdbarch, x86_64_store_struct_return);
+ tdep->osabi = osabi;
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
- set_gdbarch_deprecated_extract_return_value (gdbarch, x86_64_extract_return_value);
+ /* FIXME: kettenis/20021025: The following calls are going to
+ disappear when we integrate the x86_64 target into the i386
+ target. */
+ set_gdbarch_long_double_format (gdbarch, &floatformat_i387_ext);
-/* Write into the appropriate registers a function return value stored
- in VALBUF of type TYPE, given in virtual format. */
- set_gdbarch_deprecated_store_return_value (gdbarch, x86_64_store_return_value);
-
+ set_gdbarch_max_register_raw_size (gdbarch, 16);
+ set_gdbarch_max_register_virtual_size (gdbarch, 16);
+
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-/* Offset from address of function to start of its code. */
+ set_gdbarch_breakpoint_from_pc (gdbarch, x86_64_breakpoint_from_pc);
+ set_gdbarch_decr_pc_after_break (gdbarch, 1);
set_gdbarch_function_start_offset (gdbarch, 0);
- set_gdbarch_skip_prologue (gdbarch, x86_64_skip_prologue);
+ set_gdbarch_frame_args_skip (gdbarch, 8);
+ set_gdbarch_frame_args_address (gdbarch, default_frame_address);
+ set_gdbarch_frame_locals_address (gdbarch, default_frame_address);
- set_gdbarch_saved_pc_after_call (gdbarch, x86_64_linux_saved_pc_after_call);
+ set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
- set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+ set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
+ set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 0);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
+ set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
+ set_gdbarch_call_dummy_length (gdbarch, 0);
+ set_gdbarch_call_dummy_p (gdbarch, 1);
+ set_gdbarch_call_dummy_words (gdbarch, NULL);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
+ set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
- set_gdbarch_breakpoint_from_pc (gdbarch,
- (gdbarch_breakpoint_from_pc_ftype *)
- x86_64_breakpoint_from_pc);
+ set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point);
- set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
+ set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
-/* Amount PC must be decremented by after a breakpoint. This is often the
- number of bytes in BREAKPOINT but not always. */
- set_gdbarch_decr_pc_after_break (gdbarch, 1);
+ /* FIXME: kettenis/20021025: These already are the default. */
-/* Use dwarf2 debug frame informations. */
- set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info);
- set_gdbarch_dwarf2_reg_to_regnum (gdbarch, x86_64_dwarf2_reg_to_regnum);
+ set_gdbarch_register_virtual_size (gdbarch, generic_register_size);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, 0);
+
+ x86_64_init_abi (info, gdbarch);
return gdbarch;
}
diff --git a/gdb/x86-64-tdep.h b/gdb/x86-64-tdep.h
index 711486077fb..4e7320643ca 100644
--- a/gdb/x86-64-tdep.h
+++ b/gdb/x86-64-tdep.h
@@ -30,9 +30,12 @@ extern int x86_64_num_gregs;
int x86_64_register_number (const char *name);
const char *x86_64_register_name (int reg_nr);
-
gdbarch_frame_saved_pc_ftype x86_64_linux_frame_saved_pc;
gdbarch_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call;
+gdbarch_pc_in_sigtramp_ftype x86_64_linux_in_sigtramp;
+CORE_ADDR x86_64_linux_frame_chain (struct frame_info *fi);
+void x86_64_init_frame_pc (int fromleaf, struct frame_info *fi);
+
#endif
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 0e85125791d..140161f7341 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -150,16 +150,16 @@ struct coff_symfile_info
CORE_ADDR toc_offset;
};
-static struct complaint storclass_complaint =
+static struct deprecated_complaint storclass_complaint =
{"Unexpected storage class: %d", 0, 0};
-static struct complaint bf_notfound_complaint =
+static struct deprecated_complaint bf_notfound_complaint =
{"line numbers off, `.bf' symbol not found", 0, 0};
-static struct complaint ef_complaint =
+static struct deprecated_complaint ef_complaint =
{"Mismatched .ef symbol ignored starting at symnum %d", 0, 0};
-static struct complaint eb_complaint =
+static struct deprecated_complaint eb_complaint =
{"Mismatched .eb symbol ignored starting at symnum %d", 0, 0};
static void xcoff_initial_scan (struct objfile *, int);
@@ -483,7 +483,7 @@ record_include_begin (struct coff_symbol *cs)
/* This can happen with old versions of GCC.
GCC 2.3.3-930426 does not exhibit this on a test case which
a user said produced the message for him. */
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"Nested C_BINCL symbols", 0, 0};
complain (&msg);
}
@@ -502,7 +502,7 @@ record_include_end (struct coff_symbol *cs)
if (inclDepth == 0)
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"Mismatched C_BINCL/C_EINCL pair", 0, 0};
complain (&msg);
}
@@ -766,7 +766,7 @@ enter_line_range (struct subfile *subfile, unsigned beginoffset, unsigned endoff
{
if (endoffset >= limit_offset)
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"Bad line table offset in C_EINCL directive", 0, 0};
complain (&msg);
return;
@@ -864,7 +864,7 @@ static char *
xcoff_next_symbol_text (struct objfile *objfile)
{
struct internal_syment symbol;
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"Unexpected symbol continuation", 0, 0};
char *retval;
/* FIXME: is this the same as the passed arg? */
@@ -1332,7 +1332,7 @@ read_xcoff_symtab (struct partial_symtab *pst)
case C_UNTAG:
case C_ENTAG:
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"Unrecognized storage class %d.", 0, 0};
complain (&msg, cs->c_sclass);
}
@@ -1603,7 +1603,7 @@ read_symbol (struct internal_syment *symbol, int symno)
->symtbl;
if (symno < 0 || symno >= nsyms)
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"Invalid symbol offset", 0, 0};
complain (&msg);
symbol->n_value = 0;
@@ -2442,7 +2442,7 @@ scan_xcoff_symtab (struct objfile *objfile)
default:
{
- static struct complaint msg =
+ static struct deprecated_complaint msg =
{"Storage class %d not recognized during scan", 0, 0};
complain (&msg, sclass);
}
@@ -2565,7 +2565,7 @@ scan_xcoff_symtab (struct objfile *objfile)
case C_STSYM:
{
- static struct complaint function_outside_compilation_unit = {
+ static struct deprecated_complaint function_outside_compilation_unit = {
"function `%s' appears to be defined outside of all compilation units", 0, 0
};
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index b08808563f2..f1115168888 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -186,7 +186,7 @@ xstormy16_get_saved_register (char *raw_buffer,
struct frame_info *fi,
int regnum, enum lval_type *lval)
{
- generic_get_saved_register (raw_buffer, optimized, addrp, fi, regnum, lval);
+ deprecated_generic_get_saved_register (raw_buffer, optimized, addrp, fi, regnum, lval);
}
/* Function: xstormy16_type_is_scalar
@@ -387,12 +387,12 @@ xstormy16_store_return_value (struct type *type, char *valbuf)
/* Add leading zeros to the value. */
memset (buf, 0, xstormy16_reg_size);
memcpy (buf, valbuf, 1);
- write_register_gen (E_1ST_ARG_REGNUM, buf);
+ deprecated_write_register_gen (E_1ST_ARG_REGNUM, buf);
}
else if (xstormy16_type_is_scalar (type) &&
TYPE_LENGTH (type) <= E_MAX_RETTYPE_SIZE_IN_REGS)
- write_register_bytes (REGISTER_BYTE (E_1ST_ARG_REGNUM),
- valbuf, TYPE_LENGTH (type));
+ deprecated_write_register_bytes (REGISTER_BYTE (E_1ST_ARG_REGNUM),
+ valbuf, TYPE_LENGTH (type));
else
{
return_buffer = read_register (E_PTR_RET_REGNUM);
@@ -439,7 +439,7 @@ xstormy16_frame_saved_register (struct frame_info *fi, int regnum)
int size = xstormy16_register_raw_size (regnum);
char *buf = (char *) alloca (size);
- generic_get_saved_register (buf, NULL, NULL, fi, regnum, NULL);
+ deprecated_generic_get_saved_register (buf, NULL, NULL, fi, regnum, NULL);
return (CORE_ADDR) extract_unsigned_integer (buf, size);
}
diff --git a/gdb/z8k-tdep.c b/gdb/z8k-tdep.c
index c7396e21ff7..e06f343f11d 100644
--- a/gdb/z8k-tdep.c
+++ b/gdb/z8k-tdep.c
@@ -309,7 +309,8 @@ write_return_value (struct type *type, char *valbuf)
int len;
for (len = 0; len < TYPE_LENGTH (type); len += 2)
- write_register_bytes (REGISTER_BYTE (len / 2 + 2), valbuf + len, 2);
+ deprecated_write_register_bytes (REGISTER_BYTE (len / 2 + 2),
+ valbuf + len, 2);
}
void
@@ -319,7 +320,7 @@ store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
}
-void
+static void
z8k_print_register_hook (int regno)
{
if ((regno & 1) == 0 && regno < 16)
@@ -359,7 +360,117 @@ z8k_print_register_hook (int regno)
(unsigned int)read_memory_short (rval + i));
}
}
+}
+
+static void
+z8k_print_registers_info (struct gdbarch *gdbarch,
+ struct ui_file *file,
+ struct frame_info *frame,
+ int regnum, int print_all)
+{
+ int i;
+ const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
+
+ for (i = 0; i < numregs; i++)
+ {
+ /* Decide between printing all regs, non-float / vector regs, or
+ specific reg. */
+ if (regnum == -1)
+ {
+ if (!print_all)
+ {
+ if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
+ continue;
+ if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)))
+ continue;
+ }
+ }
+ else
+ {
+ if (i != regnum)
+ continue;
+ }
+
+ /* If the register name is empty, it is undefined for this
+ processor, so don't display anything. */
+ if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0')
+ continue;
+
+ fputs_filtered (REGISTER_NAME (i), file);
+ print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), file);
+
+ /* Get the data in raw format. */
+ if (! frame_register_read (frame, i, raw_buffer))
+ {
+ fprintf_filtered (file, "*value not available*\n");
+ continue;
+ }
+ /* FIXME: cagney/2002-08-03: This code shouldn't be necessary.
+ The function frame_register_read() should have returned the
+ pre-cooked register so no conversion is necessary. */
+ /* Convert raw data to virtual format if necessary. */
+ if (REGISTER_CONVERTIBLE (i))
+ {
+ REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i),
+ raw_buffer, virtual_buffer);
+ }
+ else
+ {
+ memcpy (virtual_buffer, raw_buffer,
+ REGISTER_VIRTUAL_SIZE (i));
+ }
+
+ /* If virtual format is floating, print it that way, and in raw
+ hex. */
+ if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
+ {
+ int j;
+
+ val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ file, 0, 1, 0, Val_pretty_default);
+
+ fprintf_filtered (file, "\t(raw 0x");
+ for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
+ {
+ int idx;
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ idx = j;
+ else
+ idx = REGISTER_RAW_SIZE (i) - 1 - j;
+ fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[idx]);
+ }
+ fprintf_filtered (file, ")");
+ }
+ else
+ {
+ /* Print the register in hex. */
+ val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ file, 'x', 1, 0, Val_pretty_default);
+ /* If not a vector register, print it also according to its
+ natural format. */
+ if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)) == 0)
+ {
+ fprintf_filtered (file, "\t");
+ val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ file, 0, 1, 0, Val_pretty_default);
+ }
+ }
+
+ /* Some z8k specific info. */
+ z8k_print_register_hook (i);
+
+ fprintf_filtered (file, "\n");
+ }
+}
+
+void
+z8k_do_registers_info (int regnum, int all)
+{
+ z8k_print_registers_info (current_gdbarch, gdb_stdout, selected_frame,
+ regnum, all);
}
void
diff --git a/include/ChangeLog b/include/ChangeLog
index 257e381931f..2dfed5ae4ce 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,33 @@
+2002-11-14 Egor Duda <deo@logos-m.ru>
+
+ * bfdlink.h (struct bfd_link_info): Add new boolean
+ field pei386_runtime_pseudo_reloc.
+
+2002-11-11 Svein E. Seldal <Svein.Seldal@solidas.com>
+
+ * opcode/tic4x.h: Added new opcodes and corrected some bugs. Add
+ support for new DSP types.
+
+2002-10-26 Roger Sayle <roger@eyesopen.com>
+
+ * partition.h: Close the extern "C" scope when compiling with C++.
+
+2002-10-26 Roger Sayle <roger@eyesopen.com>
+ DJ Delorie <dj@redhat.com>
+
+ PR bootstrap/8351
+ * getopt.h: Avoid prototyping getopt with no arguments in C++.
+
+2002-10-24 Nathan Tallent <eraxxon@alumni.rice.edu>
+
+ * ansidecl.h (__STDC__): Add (__alpha && __cplusplus) to the
+ list of platform compilers that may look, smell and act
+ like __STDC__ but that may not define it.
+
+2002-10-11 David O'Brien <obrien@FreeBSD.org>
+
+ * getopt.h: getopt is in unistd.h (based on SUSv2).
+
2002-09-26 Jakub Jelinek <jakub@redhat.com>
* elf/x86-64.h: Add TLS relocs.
diff --git a/include/ansidecl.h b/include/ansidecl.h
index 9a7c5777ff2..d169b4f50ed 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -136,10 +136,13 @@ So instead we use the macro below and test it against specific values. */
#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
#endif /* GCC_VERSION */
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
+#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) || (defined(__alpha) && defined(__cplusplus))
/* All known AIX compilers implement these things (but don't always
define __STDC__). The RISC/OS MIPS compiler defines these things
in SVR4 mode, but does not define __STDC__. */
+/* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other
+ C++ compilers, does not define __STDC__, though it acts as if this
+ was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */
#define ANSI_PROTOTYPES 1
#define PTR void *
diff --git a/include/bfdlink.h b/include/bfdlink.h
index 4998fe3dbf7..9263bcc126d 100644
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -340,6 +340,11 @@ struct bfd_link_info
is explicitly requested by the user, -1 if enabled by default. */
int pei386_auto_import;
+ /* Non-zero if runtime relocs for DATA items with non-zero addends
+ in pei386 DLLs should be generated. Set to 1 if this feature
+ is explicitly requested by the user, -1 if enabled by default. */
+ int pei386_runtime_pseudo_reloc;
+
/* True if non-PLT relocs should be merged into one reloc section
and sorted so that relocs against the same symbol come together. */
boolean combreloc;
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 254b2c425b1..65f3160af38 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,7 @@
+2002-10-11 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * sh.h: Add SH TLS relocs.
+
2002-09-30 Gavin Romig-Koch <gavin@redhat.com>
Ken Raeburn <raeburn@cygnus.com>
Aldy Hernandez <aldyh@redhat.com>
diff --git a/include/elf/sh.h b/include/elf/sh.h
index af78c9bb04e..ef964d685e8 100644
--- a/include/elf/sh.h
+++ b/include/elf/sh.h
@@ -167,7 +167,17 @@ START_RELOC_NUMBERS (elf_sh_reloc_type)
RELOC_NUMBER (R_SH_DIR10SL, 50)
RELOC_NUMBER (R_SH_DIR10SQ, 51)
FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_3, 52)
- FAKE_RELOC (R_SH_LAST_INVALID_RELOC_3, 159)
+ FAKE_RELOC (R_SH_LAST_INVALID_RELOC_3, 143)
+ RELOC_NUMBER (R_SH_TLS_GD_32, 144)
+ RELOC_NUMBER (R_SH_TLS_LD_32, 145)
+ RELOC_NUMBER (R_SH_TLS_LDO_32, 146)
+ RELOC_NUMBER (R_SH_TLS_IE_32, 147)
+ RELOC_NUMBER (R_SH_TLS_LE_32, 148)
+ RELOC_NUMBER (R_SH_TLS_DTPMOD32, 149)
+ RELOC_NUMBER (R_SH_TLS_DTPOFF32, 150)
+ RELOC_NUMBER (R_SH_TLS_TPOFF32, 151)
+ FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_4, 152)
+ FAKE_RELOC (R_SH_LAST_INVALID_RELOC_4, 159)
RELOC_NUMBER (R_SH_GOT32, 160)
RELOC_NUMBER (R_SH_PLT32, 161)
RELOC_NUMBER (R_SH_COPY, 162)
@@ -205,8 +215,8 @@ START_RELOC_NUMBERS (elf_sh_reloc_type)
RELOC_NUMBER (R_SH_GLOB_DAT64, 194)
RELOC_NUMBER (R_SH_JMP_SLOT64, 195)
RELOC_NUMBER (R_SH_RELATIVE64, 196)
- FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_4, 197)
- FAKE_RELOC (R_SH_LAST_INVALID_RELOC_4, 241)
+ FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_5, 197)
+ FAKE_RELOC (R_SH_LAST_INVALID_RELOC_5, 241)
RELOC_NUMBER (R_SH_SHMEDIA_CODE, 242)
RELOC_NUMBER (R_SH_PT_16, 243)
RELOC_NUMBER (R_SH_IMMS16, 244)
diff --git a/include/getopt.h b/include/getopt.h
index 0c6470b3ddb..a99a2290159 100644
--- a/include/getopt.h
+++ b/include/getopt.h
@@ -1,6 +1,6 @@
/* Declarations for getopt.
- Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 2000
- Free Software Foundation, Inc.
+ Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 2000,
+ 2002 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
@@ -108,11 +108,13 @@ struct option
#if !HAVE_DECL_GETOPT
#if defined (__GNU_LIBRARY__) || defined (HAVE_DECL_GETOPT)
/* Many other libraries have conflicting prototypes for getopt, with
- differences in the consts, in stdlib.h. To avoid compilation
+ differences in the consts, in unistd.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
#else
+#ifndef __cplusplus
extern int getopt ();
+#endif /* __cplusplus */
#endif
#endif /* !HAVE_DECL_GETOPT */
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index ab908ec92c3..af5707e8e88 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,7 @@
+2002-10-14 Alan Modra <amodra@bigpond.net.au>
+
+ * cgen.h: Test __BFD_H_SEEN__ rather than BFD_VERSION_DATE.
+
2002-09-30 Gavin Romig-Koch <gavin@redhat.com>
Ken Raeburn <raeburn@cygnus.com>
Aldy Hernandez <aldyh@redhat.com>
diff --git a/include/opcode/cgen.h b/include/opcode/cgen.h
index 09c5cbf03a6..89477985e5d 100644
--- a/include/opcode/cgen.h
+++ b/include/opcode/cgen.h
@@ -26,7 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
Perhaps the definition of bfd_vma can be moved outside of bfd.h.
Or perhaps one could duplicate its definition in another file.
Until such time, this file conditionally compiles definitions that require
- bfd_vma using BFD_VERSION_DATE. */
+ bfd_vma using __BFD_H_SEEN__. */
/* Enums must be defined before they can be used.
Allow them to be used in struct definitions, even though the enum must
@@ -276,7 +276,7 @@ typedef const char * (cgen_parse_fn)
PC is the pc value of the insn.
The result is an error message or NULL if success. */
-#ifdef BFD_VERSION_DATE
+#ifdef __BFD_H_SEEN__
typedef const char * (cgen_insert_fn)
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
CGEN_FIELDS *fields_, CGEN_INSN_BYTES_PTR insnp_,
@@ -297,7 +297,7 @@ typedef const char * (cgen_insert_fn) ();
PC is the pc value of the insn.
The result is the length of the insn in bits or zero if not recognized. */
-#ifdef BFD_VERSION_DATE
+#ifdef __BFD_H_SEEN__
typedef int (cgen_extract_fn)
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
CGEN_EXTRACT_INFO *ex_info_, CGEN_INSN_INT base_insn_,
@@ -316,7 +316,7 @@ typedef int (cgen_extract_fn) ();
PC is the pc value of the insn.
LEN is the length of the insn, in bits. */
-#ifdef BFD_VERSION_DATE
+#ifdef __BFD_H_SEEN__
typedef void (cgen_print_fn)
PARAMS ((CGEN_CPU_DESC, PTR info_, const CGEN_INSN *insn_,
CGEN_FIELDS *fields_, bfd_vma pc_, int len_));
@@ -381,7 +381,7 @@ enum cgen_parse_operand_result
CGEN_PARSE_OPERAND_RESULT_ERROR
};
-#ifdef BFD_VERSION_DATE /* Don't require bfd.h unnecessarily. */
+#ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily. */
typedef const char * (cgen_parse_operand_fn)
PARAMS ((CGEN_CPU_DESC,
enum cgen_parse_operand_type, const char **, int, int,
@@ -565,7 +565,7 @@ const CGEN_KEYWORD_ENTRY *cgen_keyword_search_next
extern const char *cgen_parse_keyword
PARAMS ((CGEN_CPU_DESC, const char **, CGEN_KEYWORD *, long *));
-#ifdef BFD_VERSION_DATE /* Don't require bfd.h unnecessarily. */
+#ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily. */
extern const char *cgen_parse_signed_integer
PARAMS ((CGEN_CPU_DESC, const char **, int, long *));
extern const char *cgen_parse_unsigned_integer
@@ -1253,7 +1253,7 @@ typedef struct cgen_cpu_desc
const char * (*parse_operand)
PARAMS ((CGEN_CPU_DESC, int opindex_, const char **,
CGEN_FIELDS *fields_));
-#ifdef BFD_VERSION_DATE
+#ifdef __BFD_H_SEEN__
const char * (*insert_operand)
PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_,
CGEN_INSN_BYTES_PTR, bfd_vma pc_));
@@ -1286,7 +1286,7 @@ typedef struct cgen_cpu_desc
PARAMS ((CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_));
void (*set_int_operand)
PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, int value_));
-#ifdef BFD_VERSION_DATE
+#ifdef __BFD_H_SEEN__
bfd_vma (*get_vma_operand)
PARAMS ((CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_));
void (*set_vma_operand)
diff --git a/include/opcode/tic4x.h b/include/opcode/tic4x.h
index 68d186d1d0e..18df7f19c8a 100644
--- a/include/opcode/tic4x.h
+++ b/include/opcode/tic4x.h
@@ -304,8 +304,10 @@ static const c4x_inst_t c3x_insts[] =
{ "addi_mpyi", 0x89000000, 0xff000000, Q_rSr_rSr },
{ "addi_mpyi", 0x8a000000, 0xff000000, Q_SSr_rrr },
{ "addi_mpyi", 0x8b000000, 0xff000000, Q_Srr_Srr },
+ { "addi_mpyi", 0x8b000000, 0xff000000, Q_Srr_rSr },
{ "addi3_mpyi3", 0x88000000, 0xff000000, Q_rrr_SSr },
{ "addi3_mpyi3", 0x89000000, 0xff000000, Q_rSr_Srr },
+ { "addi3_mpyi3", 0x89000000, 0xff000000, Q_rSr_rSr },
{ "addi3_mpyi3", 0x8a000000, 0xff000000, Q_SSr_rrr },
{ "addi3_mpyi3", 0x8b000000, 0xff000000, Q_Srr_Srr },
{ "addi3_mpyi3", 0x8b000000, 0xff000000, Q_Srr_rSr },
@@ -390,6 +392,8 @@ static const c4x_inst_t c3x_insts[] =
{ "negf_stf", 0xe2000000, 0xfe000000, P_Sr_rS },
{ "negi_sti", 0xe4000000, 0xfe000000, P_Sr_rS },
{ "not_sti", 0xe6000000, 0xfe000000, P_Sr_rS },
+ { "or_sti", 0xe8000000, 0xfe000000, P_Srr_rS },
+ { "or_sti", 0xe8000000, 0xfe000000, P_rSr_rS },
{ "or3_sti", 0xe8000000, 0xfe000000, P_Srr_rS },
{ "or3_sti", 0xe8000000, 0xfe000000, P_rSr_rS },
{ "stf_absf", 0xc8000000, 0xfe000000, Q_rS_Sr },
@@ -402,6 +406,7 @@ static const c4x_inst_t c3x_insts[] =
{ "stf_mpyf", 0xde000000, 0xfe000000, Q_rS_rSr },
{ "stf_mpyf3", 0xde000000, 0xfe000000, Q_rS_Srr },
{ "stf_mpyf3", 0xde000000, 0xfe000000, Q_rS_rSr },
+ { "stf_ldf", 0xd8000000, 0xfe000000, Q_rS_Sr },
{ "stf_negf", 0xe2000000, 0xfe000000, Q_rS_Sr },
{ "stf_stf", 0xc0000000, 0xfe000000, P_rS_rS },
{ "stf1_stf2", 0xc0000000, 0xfe000000, Q_rS_rS }, /* synonym */
@@ -417,6 +422,7 @@ static const c4x_inst_t c3x_insts[] =
{ "sti_and", 0xd0000000, 0xfe000000, Q_rS_rSr },
{ "sti_and3", 0xd0000000, 0xfe000000, Q_rS_Srr },
{ "sti_and3", 0xd0000000, 0xfe000000, Q_rS_rSr },
+ { "sti_ash", 0xd2000000, 0xfe000000, Q_rS_rSr },
{ "sti_ash3", 0xd2000000, 0xfe000000, Q_rS_rSr },
{ "sti_fix", 0xd4000000, 0xfe000000, Q_rS_Sr },
{ "sti_ldi", 0xda000000, 0xfe000000, Q_rS_Sr },
@@ -1007,9 +1013,9 @@ static const c4x_inst_t c3x_insts[] =
{ "xor3", 0x38000000, 0xffe00000, T_rJr }, /* C4x */
{ "xor3", 0x38200000, 0xffe00000, T_rRr }, /* C4x */
{ "xor3", 0x38200000, 0xffe00000, T_Rrr }, /* C4x */
- { "xor3", 0x3c400000, 0xffe00000, T_JRr }, /* C4x */
- { "xor3", 0x3c400000, 0xffe00000, T_RJr }, /* C4x */
- { "xor3", 0x3c600000, 0xffe00000, T_RRr }, /* C4x */
+ { "xor3", 0x38400000, 0xffe00000, T_JRr }, /* C4x */
+ { "xor3", 0x38400000, 0xffe00000, T_RJr }, /* C4x */
+ { "xor3", 0x38600000, 0xffe00000, T_RRr }, /* C4x */
/* Dummy entry, not included in c3x_num_insts. This
lets code examine entry i + 1 without checking
@@ -1025,6 +1031,8 @@ static const c4x_inst_t c4x_insts[] =
/* Parallel instructions. */
{ "frieee_stf", 0xf2000000, 0xfe000000, P_Sr_rS },
{ "toieee_stf", 0xf0000000, 0xfe000000, P_Sr_rS },
+ { "stf_frieee", 0xf2000000, 0xfe000000, Q_rS_Sr },
+ { "stf_toieee", 0xf0000000, 0xfe000000, Q_rS_Sr },
{ "bBaf", 0x68a00000, 0xffe00000, "Q" },
{ "bBaf", 0x6aa00000, 0xffe00000, "P" },
@@ -1038,12 +1046,10 @@ static const c4x_inst_t c4x_insts[] =
{ "lajB", 0x70200000, 0xffe00000, "Q" },
{ "lajB", 0x72200000, 0xffe00000, "P" },
{ "latB", 0x74800000, 0xffe00000, "V" },
-
{ "frieee", 0x1c000000, 0xffe00000, G_r_r },
{ "frieee", 0x1c200000, 0xffe00000, G_T_r },
{ "frieee", 0x1c400000, 0xffe00000, G_Q_r },
{ "frieee", 0x1c600000, 0xffe00000, G_F_r },
-
{ "lb0", 0xb0000000, 0xffe00000, G_r_r },
{ "lb0", 0xb0200000, 0xffe00000, G_T_r },
{ "lb0", 0xb0400000, 0xffe00000, G_Q_r },
diff --git a/include/partition.h b/include/partition.h
index 885a79b4ba3..5d3623f716e 100644
--- a/include/partition.h
+++ b/include/partition.h
@@ -78,4 +78,8 @@ extern void partition_print PARAMS((partition,
#define partition_find(partition__, element__) \
((partition__)->elements[(element__)].class_element)
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* _PARTITION_H */
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index bde129cda84..4a32a3b298a 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,13 @@
+2002-10-16 Jakub Jelinek <jakub@redhat.com>
+
+ * config.table: Use mh-s390pic for s390x too.
+
+2002-10-06 Andreas Jaeger <aj@suse.de>
+
+ * libiberty/cplus-dem.c (ada_demangle): Get rid of unneeded
+ variable and of strict-aliasing warning.
+ (grow_vect): Use char as first parameter.
+
2002-09-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (all): Fix multilib parallel build.
diff --git a/libiberty/config.table b/libiberty/config.table
index b9a2479aac7..df48ce99525 100644
--- a/libiberty/config.table
+++ b/libiberty/config.table
@@ -39,6 +39,7 @@ if [ "${shared}" = "yes" ]; then
powerpc*-*-aix*) ;;
powerpc*-*-*) frag=mh-ppcpic ;;
sparc*-*-*) frag=mh-sparcpic ;;
+ s390*-*-*) frag=mh-s390pic ;;
*) frag=mh-${host_cpu}pic ;;
esac
if [ -n "${frag}" ]; then
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 4c4778375b0..f42d6181d40 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -514,7 +514,7 @@ recursively_demangle PARAMS ((struct work_stuff *, const char **, string *,
int));
static void
-grow_vect PARAMS ((void **, size_t *, size_t, int));
+grow_vect PARAMS ((char **, size_t *, size_t, int));
/* Translate count to integer, consuming tokens in the process.
Conversion terminates on the first non-digit character.
@@ -936,7 +936,7 @@ cplus_demangle (mangled, options)
static void
grow_vect (old_vect, size, min_size, element_size)
- void **old_vect;
+ char **old_vect;
size_t *size;
size_t min_size;
int element_size;
@@ -969,8 +969,7 @@ ada_demangle (mangled, option)
char *demangled = NULL;
int at_start_name;
int changed;
- char *demangling_buffer = NULL;
- size_t demangling_buffer_size = 0;
+ size_t demangled_size = 0;
changed = 0;
@@ -998,10 +997,9 @@ ada_demangle (mangled, option)
}
/* Make demangled big enough for possible expansion by operator name. */
- grow_vect ((void **) &(demangling_buffer),
- &demangling_buffer_size, 2 * len0 + 1,
+ grow_vect (&demangled,
+ &demangled_size, 2 * len0 + 1,
sizeof (char));
- demangled = demangling_buffer;
if (ISDIGIT ((unsigned char) mangled[len0 - 1])) {
for (i = len0 - 2; i >= 0 && ISDIGIT ((unsigned char) mangled[i]); i -= 1)
@@ -1051,10 +1049,10 @@ ada_demangle (mangled, option)
return demangled;
Suppress:
- grow_vect ((void **) &(demangling_buffer),
- &demangling_buffer_size, strlen (mangled) + 3,
+ grow_vect (&demangled,
+ &demangled_size, strlen (mangled) + 3,
sizeof (char));
- demangled = demangling_buffer;
+
if (mangled[0] == '<')
strcpy (demangled, mangled);
else
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 6128a7d1cfa..7366e94e887 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,54 @@
+2002-11-12 Segher Boessenkool <segher@koffie.nl>
+
+ * ppc-dis.c (print_insn_powerpc): Correct condition register display.
+
+2002-11-07 Aldy Hernandez <aldyh@redhat.com>
+
+ * ppc-opc.c (EVUIMM_4): Change bit size to 32.
+ (EVUIMM_2): Same.
+ (EVUIMM_8): Same.
+
+2002-11-07 Klee Dienes <kdienes@apple.com>
+
+ * Makefile.am (ia64-asmtab.c): Update to use the new '--srcdir'
+ argument to ia64-gen.
+ Regenerate dependencies for ia64-len.lo.
+ * Makefile.in: Regenerate.
+ * ia64-gen.c: Convert to use getopt(). Add the standard GNU
+ options, as well as '--srcdir', which controls the directory in
+ which ia64-gen looks for the sources it uses to generate the
+ output table. Add a 'const' to the declaration of the final
+ output table. Call xmalloc_set_program_name to set the program
+ name.
+ * ia64-asmtab.c: Regenerate.
+
+2002-11-07 Nick Clifton <nickc@redhat.com>
+
+ * ia64-gen.c: Fix comment formatting and compile time warnings.
+ * ia64-opc-a.c: Fix compile time warnings.
+ * ia64-opc-b.c: Likewise.
+ * ia64-opc-d.c: Likewise.
+ * ia64-opc-f.c: Likewise.
+ * ia64-opc-i.c: Likewise.
+ * ia64-opc-m.c: Likewise.
+ * ia64-opc-x.c: Likewise.
+
+2002-11-06 Aldy Hernandez <aldyh@redhat.com>
+
+ * opcodes/ppc-opc.c: Change RD to RS for evmerge*.
+
+2002-10-07 Nathan Tallent <eraxxon@alumni.rice.edu>
+
+ * sparc-opc.c (sparc_opcodes) <fb, fba, fbe, fbz, fbg, fbge,
+ fbl, fble, fblg, fbn, fbne, fbnz, fbo, fbu, fbue, fbug, fbuge,
+ fbul, fbule>: Add conditional/unconditional branch
+ classification.
+
+2002-10-13 Stephane Carrez <stcarrez@nerim.fr>
+
+ * m68hc11-dis.c (print_insn): Treat bitmask and branch operands
+ at the end.
+
2002-09-30 Gavin Romig-Koch <gavin@redhat.com>
Ken Raeburn <raeburn@cygnus.com>
Aldy Hernandez <aldyh@redhat.com>
diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index ed6e8134e32..6bdfa36ca1c 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -403,7 +403,7 @@ ia64-gen.o: ia64-gen.c ia64-opc.c ia64-opc-a.c ia64-opc-b.c ia64-opc-f.c \
ia64-opc-i.c ia64-opc-m.c ia64-opc-d.c ia64-opc.h
ia64-asmtab.c: @MAINT@ ia64-gen ia64-ic.tbl ia64-raw.tbl ia64-waw.tbl ia64-war.tbl
- here=`pwd`; cd $(srcdir); $$here/ia64-gen > ia64-asmtab.c
+ ./ia64-gen --srcdir $(srcdir) > $(srcdir)/ia64-asmtab.c
s390-mkopc: s390-mkopc.c
$(CC_FOR_BUILD) -o s390-mkopc $(srcdir)/s390-mkopc.c
@@ -587,8 +587,8 @@ ia64-opc.lo: ia64-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
sysdep.h config.h ia64-asmtab.h $(INCDIR)/opcode/ia64.h \
$(BFD_H) $(INCDIR)/symcat.h ia64-asmtab.c
ia64-gen.lo: ia64-gen.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h sysdep.h config.h ia64-opc.h \
- $(INCDIR)/opcode/ia64.h $(BFD_H) $(INCDIR)/symcat.h \
+ $(INCDIR)/safe-ctype.h sysdep.h config.h $(INCDIR)/getopt.h \
+ ia64-opc.h $(INCDIR)/opcode/ia64.h $(BFD_H) $(INCDIR)/symcat.h \
ia64-opc-a.c ia64-opc-i.c ia64-opc-m.c ia64-opc-b.c \
ia64-opc-f.c ia64-opc-x.c ia64-opc-d.c
ia64-asmtab.lo: ia64-asmtab.c
diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in
index c4742303ebf..6d118021693 100644
--- a/opcodes/Makefile.in
+++ b/opcodes/Makefile.in
@@ -449,7 +449,7 @@ acinclude.m4 aclocal.m4 config.in configure configure.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
SOURCES = libopcodes.a.c $(libopcodes_la_SOURCES)
OBJECTS = libopcodes.a.$(OBJEXT) $(libopcodes_la_OBJECTS)
@@ -899,7 +899,7 @@ ia64-gen.o: ia64-gen.c ia64-opc.c ia64-opc-a.c ia64-opc-b.c ia64-opc-f.c \
ia64-opc-i.c ia64-opc-m.c ia64-opc-d.c ia64-opc.h
ia64-asmtab.c: @MAINT@ ia64-gen ia64-ic.tbl ia64-raw.tbl ia64-waw.tbl ia64-war.tbl
- here=`pwd`; cd $(srcdir); $$here/ia64-gen > ia64-asmtab.c
+ ./ia64-gen --srcdir $(srcdir) > $(srcdir)/ia64-asmtab.c
s390-mkopc: s390-mkopc.c
$(CC_FOR_BUILD) -o s390-mkopc $(srcdir)/s390-mkopc.c
@@ -1083,8 +1083,8 @@ ia64-opc.lo: ia64-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
sysdep.h config.h ia64-asmtab.h $(INCDIR)/opcode/ia64.h \
$(BFD_H) $(INCDIR)/symcat.h ia64-asmtab.c
ia64-gen.lo: ia64-gen.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h sysdep.h config.h ia64-opc.h \
- $(INCDIR)/opcode/ia64.h $(BFD_H) $(INCDIR)/symcat.h \
+ $(INCDIR)/safe-ctype.h sysdep.h config.h $(INCDIR)/getopt.h \
+ ia64-opc.h $(INCDIR)/opcode/ia64.h $(BFD_H) $(INCDIR)/symcat.h \
ia64-opc-a.c ia64-opc-i.c ia64-opc-m.c ia64-opc-b.c \
ia64-opc-f.c ia64-opc-x.c ia64-opc-d.c
ia64-asmtab.lo: ia64-asmtab.c
diff --git a/opcodes/ia64-asmtab.c b/opcodes/ia64-asmtab.c
index f007f71f073..399e2bc4054 100644
--- a/opcodes/ia64-asmtab.c
+++ b/opcodes/ia64-asmtab.c
@@ -1,5 +1,5 @@
-/* This file is automatically generated by ia64-gen. Do not edit! */
-static const char *ia64_strings[] = {
+/* This file is automatically generated by ia64-gen. Do not edit! */
+static const char * const ia64_strings[] = {
"", "0", "1", "a", "acq", "add", "addl", "addp4", "adds", "alloc", "and",
"andcm", "b", "bias", "br", "break", "brl", "brp", "bsw", "c", "call",
"cexit", "chk", "cloop", "clr", "clrrrb", "cmp", "cmp4", "cmpxchg1",
diff --git a/opcodes/ia64-gen.c b/opcodes/ia64-gen.c
index 6443c7c4b25..f6bfda00620 100644
--- a/opcodes/ia64-gen.c
+++ b/opcodes/ia64-gen.c
@@ -1,5 +1,5 @@
/* ia64-gen.c -- Generate a shrunk set of opcode tables
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Written by Bob Manson, Cygnus Solutions, <manson@cygnus.com>
This file is part of GDB, GAS, and the GNU binutils.
@@ -30,16 +30,17 @@
required.
The resource table is constructed based on some text dependency tables,
- which are also easier to maintain than the final representation.
-
-*/
+ which are also easier to maintain than the final representation. */
#include <stdio.h>
+#include <stdarg.h>
+#include <errno.h>
#include "ansidecl.h"
#include "libiberty.h"
#include "safe-ctype.h"
#include "sysdep.h"
+#include "getopt.h"
#include "ia64-opc.h"
#include "ia64-opc-a.c"
#include "ia64-opc-i.c"
@@ -49,49 +50,54 @@
#include "ia64-opc-x.c"
#include "ia64-opc-d.c"
+#include <libintl.h>
+#define _(String) gettext (String)
+
+const char * program_name = NULL;
int debug = 0;
#define tmalloc(X) (X *) xmalloc (sizeof (X))
/* The main opcode table entry. Each entry is a unique combination of
name and flags (no two entries in the table compare as being equal
- via opcodes_eq). */
+ via opcodes_eq). */
struct main_entry
{
/* The base name of this opcode. The names of its completers are
- appended to it to generate the full instruction name. */
+ appended to it to generate the full instruction name. */
struct string_entry *name;
/* The base opcode entry. Which one to use is a fairly arbitrary choice;
- it uses the first one passed to add_opcode_entry. */
+ it uses the first one passed to add_opcode_entry. */
struct ia64_opcode *opcode;
- /* The list of completers that can be applied to this opcode. */
+ /* The list of completers that can be applied to this opcode. */
struct completer_entry *completers;
- /* Next entry in the chain. */
+ /* Next entry in the chain. */
struct main_entry *next;
- /* Index in the main table. */
+ /* Index in the main table. */
int main_index;
} *maintable, **ordered_table;
+
int otlen = 0;
int ottotlen = 0;
int opcode_count = 0;
-/* The set of possible completers for an opcode. */
+/* The set of possible completers for an opcode. */
struct completer_entry
{
- /* This entry's index in the ia64_completer_table[] array. */
+ /* This entry's index in the ia64_completer_table[] array. */
int num;
- /* The name of the completer. */
+ /* The name of the completer. */
struct string_entry *name;
- /* This entry's parent. */
+ /* This entry's parent. */
struct completer_entry *parent;
/* Set if this is a terminal completer (occurs at the end of an
- opcode). */
+ opcode). */
int is_terminal;
- /* An alternative completer. */
+ /* An alternative completer. */
struct completer_entry *alternative;
/* Additional completers that can be appended to this one. */
@@ -100,53 +106,53 @@ struct completer_entry
/* Before compute_completer_bits () is invoked, this contains the actual
instruction opcode for this combination of opcode and completers.
Afterwards, it contains those bits that are different from its
- parent opcode. */
+ parent opcode. */
ia64_insn bits;
/* Bits set to 1 correspond to those bits in this completer's opcode
that are different from its parent completer's opcode (or from
the base opcode if the entry is the root of the opcode's completer
- list). This field is filled in by compute_completer_bits (). */
+ list). This field is filled in by compute_completer_bits (). */
ia64_insn mask;
- /* Index into the opcode dependency list, or -1 if none. */
+ /* Index into the opcode dependency list, or -1 if none. */
int dependencies;
/* Remember the order encountered in the opcode tables. */
int order;
};
-/* One entry in the disassembler name table. */
+/* One entry in the disassembler name table. */
struct disent
{
- /* The index into the ia64_name_dis array for this entry. */
+ /* The index into the ia64_name_dis array for this entry. */
int ournum;
- /* The index into the main_table[] array. */
+ /* The index into the main_table[] array. */
int insn;
- /* The disassmbly priority of this entry. */
+ /* The disassmbly priority of this entry. */
int priority;
- /* The completer_index value for this entry. */
+ /* The completer_index value for this entry. */
int completer_index;
- /* How many other entries share this decode. */
+ /* How many other entries share this decode. */
int nextcnt;
- /* The next entry sharing the same decode. */
+ /* The next entry sharing the same decode. */
struct disent *nexte;
- /* The next entry in the name list. */
+ /* The next entry in the name list. */
struct disent *next_ent;
} *disinsntable = NULL;
/* A state machine that will eventually be used to generate the
- disassembler table. */
+ disassembler table. */
struct bittree
{
struct disent *disent;
- struct bittree *bits[3]; /* 0, 1, and X (don't care) */
+ struct bittree *bits[3]; /* 0, 1, and X (don't care). */
int bits_to_skip;
int skip_flag;
} *bittree;
@@ -154,62 +160,63 @@ struct bittree
/* The string table contains all opcodes and completers sorted in
alphabetical order. */
-/* One entry in the string table. */
+/* One entry in the string table. */
struct string_entry
{
- /* The index in the ia64_strings[] array for this entry. */
+ /* The index in the ia64_strings[] array for this entry. */
int num;
- /* And the string. */
+ /* And the string. */
char *s;
} **string_table = NULL;
+
int strtablen = 0;
int strtabtotlen = 0;
-/* resource dependency entries */
+/* Resource dependency entries. */
struct rdep
{
- char *name; /* resource name */
+ char *name; /* Resource name. */
unsigned
- mode:2, /* RAW, WAW, or WAR */
- semantics:3; /* dependency semantics */
- char *extra; /* additional semantics info */
+ mode:2, /* RAW, WAW, or WAR. */
+ semantics:3; /* Dependency semantics. */
+ char *extra; /* Additional semantics info. */
int nchks;
- int total_chks; /* total #of terminal insns */
- int *chks; /* insn classes which read (RAW), write
- (WAW), or write (WAR) this rsrc */
- int *chknotes; /* dependency notes for each class */
+ int total_chks; /* Total #of terminal insns. */
+ int *chks; /* Insn classes which read (RAW), write
+ (WAW), or write (WAR) this rsrc. */
+ int *chknotes; /* Dependency notes for each class. */
int nregs;
- int total_regs; /* total #of terminal insns */
- int *regs; /* insn class which write (RAW), write2
- (WAW), or read (WAR) this rsrc */
- int *regnotes; /* dependency notes for each class */
+ int total_regs; /* Total #of terminal insns. */
+ int *regs; /* Insn class which write (RAW), write2
+ (WAW), or read (WAR) this rsrc. */
+ int *regnotes; /* Dependency notes for each class. */
- int waw_special; /* special WAW dependency note */
+ int waw_special; /* Special WAW dependency note. */
} **rdeps = NULL;
static int rdepslen = 0;
static int rdepstotlen = 0;
-/* array of all instruction classes */
+/* Array of all instruction classes. */
struct iclass
{
- char *name; /* instruction class name */
- int is_class; /* is a class, not a terminal */
+ char *name; /* Instruction class name. */
+ int is_class; /* Is a class, not a terminal. */
int nsubs;
- int *subs; /* other classes within this class */
+ int *subs; /* Other classes within this class. */
int nxsubs;
- int xsubs[4]; /* exclusions */
- char *comment; /* optional comment */
- int note; /* optional note */
- int terminal_resolved; /* did we match this with anything? */
- int orphan; /* detect class orphans */
+ int xsubs[4]; /* Exclusions. */
+ char *comment; /* Optional comment. */
+ int note; /* Optional note. */
+ int terminal_resolved; /* Did we match this with anything? */
+ int orphan; /* Detect class orphans. */
} **ics = NULL;
static int iclen = 0;
static int ictotlen = 0;
-/* an opcode dependency (chk/reg pair of dependency lists) */
+/* An opcode dependency (chk/reg pair of dependency lists). */
struct opdep
{
int chk; /* index into dlists */
@@ -219,7 +226,7 @@ struct opdep
static int opdeplen = 0;
static int opdeptotlen = 0;
-/* a generic list of dependencies w/notes encoded. these may be shared. */
+/* A generic list of dependencies w/notes encoded. These may be shared. */
struct deplist
{
int len;
@@ -229,7 +236,81 @@ struct deplist
static int dlistlen = 0;
static int dlisttotlen = 0;
-/* add NAME to the resource table, where TYPE is RAW or WAW */
+
+static void fail (const char *, ...);
+static void warn (const char *, ...);
+static struct rdep * insert_resource (const char *, enum ia64_dependency_mode);
+static int deplist_equals (struct deplist *, struct deplist *);
+static short insert_deplist (int, unsigned short *);
+static short insert_dependencies (int, unsigned short *, int, unsigned short *);
+static void mark_used (struct iclass *, int);
+static int fetch_insn_class (const char *, int);
+static int sub_compare (const void *, const void *);
+static void load_insn_classes (void);
+static void parse_resource_users (const char *, int **, int *, int **);
+static int parse_semantics (char *);
+static void add_dep (const char *, const char *, const char *, int, int, char *, int);
+static void load_depfile (const char *, enum ia64_dependency_mode);
+static void load_dependencies (void);
+static int irf_operand (int, const char *);
+static int in_iclass_mov_x (struct ia64_opcode *, struct iclass *, const char *, const char *);
+static int in_iclass (struct ia64_opcode *, struct iclass *, const char *, const char *, int *);
+static int lookup_regindex (const char *, int);
+static int lookup_specifier (const char *);
+static void print_dependency_table (void);
+static struct string_entry * insert_string (char *);
+static void gen_dis_table (struct bittree *);
+static void print_dis_table (void);
+static void generate_disassembler (void);
+static void print_string_table (void);
+static int completer_entries_eq (struct completer_entry *, struct completer_entry *);
+static struct completer_entry * insert_gclist (struct completer_entry *);
+static int get_prefix_len (const char *);
+static void compute_completer_bits (struct main_entry *, struct completer_entry *);
+static void collapse_redundant_completers (void);
+static int insert_opcode_dependencies (struct ia64_opcode *, struct completer_entry *);
+static void insert_completer_entry (struct ia64_opcode *, struct main_entry *, int);
+static void print_completer_entry (struct completer_entry *);
+static void print_completer_table (void);
+static int opcodes_eq (struct ia64_opcode *, struct ia64_opcode *);
+static void add_opcode_entry (struct ia64_opcode *);
+static void print_main_table (void);
+static void shrink (struct ia64_opcode *);
+static void print_version (void);
+static void usage (FILE *, int);
+static void finish_distable (void);
+static void insert_bit_table_ent (struct bittree *, int, ia64_insn, ia64_insn, int, int, int);
+static void add_dis_entry (struct bittree *, ia64_insn, ia64_insn, int, struct completer_entry *, int);
+static void compact_distree (struct bittree *);
+static struct bittree * make_bittree_entry (void);
+static struct disent * add_dis_table_ent (struct disent *, int, int, int);
+
+
+static void
+fail (const char *message, ...)
+{
+ va_list args;
+
+ va_start (args, message);
+ fprintf (stderr, _("%s: Error: "), program_name);
+ vfprintf (stderr, message, args);
+ va_end (args);
+ xexit (1);
+}
+
+static void
+warn (const char *message, ...)
+{
+ va_list args;
+
+ va_start (args, message);
+
+ fprintf (stderr, _("%s: Warning: "), program_name);
+ vfprintf (stderr, message, args);
+ va_end (args);
+}
+
+/* Add NAME to the resource table, where TYPE is RAW or WAW. */
static struct rdep *
insert_resource (const char *name, enum ia64_dependency_mode type)
{
@@ -248,7 +329,7 @@ insert_resource (const char *name, enum ia64_dependency_mode type)
return rdeps[rdepslen++];
}
-/* are the lists of dependency indexes equivalent? */
+/* Are the lists of dependency indexes equivalent? */
static int
deplist_equals (struct deplist *d1, struct deplist *d2)
{
@@ -257,55 +338,48 @@ deplist_equals (struct deplist *d1, struct deplist *d2)
if (d1->len != d2->len)
return 0;
- for (i=0;i < d1->len;i++)
- {
- if (d1->deps[i] != d2->deps[i])
- return 0;
- }
+ for (i = 0; i < d1->len; i++)
+ if (d1->deps[i] != d2->deps[i])
+ return 0;
return 1;
}
-/* add the list of dependencies to the list of dependency lists */
+/* Add the list of dependencies to the list of dependency lists. */
static short
-insert_deplist(int count, unsigned short *deps)
+insert_deplist (int count, unsigned short *deps)
{
- /* sort the list, then see if an equivalent list exists already.
- this results in a much smaller set of dependency lists
- */
+ /* Sort the list, then see if an equivalent list exists already.
+ this results in a much smaller set of dependency lists. */
struct deplist *list;
char set[0x10000];
int i;
- memset ((void *)set, 0, sizeof(set));
- for (i=0;i < count;i++)
+ memset ((void *)set, 0, sizeof (set));
+ for (i = 0; i < count; i++)
set[deps[i]] = 1;
+
count = 0;
- for (i=0;i < (int)sizeof(set);i++)
+ for (i = 0; i < (int) sizeof (set); i++)
if (set[i])
++count;
- list = tmalloc(struct deplist);
+ list = tmalloc (struct deplist);
list->len = count;
- list->deps = (unsigned short *)malloc (sizeof(unsigned short) * count);
- for (i=0, count=0;i < (int)sizeof(set);i++)
- {
- if (set[i])
- {
- list->deps[count++] = i;
- }
- }
+ list->deps = (unsigned short *) malloc (sizeof (unsigned short) * count);
- /* does this list exist already? */
- for (i=0;i < dlistlen;i++)
- {
- if (deplist_equals (list, dlists[i]))
- {
- free (list->deps);
- free (list);
- return i;
- }
- }
+ for (i = 0, count = 0; i < (int) sizeof (set); i++)
+ if (set[i])
+ list->deps[count++] = i;
+
+ /* Does this list exist already? */
+ for (i = 0; i < dlistlen; i++)
+ if (deplist_equals (list, dlists[i]))
+ {
+ free (list->deps);
+ free (list);
+ return i;
+ }
if (dlistlen == dlisttotlen)
{
@@ -318,7 +392,7 @@ insert_deplist(int count, unsigned short *deps)
return dlistlen++;
}
-/* add the given pair of dependency lists to the opcode dependency list */
+/* Add the given pair of dependency lists to the opcode dependency list. */
static short
insert_dependencies (int nchks, unsigned short *chks,
int nregs, unsigned short *regs)
@@ -333,13 +407,12 @@ insert_dependencies (int nchks, unsigned short *chks,
if (nchks > 0)
chkind = insert_deplist (nchks, chks);
- for (i=0;i < opdeplen;i++)
- {
- if (opdeps[i]->chk == chkind
- && opdeps[i]->reg == regind)
- return i;
- }
- pair = tmalloc(struct opdep);
+ for (i = 0; i < opdeplen; i++)
+ if (opdeps[i]->chk == chkind
+ && opdeps[i]->reg == regind)
+ return i;
+
+ pair = tmalloc (struct opdep);
pair->chk = chkind;
pair->reg = regind;
@@ -363,20 +436,17 @@ mark_used (struct iclass *ic, int clear_terminals)
if (clear_terminals)
ic->terminal_resolved = 1;
- for (i=0;i < ic->nsubs;i++)
- {
- mark_used (ics[ic->subs[i]], clear_terminals);
- }
- for (i=0;i < ic->nxsubs;i++)
- {
- mark_used (ics[ic->xsubs[i]], clear_terminals);
- }
+ for (i = 0; i < ic->nsubs; i++)
+ mark_used (ics[ic->subs[i]], clear_terminals);
+
+ for (i = 0; i < ic->nxsubs; i++)
+ mark_used (ics[ic->xsubs[i]], clear_terminals);
}
-/* look up an instruction class; if CREATE make a new one if none found;
- returns the index into the insn class array */
+/* Look up an instruction class; if CREATE make a new one if none found;
+ returns the index into the insn class array. */
static int
-fetch_insn_class(const char *full_name, int create)
+fetch_insn_class (const char *full_name, int create)
{
char *name;
char *notestr;
@@ -414,14 +484,14 @@ fetch_insn_class(const char *full_name, int create)
if (notestr)
{
char *nextnotestr;
+
note = atoi (notestr + 1);
if ((nextnotestr = strchr (notestr + 1, '+')) != NULL)
{
if (strcmp (notestr, "+1+13") == 0)
note = 13;
else if (!xsect || nextnotestr < xsect)
- fprintf (stderr, "Warning: multiple note %s not handled\n",
- notestr);
+ warn (_("multiple note %s not handled\n"), notestr);
}
}
@@ -436,8 +506,8 @@ fetch_insn_class(const char *full_name, int create)
*comment = 0;
}
- for (i=0;i < iclen;i++)
- if (strcmp(name, ics[i]->name) == 0
+ for (i = 0; i < iclen; i++)
+ if (strcmp (name, ics[i]->name) == 0
&& ((comment == NULL && ics[i]->comment == NULL)
|| (comment != NULL && ics[i]->comment != NULL
&& strncmp (ics[i]->comment, comment,
@@ -448,40 +518,44 @@ fetch_insn_class(const char *full_name, int create)
if (!create)
return -1;
- /* doesn't exist, so make a new one */
+ /* Doesn't exist, so make a new one. */
if (iclen == ictotlen)
{
ictotlen += 20;
ics = (struct iclass **)
- xrealloc(ics, (ictotlen)*sizeof(struct iclass *));
+ xrealloc (ics, (ictotlen) * sizeof (struct iclass *));
}
+
ind = iclen++;
- ics[ind] = tmalloc(struct iclass);
- memset((void *)ics[ind], 0, sizeof(struct iclass));
- ics[ind]->name = xstrdup(name);
+ ics[ind] = tmalloc (struct iclass);
+ memset ((void *)ics[ind], 0, sizeof (struct iclass));
+ ics[ind]->name = xstrdup (name);
ics[ind]->is_class = is_class;
ics[ind]->orphan = 1;
if (comment)
{
ics[ind]->comment = xstrdup (comment + 1);
- ics[ind]->comment[strlen(ics[ind]->comment)-1] = 0;
+ ics[ind]->comment[strlen (ics[ind]->comment)-1] = 0;
}
+
if (notestr)
ics[ind]->note = note;
- /* if it's a composite class, there's a comment or note, look for an
- existing class or terminal with the same name. */
+ /* If it's a composite class, there's a comment or note, look for an
+ existing class or terminal with the same name. */
if ((xsect || comment || notestr) && is_class)
{
/* First, populate with the class we're based on. */
char *subname = name;
+
if (xsect)
*xsect = 0;
else if (comment)
*comment = 0;
else if (notestr)
*notestr = 0;
+
ics[ind]->nsubs = 1;
ics[ind]->subs = tmalloc(int);
ics[ind]->subs[0] = fetch_insn_class (subname, 1);;
@@ -490,6 +564,7 @@ fetch_insn_class(const char *full_name, int create)
while (xsect)
{
char *subname = xsect + 1;
+
xsect = strchr (subname, '\\');
if (xsect)
*xsect = 0;
@@ -501,8 +576,8 @@ fetch_insn_class(const char *full_name, int create)
return ind;
}
-/* for sorting a class's sub-class list only; make sure classes appear before
- terminals */
+/* For sorting a class's sub-class list only; make sure classes appear before
+ terminals. */
static int
sub_compare (const void *e1, const void *e2)
{
@@ -521,41 +596,39 @@ sub_compare (const void *e1, const void *e2)
}
static void
-load_insn_classes()
+load_insn_classes (void)
{
- FILE *fp = fopen("ia64-ic.tbl", "r");
+ FILE *fp = fopen ("ia64-ic.tbl", "r");
char buf[2048];
- if (fp == NULL){
- fprintf (stderr, "Can't find ia64-ic.tbl for reading\n");
- exit(1);
- }
+ if (fp == NULL)
+ fail (_("can't find ia64-ic.tbl for reading\n"));
- /* discard first line */
+ /* Discard first line. */
fgets (buf, sizeof(buf), fp);
- while (!feof(fp))
+ while (!feof (fp))
{
int iclass;
char *name;
char *tmp;
- if (fgets (buf, sizeof(buf), fp) == NULL)
+ if (fgets (buf, sizeof (buf), fp) == NULL)
break;
- while (ISSPACE (buf[strlen(buf)-1]))
- buf[strlen(buf)-1] = '\0';
+ while (ISSPACE (buf[strlen (buf) - 1]))
+ buf[strlen (buf) - 1] = '\0';
name = tmp = buf;
while (*tmp != ';')
{
++tmp;
- if (tmp == buf + sizeof(buf))
+ if (tmp == buf + sizeof (buf))
abort ();
}
*tmp++ = '\0';
- iclass = fetch_insn_class(name, 1);
+ iclass = fetch_insn_class (name, 1);
ics[iclass]->is_class = 1;
if (strcmp (name, "none") == 0)
@@ -565,7 +638,7 @@ load_insn_classes()
continue;
}
- /* for this class, record all sub-classes */
+ /* For this class, record all sub-classes. */
while (*tmp)
{
char *subname;
@@ -574,44 +647,43 @@ load_insn_classes()
while (*tmp && ISSPACE (*tmp))
{
++tmp;
- if (tmp == buf + sizeof(buf))
- abort();
+ if (tmp == buf + sizeof (buf))
+ abort ();
}
subname = tmp;
while (*tmp && *tmp != ',')
{
++tmp;
- if (tmp == buf + sizeof(buf))
- abort();
+ if (tmp == buf + sizeof (buf))
+ abort ();
}
if (*tmp == ',')
*tmp++ = '\0';
ics[iclass]->subs = (int *)
- xrealloc((void *)ics[iclass]->subs,
- (ics[iclass]->nsubs+1)*sizeof(int));
+ xrealloc ((void *)ics[iclass]->subs,
+ (ics[iclass]->nsubs + 1) * sizeof (int));
- sub = fetch_insn_class(subname, 1);
+ sub = fetch_insn_class (subname, 1);
ics[iclass]->subs = (int *)
- xrealloc(ics[iclass]->subs, (ics[iclass]->nsubs+1)*sizeof(int));
+ xrealloc (ics[iclass]->subs, (ics[iclass]->nsubs + 1) * sizeof (int));
ics[iclass]->subs[ics[iclass]->nsubs++] = sub;
}
- /* make sure classes come before terminals */
+
+ /* Make sure classes come before terminals. */
qsort ((void *)ics[iclass]->subs,
ics[iclass]->nsubs, sizeof(int), sub_compare);
}
- fclose(fp);
+ fclose (fp);
if (debug)
- {
- printf ("%d classes\n", iclen);
- }
+ printf ("%d classes\n", iclen);
}
-/* extract the insn classes from the given line */
+/* Extract the insn classes from the given line. */
static void
-parse_resource_users(ref, usersp, nusersp, notesp)
- char *ref;
+parse_resource_users (ref, usersp, nusersp, notesp)
+ const char *ref;
int **usersp;
int *nusersp;
int **notesp;
@@ -641,53 +713,49 @@ parse_resource_users(ref, usersp, nusersp, notesp)
c = *tmp;
*tmp++ = '\0';
- xsect = strchr(name, '\\');
- if ((notestr = strstr(name, "+")) != NULL)
+ xsect = strchr (name, '\\');
+ if ((notestr = strstr (name, "+")) != NULL)
{
char *nextnotestr;
+
note = atoi (notestr + 1);
if ((nextnotestr = strchr (notestr + 1, '+')) != NULL)
{
- /* note 13 always implies note 1 */
+ /* Note 13 always implies note 1. */
if (strcmp (notestr, "+1+13") == 0)
note = 13;
else if (!xsect || nextnotestr < xsect)
- fprintf (stderr, "Warning: multiple note %s not handled\n",
- notestr);
+ warn (_("multiple note %s not handled\n"), notestr);
}
if (!xsect)
*notestr = '\0';
}
else
note = 0;
-
+
/* All classes are created when the insn class table is parsed;
Individual instructions might not appear until the dependency tables
are read. Only create new classes if it's *not* an insn class,
or if it's a composite class (which wouldn't necessarily be in the IC
- table).
- */
- if (strncmp(name, "IC:", 3) != 0 || xsect != NULL)
+ table). */
+ if (strncmp (name, "IC:", 3) != 0 || xsect != NULL)
create = 1;
- iclass = fetch_insn_class(name, create);
+ iclass = fetch_insn_class (name, create);
if (iclass != -1)
{
users = (int *)
- xrealloc ((void *)users,(count+1)*sizeof(int));
+ xrealloc ((void *) users,(count + 1) * sizeof (int));
notes = (int *)
- xrealloc ((void *)notes,(count+1)*sizeof(int));
+ xrealloc ((void *) notes,(count + 1) * sizeof (int));
notes[count] = note;
users[count++] = iclass;
mark_used (ics[iclass], 0);
}
- else
- {
- if (debug)
- printf("Class %s not found\n", name);
- }
+ else if (debug)
+ printf("Class %s not found\n", name);
}
- /* update the return values */
+ /* Update the return values. */
*usersp = users;
*nusersp = count;
*notesp = notes;
@@ -723,10 +791,10 @@ add_dep (const char *name, const char *chk, const char *reg,
struct rdep *rs;
rs = insert_resource (name, mode);
- parse_resource_users (chk, &rs->chks, &rs->nchks,
- &rs->chknotes);
- parse_resource_users (reg, &rs->regs, &rs->nregs,
- &rs->regnotes);
+
+ parse_resource_users (chk, &rs->chks, &rs->nchks, &rs->chknotes);
+ parse_resource_users (reg, &rs->regs, &rs->nregs, &rs->regnotes);
+
rs->semantics = semantics;
rs->extra = extra;
rs->waw_special = flag;
@@ -735,16 +803,14 @@ add_dep (const char *name, const char *chk, const char *reg,
static void
load_depfile (const char *filename, enum ia64_dependency_mode mode)
{
- FILE *fp = fopen(filename, "r");
+ FILE *fp = fopen (filename, "r");
char buf[1024];
- if (fp == NULL){
- fprintf (stderr, "Can't find %s for reading\n", filename);
- exit(1);
- }
+ if (fp == NULL)
+ fail (_("can't find %s for reading\n"), filename);
- fgets(buf, sizeof(buf), fp);
- while (!feof(fp))
+ fgets (buf, sizeof(buf), fp);
+ while (!feof (fp))
{
char *name, *tmp;
int semantics;
@@ -754,8 +820,8 @@ load_depfile (const char *filename, enum ia64_dependency_mode mode)
if (fgets (buf, sizeof(buf), fp) == NULL)
break;
- while (ISSPACE (buf[strlen(buf)-1]))
- buf[strlen(buf)-1] = '\0';
+ while (ISSPACE (buf[strlen (buf) - 1]))
+ buf[strlen (buf) - 1] = '\0';
name = tmp = buf;
while (*tmp != ';')
@@ -783,7 +849,7 @@ load_depfile (const char *filename, enum ia64_dependency_mode mode)
/* For WAW entries, if the chks and regs differ, we need to enter the
entries in both positions so that the tables will be parsed properly,
- without a lot of extra work */
+ without a lot of extra work. */
if (mode == IA64_DV_WAW && strcmp (regp, chkp) != 0)
{
add_dep (name, chkp, regp, semantics, mode, extra, 0);
@@ -794,21 +860,21 @@ load_depfile (const char *filename, enum ia64_dependency_mode mode)
add_dep (name, chkp, regp, semantics, mode, extra, 0);
}
}
- fclose(fp);
+ fclose (fp);
}
static void
-load_dependencies()
+load_dependencies (void)
{
load_depfile ("ia64-raw.tbl", IA64_DV_RAW);
load_depfile ("ia64-waw.tbl", IA64_DV_WAW);
load_depfile ("ia64-war.tbl", IA64_DV_WAR);
if (debug)
- printf ("%d RAW/WAW/WAR dependencies\n", rdepslen);
+ printf ("%d RAW/WAW/WAR dependencies\n", rdepslen);
}
-/* is the given operand an indirect register file operand? */
+/* Is the given operand an indirect register file operand? */
static int
irf_operand (int op, const char *field)
{
@@ -832,8 +898,8 @@ irf_operand (int op, const char *field)
}
}
-/* handle mov_ar, mov_br, mov_cr, mov_indirect, mov_ip, mov_pr, mov_psr, and
- mov_um insn classes */
+/* Handle mov_ar, mov_br, mov_cr, mov_indirect, mov_ip, mov_pr, mov_psr, and
+ mov_um insn classes. */
static int
in_iclass_mov_x (struct ia64_opcode *idesc, struct iclass *ic,
const char *format, const char *field)
@@ -947,11 +1013,10 @@ in_iclass_mov_x (struct ia64_opcode *idesc, struct iclass *ic,
return 0;
}
-
-/* is the given opcode in the given insn class? */
+/* Is the given opcode in the given insn class? */
static int
-in_iclass(struct ia64_opcode *idesc, struct iclass *ic,
- const char *format, const char *field, int *notep)
+in_iclass (struct ia64_opcode *idesc, struct iclass *ic,
+ const char *format, const char *field, int *notep)
{
int i;
int resolved = 0;
@@ -960,15 +1025,14 @@ in_iclass(struct ia64_opcode *idesc, struct iclass *ic,
{
if (!strncmp (ic->comment, "Format", 6))
{
- /* assume that the first format seen is the most restrictive, and
- only keep a later one if it looks like it's more restrictive. */
+ /* Assume that the first format seen is the most restrictive, and
+ only keep a later one if it looks like it's more restrictive. */
if (format)
{
if (strlen (ic->comment) < strlen (format))
{
- fprintf (stderr, "Warning: most recent format '%s'\n"
- "appears more restrictive than '%s'\n",
- ic->comment, format);
+ warn (_("most recent format '%s'\nappears more restrictive than '%s'\n"),
+ ic->comment, format);
format = ic->comment;
}
}
@@ -978,15 +1042,15 @@ in_iclass(struct ia64_opcode *idesc, struct iclass *ic,
else if (!strncmp (ic->comment, "Field", 5))
{
if (field)
- fprintf (stderr, "Overlapping field %s->%s\n",
- ic->comment, field);
+ warn (_("overlapping field %s->%s\n"),
+ ic->comment, field);
field = ic->comment;
}
}
- /* an insn class matches anything that is the same followed by completers,
+ /* An insn class matches anything that is the same followed by completers,
except when the absence and presence of completers constitutes different
- instructions */
+ instructions. */
if (ic->nsubs == 0 && ic->nxsubs == 0)
{
int is_mov = strncmp (idesc->name, "mov", 3) == 0;
@@ -997,26 +1061,25 @@ in_iclass(struct ia64_opcode *idesc, struct iclass *ic,
&& (idesc->name[len] == '\0'
|| idesc->name[len] == '.'));
- /* all break and nop variations must match exactly */
+ /* All break and nop variations must match exactly. */
if (resolved &&
(strcmp (ic->name, "break") == 0
|| strcmp (ic->name, "nop") == 0))
resolved = strcmp (ic->name, idesc->name) == 0;
- /* assume restrictions in the FORMAT/FIELD negate resolution,
- unless specifically allowed by clauses in this block */
+ /* Assume restrictions in the FORMAT/FIELD negate resolution,
+ unless specifically allowed by clauses in this block. */
if (resolved && field)
{
- /* check Field(sf)==sN against opcode sN */
+ /* Check Field(sf)==sN against opcode sN. */
if (strstr(field, "(sf)==") != NULL)
{
char *sf;
+
if ((sf = strstr (idesc->name, ".s")) != 0)
- {
- resolved = strcmp (sf + 1, strstr (field, "==") + 2) == 0;
- }
+ resolved = strcmp (sf + 1, strstr (field, "==") + 2) == 0;
}
- /* check Field(lftype)==XXX */
+ /* Check Field(lftype)==XXX. */
else if (strstr (field, "(lftype)") != NULL)
{
if (strstr (idesc->name, "fault") != NULL)
@@ -1024,7 +1087,7 @@ in_iclass(struct ia64_opcode *idesc, struct iclass *ic,
else
resolved = strstr (field, "fault") == NULL;
}
- /* handle Field(ctype)==XXX */
+ /* Handle Field(ctype)==XXX. */
else if (strstr (field, "(ctype)") != NULL)
{
if (strstr (idesc->name, "or.andcm"))
@@ -1045,6 +1108,7 @@ in_iclass(struct ia64_opcode *idesc, struct iclass *ic,
resolved = strcmp (field, "Field(ctype)==") == 0;
}
}
+
if (resolved && format)
{
if (strncmp (idesc->name, "dep", 3) == 0
@@ -1075,8 +1139,8 @@ in_iclass(struct ia64_opcode *idesc, struct iclass *ic,
resolved = 0;
}
- /* misc brl variations ('.cond' is optional);
- plain brl matches brl.cond */
+ /* Misc brl variations ('.cond' is optional);
+ plain brl matches brl.cond. */
if (!resolved
&& (strcmp (idesc->name, "brl") == 0
|| strncmp (idesc->name, "brl.", 4) == 0)
@@ -1085,7 +1149,7 @@ in_iclass(struct ia64_opcode *idesc, struct iclass *ic,
resolved = 1;
}
- /* misc br variations ('.cond' is optional) */
+ /* Misc br variations ('.cond' is optional). */
if (!resolved
&& (strcmp (idesc->name, "br") == 0
|| strncmp (idesc->name, "br.", 3) == 0)
@@ -1100,81 +1164,77 @@ in_iclass(struct ia64_opcode *idesc, struct iclass *ic,
resolved = 1;
}
- /* probe variations */
+ /* probe variations. */
if (!resolved && strncmp (idesc->name, "probe", 5) == 0)
{
resolved = strcmp (ic->name, "probe") == 0
&& !((strstr (idesc->name, "fault") != NULL)
^ (format && strstr (format, "M40") != NULL));
}
- /* mov variations */
+
+ /* mov variations. */
if (!resolved && is_mov)
{
if (plain_mov)
{
- /* mov alias for fmerge */
+ /* mov alias for fmerge. */
if (strcmp (ic->name, "fmerge") == 0)
{
resolved = idesc->operands[0] == IA64_OPND_F1
&& idesc->operands[1] == IA64_OPND_F3;
}
- /* mov alias for adds (r3 or imm14) */
+ /* mov alias for adds (r3 or imm14). */
else if (strcmp (ic->name, "adds") == 0)
{
resolved = (idesc->operands[0] == IA64_OPND_R1
&& (idesc->operands[1] == IA64_OPND_R3
|| (idesc->operands[1] == IA64_OPND_IMM14)));
}
- /* mov alias for addl */
+ /* mov alias for addl. */
else if (strcmp (ic->name, "addl") == 0)
{
resolved = idesc->operands[0] == IA64_OPND_R1
&& idesc->operands[1] == IA64_OPND_IMM22;
}
}
- /* some variants of mov and mov.[im] */
+
+ /* Some variants of mov and mov.[im]. */
if (!resolved && strncmp (ic->name, "mov_", 4) == 0)
- {
- resolved = in_iclass_mov_x (idesc, ic, format, field);
- }
+ resolved = in_iclass_mov_x (idesc, ic, format, field);
}
- /* keep track of this so we can flag any insn classes which aren't
- mapped onto at least one real insn */
+ /* Keep track of this so we can flag any insn classes which aren't
+ mapped onto at least one real insn. */
if (resolved)
- {
- ic->terminal_resolved = 1;
- }
+ ic->terminal_resolved = 1;
}
- else for (i=0;i < ic->nsubs;i++)
+ else for (i = 0; i < ic->nsubs; i++)
{
- if (in_iclass(idesc, ics[ic->subs[i]], format, field, notep))
+ if (in_iclass (idesc, ics[ic->subs[i]], format, field, notep))
{
int j;
- for (j=0;j < ic->nxsubs;j++)
- {
- if (in_iclass(idesc, ics[ic->xsubs[j]], NULL, NULL, NULL))
- return 0;
- }
+
+ for (j = 0; j < ic->nxsubs; j++)
+ if (in_iclass (idesc, ics[ic->xsubs[j]], NULL, NULL, NULL))
+ return 0;
+
if (debug > 1)
- printf ("%s is in IC %s\n",
- idesc->name, ic->name);
+ printf ("%s is in IC %s\n", idesc->name, ic->name);
+
resolved = 1;
break;
}
}
- /* If it's in this IC, add the IC note (if any) to the insn */
+ /* If it's in this IC, add the IC note (if any) to the insn. */
if (resolved)
{
if (ic->note && notep)
{
if (*notep && *notep != ic->note)
- {
- fprintf (stderr, "Warning: overwriting note %d with note %d"
- "(IC:%s)\n",
- *notep, ic->note, ic->name);
- }
+ warn (_("overwriting note %d with note %d (IC:%s)\n"),
+ *notep, ic->note, ic->name);
+
*notep = ic->note;
}
}
@@ -1355,8 +1415,8 @@ lookup_specifier (const char *name)
if (strstr (name, "PR%, % in 16 ") != NULL)
return IA64_RS_PRr;
- fprintf (stderr, "Warning! Don't know how to specify %% dependency %s\n",
- name);
+ warn (_("don't know how to specify %% dependency %s\n"),
+ name);
}
else if (strchr (name, '#'))
{
@@ -1377,8 +1437,8 @@ lookup_specifier (const char *name)
if (strstr (name, "RR#") != NULL)
return IA64_RS_RR;
- fprintf (stderr, "Warning! Don't know how to specify # dependency %s\n",
- name);
+ warn (_("Don't know how to specify # dependency %s\n"),
+ name);
}
else if (strncmp (name, "AR[FPSR]", 8) == 0)
return IA64_RS_AR_FPSR;
@@ -1402,7 +1462,7 @@ lookup_specifier (const char *name)
return IA64_RS_ANY;
}
-void
+static void
print_dependency_table ()
{
int i, j;
@@ -1415,58 +1475,59 @@ print_dependency_table ()
{
if (!ics[i]->nsubs)
{
- fprintf (stderr, "Warning: IC:%s", ics[i]->name);
if (ics[i]->comment)
- fprintf (stderr, "[%s]", ics[i]->comment);
- fprintf (stderr, " has no terminals or sub-classes\n");
+ warn (_("IC:%s [%s] has no terminals or sub-classes\n"),
+ ics[i]->name, ics[i]->comment);
+ else
+ warn (_("IC:%s has no terminals or sub-classes\n"),
+ ics[i]->name);
}
}
else
{
if (!ics[i]->terminal_resolved && !ics[i]->orphan)
{
- fprintf(stderr, "Warning: no insns mapped directly to "
- "terminal IC %s", ics[i]->name);
if (ics[i]->comment)
- fprintf(stderr, "[%s] ", ics[i]->comment);
- fprintf(stderr, "\n");
+ warn (_("no insns mapped directly to terminal IC %s [%s]"),
+ ics[i]->name, ics[i]->comment);
+ else
+ warn (_("no insns mapped directly to terminal IC %s\n"),
+ ics[i]->name);
}
}
}
- for (i=0;i < iclen;i++)
+ for (i = 0; i < iclen; i++)
{
if (ics[i]->orphan)
{
mark_used (ics[i], 1);
- fprintf (stderr, "Warning: class %s is defined but not used\n",
- ics[i]->name);
+ warn (_("class %s is defined but not used\n"),
+ ics[i]->name);
}
}
- if (debug > 1) for (i=0;i < rdepslen;i++)
- {
- static const char *mode_str[] = { "RAW", "WAW", "WAR" };
- if (rdeps[i]->total_chks == 0)
- {
- fprintf (stderr, "Warning: rsrc %s (%s) has no chks%s\n",
- rdeps[i]->name, mode_str[rdeps[i]->mode],
- rdeps[i]->total_regs ? "" : " or regs");
- }
- else if (rdeps[i]->total_regs == 0)
- {
- fprintf (stderr, "Warning: rsrc %s (%s) has no regs\n",
- rdeps[i]->name, mode_str[rdeps[i]->mode]);
- }
- }
+ if (debug > 1)
+ for (i = 0; i < rdepslen; i++)
+ {
+ static const char *mode_str[] = { "RAW", "WAW", "WAR" };
+
+ if (rdeps[i]->total_chks == 0)
+ warn (_("Warning: rsrc %s (%s) has no chks%s\n"),
+ rdeps[i]->name, mode_str[rdeps[i]->mode],
+ rdeps[i]->total_regs ? "" : " or regs");
+ else if (rdeps[i]->total_regs == 0)
+ warn (_("rsrc %s (%s) has no regs\n"),
+ rdeps[i]->name, mode_str[rdeps[i]->mode]);
+ }
}
- /* the dependencies themselves */
+ /* The dependencies themselves. */
printf ("static const struct ia64_dependency\ndependencies[] = {\n");
- for (i=0;i < rdepslen;i++)
+ for (i = 0; i < rdepslen; i++)
{
/* '%', '#', AR[], CR[], or PSR. indicates we need to specify the actual
- resource used */
+ resource used. */
int specifier = lookup_specifier (rdeps[i]->name);
int regindex = lookup_regindex (rdeps[i]->name, specifier);
@@ -1481,7 +1542,7 @@ print_dependency_table ()
}
printf ("};\n\n");
- /* and dependency lists */
+ /* And dependency lists. */
for (i=0;i < dlistlen;i++)
{
int len = 2;
@@ -1498,11 +1559,11 @@ print_dependency_table ()
printf ("\n};\n\n");
}
- /* and opcode dependency list */
+ /* And opcode dependency list. */
printf ("#define NELS(X) (sizeof(X)/sizeof(X[0]))\n");
printf ("static const struct ia64_opcode_dependency\n");
printf ("op_dependencies[] = {\n");
- for (i=0;i < opdeplen;i++)
+ for (i = 0; i < opdeplen; i++)
{
printf (" { ");
if (opdeps[i]->chk == -1)
@@ -1519,11 +1580,9 @@ print_dependency_table ()
}
-/* Add STR to the string table. */
-
+/* Add STR to the string table. */
static struct string_entry *
-insert_string (str)
- char *str;
+insert_string (char *str)
{
int start = 0, end = strtablen;
int i, x;
@@ -1546,13 +1605,9 @@ insert_string (str)
}
if (strcmp (str, string_table[strtablen - 1]->s) > 0)
- {
- i = end;
- }
+ i = end;
else if (strcmp (str, string_table[0]->s) < 0)
- {
- i = 0;
- }
+ i = 0;
else
{
while (1)
@@ -1561,52 +1616,43 @@ insert_string (str)
i = (start + end) / 2;
c = strcmp (str, string_table[i]->s);
+
if (c < 0)
- {
- end = i - 1;
- }
+ end = i - 1;
else if (c == 0)
- {
- return string_table[i];
- }
+ return string_table[i];
else
- {
- start = i + 1;
- }
+ start = i + 1;
+
if (start > end)
- {
- break;
- }
+ break;
}
}
+
for (; i > 0 && i < strtablen; i--)
- {
- if (strcmp (str, string_table[i - 1]->s) > 0)
- {
- break;
- }
- }
+ if (strcmp (str, string_table[i - 1]->s) > 0)
+ break;
+
for (; i < strtablen; i++)
- {
- if (strcmp (str, string_table[i]->s) < 0)
- {
- break;
- }
- }
+ if (strcmp (str, string_table[i]->s) < 0)
+ break;
+
for (x = strtablen - 1; x >= i; x--)
{
string_table[x + 1] = string_table[x];
string_table[x + 1]->num = x + 1;
}
+
string_table[i] = tmalloc (struct string_entry);
string_table[i]->s = xstrdup (str);
string_table[i]->num = i;
strtablen++;
+
return string_table[i];
}
-struct bittree *
-make_bittree_entry ()
+static struct bittree *
+make_bittree_entry (void)
{
struct bittree *res = tmalloc (struct bittree);
@@ -1618,8 +1664,9 @@ make_bittree_entry ()
res->bits_to_skip = 0;
return res;
}
+
-struct disent *
+static struct disent *
add_dis_table_ent (which, insn, order, completer_index)
struct disent *which;
int insn;
@@ -1635,9 +1682,8 @@ add_dis_table_ent (which, insn, order, completer_index)
ent->nextcnt++;
while (ent->nexte != NULL)
- {
- ent = ent->nexte;
- }
+ ent = ent->nexte;
+
ent = (ent->nexte = tmalloc (struct disent));
}
else
@@ -1661,7 +1707,7 @@ add_dis_table_ent (which, insn, order, completer_index)
return which;
}
-void
+static void
finish_distable ()
{
struct disent *ent = disinsntable;
@@ -1675,7 +1721,7 @@ finish_distable ()
}
}
-void
+static void
insert_bit_table_ent (curr_ent, bit, opcode, mask,
opcodenum, order, completer_index)
struct bittree *curr_ent;
@@ -1702,13 +1748,10 @@ insert_bit_table_ent (curr_ent, bit, opcode, mask,
m = ((ia64_insn) 1) << bit;
if (mask & m)
- {
- b = (opcode & m) ? 1 : 0;
- }
+ b = (opcode & m) ? 1 : 0;
else
- {
- b = 2;
- }
+ b = 2;
+
next = curr_ent->bits[b];
if (next == NULL)
{
@@ -1719,7 +1762,7 @@ insert_bit_table_ent (curr_ent, bit, opcode, mask,
completer_index);
}
-void
+static void
add_dis_entry (first, opcode, mask, opcodenum, ent, completer_index)
struct bittree *first;
ia64_insn opcode;
@@ -1729,15 +1772,14 @@ add_dis_entry (first, opcode, mask, opcodenum, ent, completer_index)
int completer_index;
{
if (completer_index & (1 << 20))
- {
- abort ();
- }
+ abort ();
while (ent != NULL)
{
ia64_insn newopcode = (opcode & (~ ent->mask)) | ent->bits;
add_dis_entry (first, newopcode, mask, opcodenum, ent->addl_entries,
(completer_index << 1) | 1);
+
if (ent->is_terminal)
{
insert_bit_table_ent (bittree, 40, newopcode, mask,
@@ -1749,8 +1791,8 @@ add_dis_entry (first, opcode, mask, opcodenum, ent, completer_index)
}
}
-/* This optimization pass combines multiple "don't care" nodes. */
-void
+/* This optimization pass combines multiple "don't care" nodes. */
+static void
compact_distree (ent)
struct bittree *ent;
{
@@ -1790,10 +1832,9 @@ compact_distree (ent)
for (x = 0; x < 3; x++)
{
struct bittree *i = ent->bits[x];
+
if (i != NULL)
- {
- compact_distree (i);
- }
+ compact_distree (i);
}
}
@@ -1803,7 +1844,7 @@ static int tot_insn_list_len = 0;
/* Generate the disassembler state machine corresponding to the tree
in ENT. */
-void
+static void
gen_dis_table (ent)
struct bittree *ent;
{
@@ -1813,47 +1854,37 @@ gen_dis_table (ent)
int totbits = bitsused;
int needed_bytes;
int zero_count = 0;
- int zero_dest = 0; /* initialize this with 0 to keep gcc quiet... */
+ int zero_dest = 0; /* Initialize this with 0 to keep gcc quiet... */
/* If this is a terminal entry, there's no point in skipping any
- bits. */
+ bits. */
if (ent->skip_flag && ent->bits[0] == NULL && ent->bits[1] == NULL &&
ent->bits[2] == NULL)
{
if (ent->disent == NULL)
- {
- abort ();
- }
+ abort ();
else
- {
- ent->skip_flag = 0;
- }
+ ent->skip_flag = 0;
}
/* Calculate the amount of space needed for this entry, or at least
- a conservatively large approximation. */
+ a conservatively large approximation. */
if (ent->skip_flag)
- {
- totbits += 5;
- }
+ totbits += 5;
+
for (x = 1; x < 3; x++)
- {
- if (ent->bits[x] != NULL)
- {
- totbits += 16;
- }
- }
+ if (ent->bits[x] != NULL)
+ totbits += 16;
if (ent->disent != NULL)
{
if (ent->bits[2] != NULL)
- {
- abort ();
- }
+ abort ();
+
totbits += 16;
}
- /* Now allocate the space. */
+ /* Now allocate the space. */
needed_bytes = (totbits + 7) / 8;
if ((needed_bytes + insn_list_len) > tot_insn_list_len)
{
@@ -1865,7 +1896,7 @@ gen_dis_table (ent)
memset (insn_list + our_offset, 0, needed_bytes);
/* Encode the skip entry by setting bit 6 set in the state op field,
- and store the # of bits to skip immediately after. */
+ and store the # of bits to skip immediately after. */
if (ent->skip_flag)
{
bitsused += 5;
@@ -1878,8 +1909,7 @@ gen_dis_table (ent)
&& (ENT)->disent == NULL && (ENT)->skip_flag == 0)
/* Store an "if (bit is zero)" instruction by setting bit 7 in the
- state op field. */
-
+ state op field. */
if (ent->bits[0] != NULL)
{
struct bittree *nent = ent->bits[0];
@@ -1929,14 +1959,10 @@ gen_dis_table (ent)
i = NULL;
}
else
- {
- idest = insn_list_len - our_offset;
- }
+ idest = insn_list_len - our_offset;
}
else
- {
- idest = ent->disent->ournum;
- }
+ idest = ent->disent->ournum;
/* If the destination offset for the if (bit is 1) test is less
than 256 bytes away, we can store it as 8-bits instead of 16;
@@ -1946,8 +1972,7 @@ gen_dis_table (ent)
Note that branchings within the table are relative, and
there are no branches that branch past our instruction yet
- so we do not need to adjust any other offsets. */
-
+ so we do not need to adjust any other offsets. */
if (x == 1)
{
if (idest <= 256)
@@ -1965,9 +1990,7 @@ gen_dis_table (ent)
idest--;
}
else
- {
- insn_list[our_offset] |= 0x20;
- }
+ insn_list[our_offset] |= 0x20;
}
else
{
@@ -1996,74 +2019,58 @@ gen_dis_table (ent)
idest &= ~32768;
}
else
- {
- insn_list[our_offset] |= 0x08;
- }
+ insn_list[our_offset] |= 0x08;
}
+
if (debug)
{
int id = idest;
if (i == NULL)
- {
- id |= 32768;
- }
+ id |= 32768;
else if (! (id & 32768))
- {
- id += our_offset;
- }
+ id += our_offset;
+
if (x == 1)
- {
- printf ("%d: if (1) goto %d\n", our_offset, id);
- }
+ printf ("%d: if (1) goto %d\n", our_offset, id);
else
- {
- printf ("%d: try %d\n", our_offset, id);
- }
+ printf ("%d: try %d\n", our_offset, id);
}
- /* Store the address of the entry being branched to. */
+ /* Store the address of the entry being branched to. */
while (currbits >= 0)
{
char *byte = insn_list + our_offset + bitsused / 8;
if (idest & (1 << currbits))
- {
- *byte |= (1 << (7 - (bitsused % 8)));
- }
+ *byte |= (1 << (7 - (bitsused % 8)));
+
bitsused++;
currbits--;
}
- /* Now generate the states for the entry being branched to. */
+ /* Now generate the states for the entry being branched to. */
if (i != NULL)
- {
- gen_dis_table (i);
- }
-
+ gen_dis_table (i);
}
}
+
if (debug)
{
if (ent->skip_flag)
- {
- printf ("%d: skipping %d\n", our_offset, ent->bits_to_skip);
- }
+ printf ("%d: skipping %d\n", our_offset, ent->bits_to_skip);
if (ent->bits[0] != NULL)
- {
- printf ("%d: if (0:%d) goto %d\n", our_offset, zero_count + 1,
- zero_dest);
- }
+ printf ("%d: if (0:%d) goto %d\n", our_offset, zero_count + 1,
+ zero_dest);
}
+
if (bitsused != totbits)
- {
- abort ();
- }
+ abort ();
}
-void
-print_dis_table ()
+static void
+print_dis_table (void)
{
int x;
struct disent *cent = disinsntable;
@@ -2072,9 +2079,8 @@ print_dis_table ()
for (x = 0; x < insn_list_len; x++)
{
if ((x > 0) && ((x % 12) == 0))
- {
- printf ("\n");
- }
+ printf ("\n");
+
printf ("0x%02x, ", insn_list[x]);
}
printf ("\n};\n\n");
@@ -2096,24 +2102,22 @@ print_dis_table ()
printf ("};\n\n");
}
-void
-generate_disassembler ()
+static void
+generate_disassembler (void)
{
int i;
bittree = make_bittree_entry ();
- for (i=0; i < otlen;i++)
+ for (i = 0; i < otlen; i++)
{
struct main_entry *ptr = ordered_table[i];
if (ptr->opcode->type != IA64_TYPE_DYN)
- {
- add_dis_entry (bittree,
- ptr->opcode->opcode, ptr->opcode->mask,
- ptr->main_index,
- ptr->completers, 1);
- }
+ add_dis_entry (bittree,
+ ptr->opcode->opcode, ptr->opcode->mask,
+ ptr->main_index,
+ ptr->completers, 1);
}
compact_distree (bittree);
@@ -2123,25 +2127,26 @@ generate_disassembler ()
print_dis_table ();
}
-void
-print_string_table ()
+static void
+print_string_table (void)
{
int x;
char lbuf[80], buf[80];
int blen = 0;
- printf ("static const char *ia64_strings[] = {\n");
+ printf ("static const char * const ia64_strings[] = {\n");
lbuf[0] = '\0';
+
for (x = 0; x < strtablen; x++)
{
int len;
if (strlen (string_table[x]->s) > 75)
- {
- abort ();
- }
+ abort ();
+
sprintf (buf, " \"%s\",", string_table[x]->s);
len = strlen (buf);
+
if ((blen + len) > 75)
{
printf (" %s\n", lbuf);
@@ -2151,10 +2156,10 @@ print_string_table ()
strcat (lbuf, buf);
blen += len;
}
+
if (blen > 0)
- {
- printf (" %s\n", lbuf);
- }
+ printf (" %s\n", lbuf);
+
printf ("};\n\n");
}
@@ -2162,9 +2167,9 @@ static struct completer_entry **glist;
static int glistlen = 0;
static int glisttotlen = 0;
-/* If the completer trees ENT1 and ENT2 are equal, return 1. */
+/* If the completer trees ENT1 and ENT2 are equal, return 1. */
-int
+static int
completer_entries_eq (ent1, ent2)
struct completer_entry *ent1, *ent2;
{
@@ -2176,25 +2181,23 @@ completer_entries_eq (ent1, ent2)
|| ent1->is_terminal != ent2->is_terminal
|| ent1->dependencies != ent2->dependencies
|| ent1->order != ent2->order)
- {
- return 0;
- }
+ return 0;
+
if (! completer_entries_eq (ent1->addl_entries, ent2->addl_entries))
- {
- return 0;
- }
+ return 0;
+
ent1 = ent1->alternative;
ent2 = ent2->alternative;
}
+
return ent1 == ent2;
}
/* Insert ENT into the global list of completers and return it. If an
equivalent entry (according to completer_entries_eq) already exists,
- it is returned instead. */
-struct completer_entry *
-insert_gclist (ent)
- struct completer_entry *ent;
+ it is returned instead. */
+static struct completer_entry *
+insert_gclist (struct completer_entry *ent)
{
if (ent != NULL)
{
@@ -2223,13 +2226,9 @@ insert_gclist (ent)
}
if (ent->name->num < glist[0]->name->num)
- {
- i = 0;
- }
+ i = 0;
else if (ent->name->num > glist[end - 1]->name->num)
- {
- i = end;
- }
+ i = end;
else
{
int c;
@@ -2238,62 +2237,50 @@ insert_gclist (ent)
{
i = (start + end) / 2;
c = ent->name->num - glist[i]->name->num;
+
if (c < 0)
- {
- end = i - 1;
- }
+ end = i - 1;
else if (c == 0)
{
while (i > 0
&& ent->name->num == glist[i - 1]->name->num)
- {
- i--;
- }
+ i--;
+
break;
}
else
- {
- start = i + 1;
- }
+ start = i + 1;
+
if (start > end)
- {
- break;
- }
+ break;
}
+
if (c == 0)
{
while (i < glistlen)
{
if (ent->name->num != glist[i]->name->num)
- {
- break;
- }
+ break;
+
if (completer_entries_eq (ent, glist[i]))
- {
- return glist[i];
- }
+ return glist[i];
+
i++;
}
}
}
+
for (; i > 0 && i < glistlen; i--)
- {
- if (ent->name->num >= glist[i - 1]->name->num)
- {
- break;
- }
- }
+ if (ent->name->num >= glist[i - 1]->name->num)
+ break;
+
for (; i < glistlen; i++)
- {
- if (ent->name->num < glist[i]->name->num)
- {
- break;
- }
- }
+ if (ent->name->num < glist[i]->name->num)
+ break;
+
for (x = glistlen - 1; x >= i; x--)
- {
- glist[x + 1] = glist[x];
- }
+ glist[x + 1] = glist[x];
+
glist[i] = ent;
glistlen++;
}
@@ -2307,19 +2294,13 @@ get_prefix_len (name)
char *c;
if (name[0] == '\0')
- {
- return 0;
- }
+ return 0;
c = strchr (name, '.');
if (c != NULL)
- {
- return c - name;
- }
+ return c - name;
else
- {
- return strlen (name);
- }
+ return strlen (name);
}
static void
@@ -2340,30 +2321,21 @@ compute_completer_bits (ment, ent)
int x;
while (p != NULL && ! p->is_terminal)
- {
- p = p->parent;
- }
+ p = p->parent;
if (p != NULL)
- {
- p_bits = p->bits;
- }
+ p_bits = p->bits;
else
- {
- p_bits = ment->opcode->opcode;
- }
+ p_bits = ment->opcode->opcode;
for (x = 0; x < 64; x++)
{
ia64_insn m = ((ia64_insn) 1) << x;
+
if ((p_bits & m) != (our_bits & m))
- {
- mask |= m;
- }
+ mask |= m;
else
- {
- our_bits &= ~m;
- }
+ our_bits &= ~m;
}
ent->bits = our_bits;
ent->mask = mask;
@@ -2379,9 +2351,9 @@ compute_completer_bits (ment, ent)
}
/* Find identical completer trees that are used in different
- instructions and collapse their entries. */
-void
-collapse_redundant_completers ()
+ instructions and collapse their entries. */
+static void
+collapse_redundant_completers (void)
{
struct main_entry *ptr;
int x;
@@ -2389,43 +2361,39 @@ collapse_redundant_completers ()
for (ptr = maintable; ptr != NULL; ptr = ptr->next)
{
if (ptr->completers == NULL)
- {
- abort ();
- }
+ abort ();
+
compute_completer_bits (ptr, ptr->completers);
ptr->completers = insert_gclist (ptr->completers);
}
/* The table has been finalized, now number the indexes. */
for (x = 0; x < glistlen; x++)
- {
- glist[x]->num = x;
- }
+ glist[x]->num = x;
}
-/* attach two lists of dependencies to each opcode.
+/* Attach two lists of dependencies to each opcode.
1) all resources which, when already marked in use, conflict with this
opcode (chks)
2) all resources which must be marked in use when this opcode is used
- (regs)
-*/
-int
+ (regs). */
+static int
insert_opcode_dependencies (opc, cmp)
struct ia64_opcode *opc;
struct completer_entry *cmp ATTRIBUTE_UNUSED;
{
- /* note all resources which point to this opcode. rfi has the most chks
- (79) and cmpxchng has the most regs (54) so 100 here should be enough */
+ /* Note all resources which point to this opcode. rfi has the most chks
+ (79) and cmpxchng has the most regs (54) so 100 here should be enough. */
int i;
int nregs = 0;
unsigned short regs[256];
int nchks = 0;
unsigned short chks[256];
- /* flag insns for which no class matched; there should be none */
+ /* Flag insns for which no class matched; there should be none. */
int no_class_found = 1;
- for (i=0;i < rdepslen;i++)
+ for (i = 0; i < rdepslen; i++)
{
struct rdep *rs = rdeps[i];
int j;
@@ -2441,21 +2409,19 @@ insert_opcode_dependencies (opc, cmp)
if (in_iclass (opc, ics[rs->regs[j]], NULL, NULL, &ic_note))
{
- /* We can ignore ic_note 11 for non PR resources */
+ /* We can ignore ic_note 11 for non PR resources. */
if (ic_note == 11 && strncmp (rs->name, "PR", 2) != 0)
ic_note = 0;
if (ic_note != 0 && rs->regnotes[j] != 0
&& ic_note != rs->regnotes[j]
&& !(ic_note == 11 && rs->regnotes[j] == 1))
- fprintf (stderr, "Warning: IC note %d in opcode %s (IC:%s)"
- " conflicts with resource %s note %d\n",
- ic_note, opc->name, ics[rs->regs[j]]->name,
- rs->name, rs->regnotes[j]);
+ warn (_("IC note %d in opcode %s (IC:%s) conflicts with resource %s note %d\n"),
+ ic_note, opc->name, ics[rs->regs[j]]->name,
+ rs->name, rs->regnotes[j]);
/* Instruction class notes override resource notes.
So far, only note 11 applies to an IC instead of a resource,
- and note 11 implies note 1.
- */
+ and note 11 implies note 1. */
if (ic_note)
regs[nregs++] = RDEP(ic_note, i);
else
@@ -2464,23 +2430,23 @@ insert_opcode_dependencies (opc, cmp)
++rs->total_regs;
}
}
- for (j=0;j < rs->nchks;j++)
+
+ for (j = 0; j < rs->nchks; j++)
{
int ic_note = 0;
if (in_iclass (opc, ics[rs->chks[j]], NULL, NULL, &ic_note))
{
- /* We can ignore ic_note 11 for non PR resources */
+ /* We can ignore ic_note 11 for non PR resources. */
if (ic_note == 11 && strncmp (rs->name, "PR", 2) != 0)
ic_note = 0;
if (ic_note != 0 && rs->chknotes[j] != 0
&& ic_note != rs->chknotes[j]
&& !(ic_note == 11 && rs->chknotes[j] == 1))
- fprintf (stderr, "Warning: IC note %d for opcode %s (IC:%s)"
- " conflicts with resource %s note %d\n",
- ic_note, opc->name, ics[rs->chks[j]]->name,
- rs->name, rs->chknotes[j]);
+ warn (_("IC note %d for opcode %s (IC:%s) conflicts with resource %s note %d\n"),
+ ic_note, opc->name, ics[rs->chks[j]]->name,
+ rs->name, rs->chknotes[j]);
if (ic_note)
chks[nchks++] = RDEP(ic_note, i);
else
@@ -2492,14 +2458,14 @@ insert_opcode_dependencies (opc, cmp)
}
if (no_class_found)
- fprintf (stderr, "Warning: opcode %s has no class (ops %d %d %d)\n",
- opc->name,
- opc->operands[0], opc->operands[1], opc->operands[2]);
+ warn (_("opcode %s has no class (ops %d %d %d)\n"),
+ opc->name,
+ opc->operands[0], opc->operands[1], opc->operands[2]);
return insert_dependencies (nchks, chks, nregs, regs);
}
-void
+static void
insert_completer_entry (opc, tabent, order)
struct ia64_opcode *opc;
struct main_entry *tabent;
@@ -2511,15 +2477,13 @@ insert_completer_entry (opc, tabent, order)
int at_end = 0;
if (strlen (opc->name) > 128)
- {
- abort ();
- }
+ abort ();
+
strcpy (pcopy, opc->name);
prefix = pcopy + get_prefix_len (pcopy);
+
if (prefix[0] != '\0')
- {
- prefix++;
- }
+ prefix++;
while (! at_end)
{
@@ -2541,13 +2505,13 @@ insert_completer_entry (opc, tabent, order)
break;
}
else
- {
- ptr = &((*ptr)->alternative);
- }
+ ptr = &((*ptr)->alternative);
}
+
if (need_new_ent)
{
struct completer_entry *nent = tmalloc (struct completer_entry);
+
nent->name = sent;
nent->parent = parent;
nent->addl_entries = NULL;
@@ -2566,9 +2530,7 @@ insert_completer_entry (opc, tabent, order)
}
if ((*ptr)->is_terminal)
- {
- abort ();
- }
+ abort ();
(*ptr)->is_terminal = 1;
(*ptr)->mask = (ia64_insn)-1;
@@ -2577,7 +2539,7 @@ insert_completer_entry (opc, tabent, order)
(*ptr)->order = order;
}
-void
+static void
print_completer_entry (ent)
struct completer_entry *ent;
{
@@ -2592,10 +2554,9 @@ print_completer_entry (ent)
mask = mask >> 1;
bits = bits >> 1;
}
+
if (bits & 0xffffffff00000000LL)
- {
- abort ();
- }
+ abort ();
}
printf (" { 0x%x, 0x%x, %d, %d, %d, %d, %d, %d },\n",
@@ -2609,20 +2570,18 @@ print_completer_entry (ent)
ent->dependencies);
}
-void
+static void
print_completer_table ()
{
int x;
printf ("static const struct ia64_completer_table\ncompleter_table[] = {\n");
for (x = 0; x < glistlen; x++)
- {
- print_completer_entry (glist[x]);
- }
+ print_completer_entry (glist[x]);
printf ("};\n\n");
}
-int
+static int
opcodes_eq (opc1, opc2)
struct ia64_opcode *opc1;
struct ia64_opcode *opc2;
@@ -2633,26 +2592,22 @@ opcodes_eq (opc1, opc2)
if ((opc1->mask != opc2->mask) || (opc1->type != opc2->type)
|| (opc1->num_outputs != opc2->num_outputs)
|| (opc1->flags != opc2->flags))
- {
- return 0;
- }
+ return 0;
+
for (x = 0; x < 5; x++)
- {
- if (opc1->operands[x] != opc2->operands[x])
- {
- return 0;
- }
- }
+ if (opc1->operands[x] != opc2->operands[x])
+ return 0;
+
plen1 = get_prefix_len (opc1->name);
plen2 = get_prefix_len (opc2->name);
+
if (plen1 == plen2 && (memcmp (opc1->name, opc2->name, plen1) == 0))
- {
- return 1;
- }
+ return 1;
+
return 0;
}
-void
+static void
add_opcode_entry (opc)
struct ia64_opcode *opc;
{
@@ -2662,9 +2617,8 @@ add_opcode_entry (opc)
int found_it = 0;
if (strlen (opc->name) > 128)
- {
- abort ();
- }
+ abort ();
+
place = &maintable;
strcpy (prefix, opc->name);
prefix[get_prefix_len (prefix)] = '\0';
@@ -2672,7 +2626,7 @@ add_opcode_entry (opc)
/* Walk the list of opcode table entries. If it's a new
instruction, allocate and fill in a new entry. Note
- the main table is alphabetical by opcode name. */
+ the main table is alphabetical by opcode name. */
while (*place != NULL)
{
@@ -2683,9 +2637,8 @@ add_opcode_entry (opc)
break;
}
if ((*place)->name->num > name->num)
- {
- break;
- }
+ break;
+
place = &((*place)->next);
}
if (! found_it)
@@ -2710,8 +2663,8 @@ add_opcode_entry (opc)
insert_completer_entry (opc, *place, opcode_count++);
}
-void
-print_main_table ()
+static void
+print_main_table (void)
{
struct main_entry *ptr = maintable;
int index = 0;
@@ -2742,30 +2695,85 @@ print_main_table ()
printf ("};\n\n");
}
-void
+static void
shrink (table)
struct ia64_opcode *table;
{
int curr_opcode;
for (curr_opcode = 0; table[curr_opcode].name != NULL; curr_opcode++)
- {
- add_opcode_entry (table + curr_opcode);
- }
+ add_opcode_entry (table + curr_opcode);
}
+
+/* Program options. */
+#define OPTION_SRCDIR 200
+
+struct option long_options[] =
+{
+ {"srcdir", required_argument, NULL, OPTION_SRCDIR},
+ {"debug", no_argument, NULL, 'd'},
+ {"version", no_argument, NULL, 'V'},
+ {"help", no_argument, NULL, 'h'},
+ {0, no_argument, NULL, 0}
+};
+
+static void
+print_version (void)
+{
+ printf ("%s: version 1.0\n", program_name);
+ xexit (0);
+}
+
+static void
+usage (FILE * stream, int status)
+{
+ fprintf (stream, "Usage: %s [-V | --version] [-d | --debug] [--srcdir=dirname] [--help]\n",
+ program_name);
+ xexit (status);
+}
+
int
-main (argc, argv)
- int argc;
- char **argv ATTRIBUTE_UNUSED;
+main (int argc, char **argv)
{
- if (argc > 1)
- {
- debug = 1;
- }
+ extern int chdir (char *);
+ char *srcdir = NULL;
+ int c;
+
+ program_name = *argv;
+ xmalloc_set_program_name (program_name);
+
+ while ((c = getopt_long (argc, argv, "vVdh", long_options, 0)) != EOF)
+ switch (c)
+ {
+ case OPTION_SRCDIR:
+ srcdir = optarg;
+ break;
+ case 'V':
+ case 'v':
+ print_version ();
+ break;
+ case 'd':
+ debug = 1;
+ break;
+ case 'h':
+ case '?':
+ usage (stderr, 0);
+ default:
+ case 0:
+ break;
+ }
+
+ if (optind != argc)
+ usage (stdout, 1);
+
+ if (srcdir != NULL)
+ if (chdir (srcdir) != 0)
+ fail (_("unable to change directory to \"%s\", errno = %s\n"),
+ srcdir, strerror (errno));
- load_insn_classes();
- load_dependencies();
+ load_insn_classes ();
+ load_dependencies ();
shrink (ia64_opcodes_a);
shrink (ia64_opcodes_b);
@@ -2777,7 +2785,7 @@ main (argc, argv)
collapse_redundant_completers ();
- printf ("/* This file is automatically generated by ia64-gen. Do not edit! */\n");
+ printf ("/* This file is automatically generated by ia64-gen. Do not edit! */\n");
print_string_table ();
print_dependency_table ();
print_completer_table ();
diff --git a/opcodes/ia64-opc-a.c b/opcodes/ia64-opc-a.c
index 27d7637f1a2..c9e316234f8 100644
--- a/opcodes/ia64-opc-a.c
+++ b/opcodes/ia64-opc-a.c
@@ -1,5 +1,5 @@
/* ia64-opc-a.c -- IA-64 `A' opcode table.
- Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of GDB, GAS, and the GNU binutils.
@@ -82,292 +82,296 @@
(bOp (a) | bX2a (b) | bZa (c) | bZb (d) | bX4 (e) | bX2b (f)), \
(mOp | mX2a | mZa | mZb | mX4 | mX2b)
+/* Used to initialise unused fields in ia64_opcode struct,
+ in order to stop gcc from complaining. */
+#define EMPTY 0,0,NULL
+
struct ia64_opcode ia64_opcodes_a[] =
{
- /* A-type instruction encodings (sorted according to major opcode) */
+ /* A-type instruction encodings (sorted according to major opcode). */
- {"add", A, OpX2aVeX4X2b (8, 0, 0, 0, 0), {R1, R2, R3}},
- {"add", A, OpX2aVeX4X2b (8, 0, 0, 0, 1), {R1, R2, R3, C1}},
- {"sub", A, OpX2aVeX4X2b (8, 0, 0, 1, 1), {R1, R2, R3}},
- {"sub", A, OpX2aVeX4X2b (8, 0, 0, 1, 0), {R1, R2, R3, C1}},
- {"addp4", A, OpX2aVeX4X2b (8, 0, 0, 2, 0), {R1, R2, R3}},
- {"and", A, OpX2aVeX4X2b (8, 0, 0, 3, 0), {R1, R2, R3}},
- {"andcm", A, OpX2aVeX4X2b (8, 0, 0, 3, 1), {R1, R2, R3}},
- {"or", A, OpX2aVeX4X2b (8, 0, 0, 3, 2), {R1, R2, R3}},
- {"xor", A, OpX2aVeX4X2b (8, 0, 0, 3, 3), {R1, R2, R3}},
- {"shladd", A, OpX2aVeX4 (8, 0, 0, 4), {R1, R2, CNT2a, R3}},
- {"shladdp4", A, OpX2aVeX4 (8, 0, 0, 6), {R1, R2, CNT2a, R3}},
- {"sub", A, OpX2aVeX4X2b (8, 0, 0, 9, 1), {R1, IMM8, R3}},
- {"and", A, OpX2aVeX4X2b (8, 0, 0, 0xb, 0), {R1, IMM8, R3}},
- {"andcm", A, OpX2aVeX4X2b (8, 0, 0, 0xb, 1), {R1, IMM8, R3}},
- {"or", A, OpX2aVeX4X2b (8, 0, 0, 0xb, 2), {R1, IMM8, R3}},
- {"xor", A, OpX2aVeX4X2b (8, 0, 0, 0xb, 3), {R1, IMM8, R3}},
- {"mov", A, OpX2aVeImm14 (8, 2, 0, 0), {R1, R3}},
- {"mov", A, OpX2aVeR3a (8, 2, 0, 0), {R1, IMM14}, PSEUDO},
- {"adds", A, OpX2aVe (8, 2, 0), {R1, IMM14, R3}},
- {"addp4", A, OpX2aVe (8, 3, 0), {R1, IMM14, R3}},
- {"padd1", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 0, 0), {R1, R2, R3}},
- {"padd2", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 0, 0), {R1, R2, R3}},
- {"padd4", A, OpX2aZaZbX4X2b (8, 1, 1, 0, 0, 0), {R1, R2, R3}},
- {"padd1.sss", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 0, 1), {R1, R2, R3}},
- {"padd2.sss", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 0, 1), {R1, R2, R3}},
- {"padd1.uuu", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 0, 2), {R1, R2, R3}},
- {"padd2.uuu", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 0, 2), {R1, R2, R3}},
- {"padd1.uus", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 0, 3), {R1, R2, R3}},
- {"padd2.uus", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 0, 3), {R1, R2, R3}},
- {"psub1", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 1, 0), {R1, R2, R3}},
- {"psub2", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 1, 0), {R1, R2, R3}},
- {"psub4", A, OpX2aZaZbX4X2b (8, 1, 1, 0, 1, 0), {R1, R2, R3}},
- {"psub1.sss", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 1, 1), {R1, R2, R3}},
- {"psub2.sss", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 1, 1), {R1, R2, R3}},
- {"psub1.uuu", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 1, 2), {R1, R2, R3}},
- {"psub2.uuu", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 1, 2), {R1, R2, R3}},
- {"psub1.uus", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 1, 3), {R1, R2, R3}},
- {"psub2.uus", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 1, 3), {R1, R2, R3}},
- {"pavg1", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 2, 2), {R1, R2, R3}},
- {"pavg2", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 2, 2), {R1, R2, R3}},
- {"pavg1.raz", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 2, 3), {R1, R2, R3}},
- {"pavg2.raz", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 2, 3), {R1, R2, R3}},
- {"pavgsub1", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 3, 2), {R1, R2, R3}},
- {"pavgsub2", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 3, 2), {R1, R2, R3}},
- {"pcmp1.eq", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 9, 0), {R1, R2, R3}},
- {"pcmp2.eq", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 9, 0), {R1, R2, R3}},
- {"pcmp4.eq", A, OpX2aZaZbX4X2b (8, 1, 1, 0, 9, 0), {R1, R2, R3}},
- {"pcmp1.gt", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 9, 1), {R1, R2, R3}},
- {"pcmp2.gt", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 9, 1), {R1, R2, R3}},
- {"pcmp4.gt", A, OpX2aZaZbX4X2b (8, 1, 1, 0, 9, 1), {R1, R2, R3}},
- {"pshladd2", A, OpX2aZaZbX4 (8, 1, 0, 1, 4), {R1, R2, CNT2b, R3}},
- {"pshradd2", A, OpX2aZaZbX4 (8, 1, 0, 1, 6), {R1, R2, CNT2b, R3}},
+ {"add", A, OpX2aVeX4X2b (8, 0, 0, 0, 0), {R1, R2, R3}, EMPTY},
+ {"add", A, OpX2aVeX4X2b (8, 0, 0, 0, 1), {R1, R2, R3, C1}, EMPTY},
+ {"sub", A, OpX2aVeX4X2b (8, 0, 0, 1, 1), {R1, R2, R3}, EMPTY},
+ {"sub", A, OpX2aVeX4X2b (8, 0, 0, 1, 0), {R1, R2, R3, C1}, EMPTY},
+ {"addp4", A, OpX2aVeX4X2b (8, 0, 0, 2, 0), {R1, R2, R3}, EMPTY},
+ {"and", A, OpX2aVeX4X2b (8, 0, 0, 3, 0), {R1, R2, R3}, EMPTY},
+ {"andcm", A, OpX2aVeX4X2b (8, 0, 0, 3, 1), {R1, R2, R3}, EMPTY},
+ {"or", A, OpX2aVeX4X2b (8, 0, 0, 3, 2), {R1, R2, R3}, EMPTY},
+ {"xor", A, OpX2aVeX4X2b (8, 0, 0, 3, 3), {R1, R2, R3}, EMPTY},
+ {"shladd", A, OpX2aVeX4 (8, 0, 0, 4), {R1, R2, CNT2a, R3}, EMPTY},
+ {"shladdp4", A, OpX2aVeX4 (8, 0, 0, 6), {R1, R2, CNT2a, R3}, EMPTY},
+ {"sub", A, OpX2aVeX4X2b (8, 0, 0, 9, 1), {R1, IMM8, R3}, EMPTY},
+ {"and", A, OpX2aVeX4X2b (8, 0, 0, 0xb, 0), {R1, IMM8, R3}, EMPTY},
+ {"andcm", A, OpX2aVeX4X2b (8, 0, 0, 0xb, 1), {R1, IMM8, R3}, EMPTY},
+ {"or", A, OpX2aVeX4X2b (8, 0, 0, 0xb, 2), {R1, IMM8, R3}, EMPTY},
+ {"xor", A, OpX2aVeX4X2b (8, 0, 0, 0xb, 3), {R1, IMM8, R3}, EMPTY},
+ {"mov", A, OpX2aVeImm14 (8, 2, 0, 0), {R1, R3}, EMPTY},
+ {"mov", A, OpX2aVeR3a (8, 2, 0, 0), {R1, IMM14}, PSEUDO, 0, NULL},
+ {"adds", A, OpX2aVe (8, 2, 0), {R1, IMM14, R3}, EMPTY},
+ {"addp4", A, OpX2aVe (8, 3, 0), {R1, IMM14, R3}, EMPTY},
+ {"padd1", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 0, 0), {R1, R2, R3}, EMPTY},
+ {"padd2", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 0, 0), {R1, R2, R3}, EMPTY},
+ {"padd4", A, OpX2aZaZbX4X2b (8, 1, 1, 0, 0, 0), {R1, R2, R3}, EMPTY},
+ {"padd1.sss", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 0, 1), {R1, R2, R3}, EMPTY},
+ {"padd2.sss", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 0, 1), {R1, R2, R3}, EMPTY},
+ {"padd1.uuu", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 0, 2), {R1, R2, R3}, EMPTY},
+ {"padd2.uuu", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 0, 2), {R1, R2, R3}, EMPTY},
+ {"padd1.uus", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 0, 3), {R1, R2, R3}, EMPTY},
+ {"padd2.uus", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 0, 3), {R1, R2, R3}, EMPTY},
+ {"psub1", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 1, 0), {R1, R2, R3}, EMPTY},
+ {"psub2", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 1, 0), {R1, R2, R3}, EMPTY},
+ {"psub4", A, OpX2aZaZbX4X2b (8, 1, 1, 0, 1, 0), {R1, R2, R3}, EMPTY},
+ {"psub1.sss", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 1, 1), {R1, R2, R3}, EMPTY},
+ {"psub2.sss", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 1, 1), {R1, R2, R3}, EMPTY},
+ {"psub1.uuu", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 1, 2), {R1, R2, R3}, EMPTY},
+ {"psub2.uuu", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 1, 2), {R1, R2, R3}, EMPTY},
+ {"psub1.uus", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 1, 3), {R1, R2, R3}, EMPTY},
+ {"psub2.uus", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 1, 3), {R1, R2, R3}, EMPTY},
+ {"pavg1", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 2, 2), {R1, R2, R3}, EMPTY},
+ {"pavg2", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 2, 2), {R1, R2, R3}, EMPTY},
+ {"pavg1.raz", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 2, 3), {R1, R2, R3}, EMPTY},
+ {"pavg2.raz", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 2, 3), {R1, R2, R3}, EMPTY},
+ {"pavgsub1", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 3, 2), {R1, R2, R3}, EMPTY},
+ {"pavgsub2", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 3, 2), {R1, R2, R3}, EMPTY},
+ {"pcmp1.eq", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 9, 0), {R1, R2, R3}, EMPTY},
+ {"pcmp2.eq", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 9, 0), {R1, R2, R3}, EMPTY},
+ {"pcmp4.eq", A, OpX2aZaZbX4X2b (8, 1, 1, 0, 9, 0), {R1, R2, R3}, EMPTY},
+ {"pcmp1.gt", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 9, 1), {R1, R2, R3}, EMPTY},
+ {"pcmp2.gt", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 9, 1), {R1, R2, R3}, EMPTY},
+ {"pcmp4.gt", A, OpX2aZaZbX4X2b (8, 1, 1, 0, 9, 1), {R1, R2, R3}, EMPTY},
+ {"pshladd2", A, OpX2aZaZbX4 (8, 1, 0, 1, 4), {R1, R2, CNT2b, R3}, EMPTY},
+ {"pshradd2", A, OpX2aZaZbX4 (8, 1, 0, 1, 6), {R1, R2, CNT2b, R3}, EMPTY},
- {"mov", A, OpR3b (9, 0), {R1, IMM22}, PSEUDO},
- {"addl", A, Op (9), {R1, IMM22, R3_2}},
+ {"mov", A, OpR3b (9, 0), {R1, IMM22}, PSEUDO, 0, NULL},
+ {"addl", A, Op (9), {R1, IMM22, R3_2}, EMPTY},
- {"cmp.lt", A2, OpX2TbTaC (0xc, 0, 0, 0, 0), {P1, P2, R2, R3}},
- {"cmp.le", A2, OpX2TbTaC (0xc, 0, 0, 0, 0), {P2, P1, R3, R2}},
- {"cmp.gt", A2, OpX2TbTaC (0xc, 0, 0, 0, 0), {P1, P2, R3, R2}},
- {"cmp.ge", A2, OpX2TbTaC (0xc, 0, 0, 0, 0), {P2, P1, R2, R3}},
- {"cmp.lt.unc", A2, OpX2TbTaC (0xc, 0, 0, 0, 1), {P1, P2, R2, R3}},
- {"cmp.le.unc", A2, OpX2TbTaC (0xc, 0, 0, 0, 1), {P2, P1, R3, R2}},
- {"cmp.gt.unc", A2, OpX2TbTaC (0xc, 0, 0, 0, 1), {P1, P2, R3, R2}},
- {"cmp.ge.unc", A2, OpX2TbTaC (0xc, 0, 0, 0, 1), {P2, P1, R2, R3}},
- {"cmp.eq.and", A2, OpX2TbTaC (0xc, 0, 0, 1, 0), {P1, P2, R2, R3}},
- {"cmp.ne.andcm", A2, OpX2TbTaC (0xc, 0, 0, 1, 0), {P1, P2, R2, R3}, PSEUDO},
- {"cmp.ne.and", A2, OpX2TbTaC (0xc, 0, 0, 1, 1), {P1, P2, R2, R3}},
- {"cmp.eq.andcm", A2, OpX2TbTaC (0xc, 0, 0, 1, 1), {P1, P2, R2, R3}, PSEUDO},
- {"cmp4.lt", A2, OpX2TbTaC (0xc, 1, 0, 0, 0), {P1, P2, R2, R3}},
- {"cmp4.le", A2, OpX2TbTaC (0xc, 1, 0, 0, 0), {P2, P1, R3, R2}},
- {"cmp4.gt", A2, OpX2TbTaC (0xc, 1, 0, 0, 0), {P1, P2, R3, R2}},
- {"cmp4.ge", A2, OpX2TbTaC (0xc, 1, 0, 0, 0), {P2, P1, R2, R3}},
- {"cmp4.lt.unc", A2, OpX2TbTaC (0xc, 1, 0, 0, 1), {P1, P2, R2, R3}},
- {"cmp4.le.unc", A2, OpX2TbTaC (0xc, 1, 0, 0, 1), {P2, P1, R3, R2}},
- {"cmp4.gt.unc", A2, OpX2TbTaC (0xc, 1, 0, 0, 1), {P1, P2, R3, R2}},
- {"cmp4.ge.unc", A2, OpX2TbTaC (0xc, 1, 0, 0, 1), {P2, P1, R2, R3}},
- {"cmp4.eq.and", A2, OpX2TbTaC (0xc, 1, 0, 1, 0), {P1, P2, R2, R3}},
- {"cmp4.ne.andcm", A2, OpX2TbTaC (0xc, 1, 0, 1, 0), {P1, P2, R2, R3}, PSEUDO},
- {"cmp4.ne.and", A2, OpX2TbTaC (0xc, 1, 0, 1, 1), {P1, P2, R2, R3}},
- {"cmp4.eq.andcm", A2, OpX2TbTaC (0xc, 1, 0, 1, 1), {P1, P2, R2, R3}, PSEUDO},
- {"cmp.gt.and", A2, OpX2TbTaC (0xc, 0, 1, 0, 0), {P1, P2, GR0, R3}},
- {"cmp.lt.and", A2, OpX2TbTaC (0xc, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.le.andcm", A2, OpX2TbTaC (0xc, 0, 1, 0, 0), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp.ge.andcm", A2, OpX2TbTaC (0xc, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.le.and", A2, OpX2TbTaC (0xc, 0, 1, 0, 1), {P1, P2, GR0, R3}},
- {"cmp.ge.and", A2, OpX2TbTaC (0xc, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.gt.andcm", A2, OpX2TbTaC (0xc, 0, 1, 0, 1), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp.lt.andcm", A2, OpX2TbTaC (0xc, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.ge.and", A2, OpX2TbTaC (0xc, 0, 1, 1, 0), {P1, P2, GR0, R3}},
- {"cmp.le.and", A2, OpX2TbTaC (0xc, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.lt.andcm", A2, OpX2TbTaC (0xc, 0, 1, 1, 0), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp.gt.andcm", A2, OpX2TbTaC (0xc, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.lt.and", A2, OpX2TbTaC (0xc, 0, 1, 1, 1), {P1, P2, GR0, R3}},
- {"cmp.gt.and", A2, OpX2TbTaC (0xc, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.ge.andcm", A2, OpX2TbTaC (0xc, 0, 1, 1, 1), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp.le.andcm", A2, OpX2TbTaC (0xc, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.gt.and", A2, OpX2TbTaC (0xc, 1, 1, 0, 0), {P1, P2, GR0, R3}},
- {"cmp4.lt.and", A2, OpX2TbTaC (0xc, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.le.andcm", A2, OpX2TbTaC (0xc, 1, 1, 0, 0), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp4.ge.andcm", A2, OpX2TbTaC (0xc, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.le.and", A2, OpX2TbTaC (0xc, 1, 1, 0, 1), {P1, P2, GR0, R3}},
- {"cmp4.ge.and", A2, OpX2TbTaC (0xc, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.gt.andcm", A2, OpX2TbTaC (0xc, 1, 1, 0, 1), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp4.lt.andcm", A2, OpX2TbTaC (0xc, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.ge.and", A2, OpX2TbTaC (0xc, 1, 1, 1, 0), {P1, P2, GR0, R3}},
- {"cmp4.le.and", A2, OpX2TbTaC (0xc, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.lt.andcm", A2, OpX2TbTaC (0xc, 1, 1, 1, 0), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp4.gt.andcm", A2, OpX2TbTaC (0xc, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.lt.and", A2, OpX2TbTaC (0xc, 1, 1, 1, 1), {P1, P2, GR0, R3}},
- {"cmp4.gt.and", A2, OpX2TbTaC (0xc, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.ge.andcm", A2, OpX2TbTaC (0xc, 1, 1, 1, 1), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp4.le.andcm", A2, OpX2TbTaC (0xc, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.lt", A2, OpX2TaC (0xc, 2, 0, 0), {P1, P2, IMM8, R3}},
- {"cmp.le", A2, OpX2TaC (0xc, 2, 0, 0), {P1, P2, IMM8M1, R3}},
- {"cmp.gt", A2, OpX2TaC (0xc, 2, 0, 0), {P2, P1, IMM8M1, R3}},
- {"cmp.ge", A2, OpX2TaC (0xc, 2, 0, 0), {P2, P1, IMM8, R3}},
- {"cmp.lt.unc", A2, OpX2TaC (0xc, 2, 0, 1), {P1, P2, IMM8, R3}},
- {"cmp.le.unc", A2, OpX2TaC (0xc, 2, 0, 1), {P1, P2, IMM8M1, R3}},
- {"cmp.gt.unc", A2, OpX2TaC (0xc, 2, 0, 1), {P2, P1, IMM8M1, R3}},
- {"cmp.ge.unc", A2, OpX2TaC (0xc, 2, 0, 1), {P2, P1, IMM8, R3}},
- {"cmp.eq.and", A2, OpX2TaC (0xc, 2, 1, 0), {P1, P2, IMM8, R3}},
- {"cmp.ne.andcm", A2, OpX2TaC (0xc, 2, 1, 0), {P1, P2, IMM8, R3}, PSEUDO},
- {"cmp.ne.and", A2, OpX2TaC (0xc, 2, 1, 1), {P1, P2, IMM8, R3}},
- {"cmp.eq.andcm", A2, OpX2TaC (0xc, 2, 1, 1), {P1, P2, IMM8, R3}, PSEUDO},
- {"cmp4.lt", A2, OpX2TaC (0xc, 3, 0, 0), {P1, P2, IMM8, R3}},
- {"cmp4.le", A2, OpX2TaC (0xc, 3, 0, 0), {P1, P2, IMM8M1, R3}},
- {"cmp4.gt", A2, OpX2TaC (0xc, 3, 0, 0), {P2, P1, IMM8M1, R3}},
- {"cmp4.ge", A2, OpX2TaC (0xc, 3, 0, 0), {P2, P1, IMM8, R3}},
- {"cmp4.lt.unc", A2, OpX2TaC (0xc, 3, 0, 1), {P1, P2, IMM8, R3}},
- {"cmp4.le.unc", A2, OpX2TaC (0xc, 3, 0, 1), {P1, P2, IMM8M1, R3}},
- {"cmp4.gt.unc", A2, OpX2TaC (0xc, 3, 0, 1), {P2, P1, IMM8M1, R3}},
- {"cmp4.ge.unc", A2, OpX2TaC (0xc, 3, 0, 1), {P2, P1, IMM8, R3}},
- {"cmp4.eq.and", A2, OpX2TaC (0xc, 3, 1, 0), {P1, P2, IMM8, R3}},
- {"cmp4.ne.andcm", A2, OpX2TaC (0xc, 3, 1, 0), {P1, P2, IMM8, R3}, PSEUDO},
- {"cmp4.ne.and", A2, OpX2TaC (0xc, 3, 1, 1), {P1, P2, IMM8, R3}},
- {"cmp4.eq.andcm", A2, OpX2TaC (0xc, 3, 1, 1), {P1, P2, IMM8, R3}, PSEUDO},
- {"cmp.ltu", A2, OpX2TbTaC (0xd, 0, 0, 0, 0), {P1, P2, R2, R3}},
- {"cmp.leu", A2, OpX2TbTaC (0xd, 0, 0, 0, 0), {P2, P1, R3, R2}},
- {"cmp.gtu", A2, OpX2TbTaC (0xd, 0, 0, 0, 0), {P1, P2, R3, R2}},
- {"cmp.geu", A2, OpX2TbTaC (0xd, 0, 0, 0, 0), {P2, P1, R2, R3}},
- {"cmp.ltu.unc", A2, OpX2TbTaC (0xd, 0, 0, 0, 1), {P1, P2, R2, R3}},
- {"cmp.leu.unc", A2, OpX2TbTaC (0xd, 0, 0, 0, 1), {P2, P1, R3, R2}},
- {"cmp.gtu.unc", A2, OpX2TbTaC (0xd, 0, 0, 0, 1), {P1, P2, R3, R2}},
- {"cmp.geu.unc", A2, OpX2TbTaC (0xd, 0, 0, 0, 1), {P2, P1, R2, R3}},
- {"cmp.eq.or", A2, OpX2TbTaC (0xd, 0, 0, 1, 0), {P1, P2, R2, R3}},
- {"cmp.ne.orcm", A2, OpX2TbTaC (0xd, 0, 0, 1, 0), {P1, P2, R2, R3}, PSEUDO},
- {"cmp.ne.or", A2, OpX2TbTaC (0xd, 0, 0, 1, 1), {P1, P2, R2, R3}},
- {"cmp.eq.orcm", A2, OpX2TbTaC (0xd, 0, 0, 1, 1), {P1, P2, R2, R3}, PSEUDO},
- {"cmp4.ltu", A2, OpX2TbTaC (0xd, 1, 0, 0, 0), {P1, P2, R2, R3}},
- {"cmp4.leu", A2, OpX2TbTaC (0xd, 1, 0, 0, 0), {P2, P1, R3, R2}},
- {"cmp4.gtu", A2, OpX2TbTaC (0xd, 1, 0, 0, 0), {P1, P2, R3, R2}},
- {"cmp4.geu", A2, OpX2TbTaC (0xd, 1, 0, 0, 0), {P2, P1, R2, R3}},
- {"cmp4.ltu.unc", A2, OpX2TbTaC (0xd, 1, 0, 0, 1), {P1, P2, R2, R3}},
- {"cmp4.leu.unc", A2, OpX2TbTaC (0xd, 1, 0, 0, 1), {P2, P1, R3, R2}},
- {"cmp4.gtu.unc", A2, OpX2TbTaC (0xd, 1, 0, 0, 1), {P1, P2, R3, R2}},
- {"cmp4.geu.unc", A2, OpX2TbTaC (0xd, 1, 0, 0, 1), {P2, P1, R2, R3}},
- {"cmp4.eq.or", A2, OpX2TbTaC (0xd, 1, 0, 1, 0), {P1, P2, R2, R3}},
- {"cmp4.ne.orcm", A2, OpX2TbTaC (0xd, 1, 0, 1, 0), {P1, P2, R2, R3}, PSEUDO},
- {"cmp4.ne.or", A2, OpX2TbTaC (0xd, 1, 0, 1, 1), {P1, P2, R2, R3}},
- {"cmp4.eq.orcm", A2, OpX2TbTaC (0xd, 1, 0, 1, 1), {P1, P2, R2, R3}, PSEUDO},
- {"cmp.gt.or", A2, OpX2TbTaC (0xd, 0, 1, 0, 0), {P1, P2, GR0, R3}},
- {"cmp.lt.or", A2, OpX2TbTaC (0xd, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.le.orcm", A2, OpX2TbTaC (0xd, 0, 1, 0, 0), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp.ge.orcm", A2, OpX2TbTaC (0xd, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.le.or", A2, OpX2TbTaC (0xd, 0, 1, 0, 1), {P1, P2, GR0, R3}},
- {"cmp.ge.or", A2, OpX2TbTaC (0xd, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.gt.orcm", A2, OpX2TbTaC (0xd, 0, 1, 0, 1), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp.lt.orcm", A2, OpX2TbTaC (0xd, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.ge.or", A2, OpX2TbTaC (0xd, 0, 1, 1, 0), {P1, P2, GR0, R3}},
- {"cmp.le.or", A2, OpX2TbTaC (0xd, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.lt.orcm", A2, OpX2TbTaC (0xd, 0, 1, 1, 0), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp.gt.orcm", A2, OpX2TbTaC (0xd, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.lt.or", A2, OpX2TbTaC (0xd, 0, 1, 1, 1), {P1, P2, GR0, R3}},
- {"cmp.gt.or", A2, OpX2TbTaC (0xd, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.ge.orcm", A2, OpX2TbTaC (0xd, 0, 1, 1, 1), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp.le.orcm", A2, OpX2TbTaC (0xd, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.gt.or", A2, OpX2TbTaC (0xd, 1, 1, 0, 0), {P1, P2, GR0, R3}},
- {"cmp4.lt.or", A2, OpX2TbTaC (0xd, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.le.orcm", A2, OpX2TbTaC (0xd, 1, 1, 0, 0), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp4.ge.orcm", A2, OpX2TbTaC (0xd, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.le.or", A2, OpX2TbTaC (0xd, 1, 1, 0, 1), {P1, P2, GR0, R3}},
- {"cmp4.ge.or", A2, OpX2TbTaC (0xd, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.gt.orcm", A2, OpX2TbTaC (0xd, 1, 1, 0, 1), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp4.lt.orcm", A2, OpX2TbTaC (0xd, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.ge.or", A2, OpX2TbTaC (0xd, 1, 1, 1, 0), {P1, P2, GR0, R3}},
- {"cmp4.le.or", A2, OpX2TbTaC (0xd, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.lt.orcm", A2, OpX2TbTaC (0xd, 1, 1, 1, 0), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp4.gt.orcm", A2, OpX2TbTaC (0xd, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.lt.or", A2, OpX2TbTaC (0xd, 1, 1, 1, 1), {P1, P2, GR0, R3}},
- {"cmp4.gt.or", A2, OpX2TbTaC (0xd, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.ge.orcm", A2, OpX2TbTaC (0xd, 1, 1, 1, 1), {P1, P2, GR0, R3}, PSEUDO},
- {"cmp4.le.orcm", A2, OpX2TbTaC (0xd, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.ltu", A2, OpX2TaC (0xd, 2, 0, 0), {P1, P2, IMM8, R3}},
- {"cmp.leu", A2, OpX2TaC (0xd, 2, 0, 0), {P1, P2, IMM8M1U8, R3}},
- {"cmp.gtu", A2, OpX2TaC (0xd, 2, 0, 0), {P2, P1, IMM8M1U8, R3}},
- {"cmp.geu", A2, OpX2TaC (0xd, 2, 0, 0), {P2, P1, IMM8, R3}},
- {"cmp.ltu.unc", A2, OpX2TaC (0xd, 2, 0, 1), {P1, P2, IMM8, R3}},
- {"cmp.leu.unc", A2, OpX2TaC (0xd, 2, 0, 1), {P1, P2, IMM8M1U8, R3}},
- {"cmp.gtu.unc", A2, OpX2TaC (0xd, 2, 0, 1), {P2, P1, IMM8M1U8, R3}},
- {"cmp.geu.unc", A2, OpX2TaC (0xd, 2, 0, 1), {P2, P1, IMM8, R3}},
- {"cmp.eq.or", A2, OpX2TaC (0xd, 2, 1, 0), {P1, P2, IMM8, R3}},
- {"cmp.ne.orcm", A2, OpX2TaC (0xd, 2, 1, 0), {P1, P2, IMM8, R3}, PSEUDO},
- {"cmp.ne.or", A2, OpX2TaC (0xd, 2, 1, 1), {P1, P2, IMM8, R3}},
- {"cmp.eq.orcm", A2, OpX2TaC (0xd, 2, 1, 1), {P1, P2, IMM8, R3}, PSEUDO},
- {"cmp4.ltu", A2, OpX2TaC (0xd, 3, 0, 0), {P1, P2, IMM8U4, R3}},
- {"cmp4.leu", A2, OpX2TaC (0xd, 3, 0, 0), {P1, P2, IMM8M1U4, R3}},
- {"cmp4.gtu", A2, OpX2TaC (0xd, 3, 0, 0), {P2, P1, IMM8M1U4, R3}},
- {"cmp4.geu", A2, OpX2TaC (0xd, 3, 0, 0), {P2, P1, IMM8U4, R3}},
- {"cmp4.ltu.unc", A2, OpX2TaC (0xd, 3, 0, 1), {P1, P2, IMM8U4, R3}},
- {"cmp4.leu.unc", A2, OpX2TaC (0xd, 3, 0, 1), {P1, P2, IMM8M1U4, R3}},
- {"cmp4.gtu.unc", A2, OpX2TaC (0xd, 3, 0, 1), {P2, P1, IMM8M1U4, R3}},
- {"cmp4.geu.unc", A2, OpX2TaC (0xd, 3, 0, 1), {P2, P1, IMM8U4, R3}},
- {"cmp4.eq.or", A2, OpX2TaC (0xd, 3, 1, 0), {P1, P2, IMM8, R3}},
- {"cmp4.ne.orcm", A2, OpX2TaC (0xd, 3, 1, 0), {P1, P2, IMM8, R3}, PSEUDO},
- {"cmp4.ne.or", A2, OpX2TaC (0xd, 3, 1, 1), {P1, P2, IMM8, R3}},
- {"cmp4.eq.orcm", A2, OpX2TaC (0xd, 3, 1, 1), {P1, P2, IMM8, R3}, PSEUDO},
- {"cmp.eq", A2, OpX2TbTaC (0xe, 0, 0, 0, 0), {P1, P2, R2, R3}},
- {"cmp.ne", A2, OpX2TbTaC (0xe, 0, 0, 0, 0), {P2, P1, R2, R3}},
- {"cmp.eq.unc", A2, OpX2TbTaC (0xe, 0, 0, 0, 1), {P1, P2, R2, R3}},
- {"cmp.ne.unc", A2, OpX2TbTaC (0xe, 0, 0, 0, 1), {P2, P1, R2, R3}},
- {"cmp.eq.or.andcm", A2, OpX2TbTaC (0xe, 0, 0, 1, 0), {P1, P2, R2, R3}},
- {"cmp.ne.and.orcm", A2, OpX2TbTaC (0xe, 0, 0, 1, 0), {P2, P1, R2, R3}, PSEUDO},
- {"cmp.ne.or.andcm", A2, OpX2TbTaC (0xe, 0, 0, 1, 1), {P1, P2, R2, R3}},
- {"cmp.eq.and.orcm", A2, OpX2TbTaC (0xe, 0, 0, 1, 1), {P2, P1, R2, R3}, PSEUDO},
- {"cmp4.eq", A2, OpX2TbTaC (0xe, 1, 0, 0, 0), {P1, P2, R2, R3}},
- {"cmp4.ne", A2, OpX2TbTaC (0xe, 1, 0, 0, 0), {P2, P1, R2, R3}},
- {"cmp4.eq.unc", A2, OpX2TbTaC (0xe, 1, 0, 0, 1), {P1, P2, R2, R3}},
- {"cmp4.ne.unc", A2, OpX2TbTaC (0xe, 1, 0, 0, 1), {P2, P1, R2, R3}},
- {"cmp4.eq.or.andcm", A2, OpX2TbTaC (0xe, 1, 0, 1, 0), {P1, P2, R2, R3}},
- {"cmp4.ne.and.orcm", A2, OpX2TbTaC (0xe, 1, 0, 1, 0), {P2, P1, R2, R3}, PSEUDO},
- {"cmp4.ne.or.andcm", A2, OpX2TbTaC (0xe, 1, 0, 1, 1), {P1, P2, R2, R3}},
- {"cmp4.eq.and.orcm", A2, OpX2TbTaC (0xe, 1, 0, 1, 1), {P2, P1, R2, R3}, PSEUDO},
- {"cmp.gt.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 0), {P1, P2, GR0, R3}},
- {"cmp.lt.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.le.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 0), {P2, P1, GR0, R3}, PSEUDO},
- {"cmp.ge.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 0), {P2, P1, R3, GR0}, PSEUDO},
- {"cmp.le.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 1), {P1, P2, GR0, R3}},
- {"cmp.ge.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.gt.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 1), {P2, P1, GR0, R3}, PSEUDO},
- {"cmp.lt.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 1), {P2, P1, R3, GR0}, PSEUDO},
- {"cmp.ge.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 0), {P1, P2, GR0, R3}},
- {"cmp.le.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.lt.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 0), {P2, P1, GR0, R3}, PSEUDO},
- {"cmp.gt.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 0), {P2, P1, R3, GR0}, PSEUDO},
- {"cmp.lt.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 1), {P1, P2, GR0, R3}},
- {"cmp.gt.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp.ge.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 1), {P2, P1, GR0, R3}, PSEUDO},
- {"cmp.le.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 1), {P2, P1, R3, GR0}, PSEUDO},
- {"cmp4.gt.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 0), {P1, P2, GR0, R3}},
- {"cmp4.lt.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.le.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 0), {P2, P1, GR0, R3}, PSEUDO},
- {"cmp4.ge.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 0), {P2, P1, R3, GR0}, PSEUDO},
- {"cmp4.le.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 1), {P1, P2, GR0, R3}},
- {"cmp4.ge.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.gt.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 1), {P2, P1, GR0, R3}, PSEUDO},
- {"cmp4.lt.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 1), {P2, P1, R3, GR0}, PSEUDO},
- {"cmp4.ge.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 0), {P1, P2, GR0, R3}},
- {"cmp4.le.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.lt.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 0), {P2, P1, GR0, R3}, PSEUDO},
- {"cmp4.gt.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 0), {P2, P1, R3, GR0}, PSEUDO},
- {"cmp4.lt.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 1), {P1, P2, GR0, R3}},
- {"cmp4.gt.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO},
- {"cmp4.ge.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 1), {P2, P1, GR0, R3}, PSEUDO},
- {"cmp4.le.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 1), {P2, P1, R3, GR0}, PSEUDO},
- {"cmp.eq", A2, OpX2TaC (0xe, 2, 0, 0), {P1, P2, IMM8, R3}},
- {"cmp.ne", A2, OpX2TaC (0xe, 2, 0, 0), {P2, P1, IMM8, R3}},
- {"cmp.eq.unc", A2, OpX2TaC (0xe, 2, 0, 1), {P1, P2, IMM8, R3}},
- {"cmp.ne.unc", A2, OpX2TaC (0xe, 2, 0, 1), {P2, P1, IMM8, R3}},
- {"cmp.eq.or.andcm", A2, OpX2TaC (0xe, 2, 1, 0), {P1, P2, IMM8, R3}},
- {"cmp.ne.and.orcm", A2, OpX2TaC (0xe, 2, 1, 0), {P2, P1, IMM8, R3}, PSEUDO},
- {"cmp.ne.or.andcm", A2, OpX2TaC (0xe, 2, 1, 1), {P1, P2, IMM8, R3}},
- {"cmp.eq.and.orcm", A2, OpX2TaC (0xe, 2, 1, 1), {P2, P1, IMM8, R3}, PSEUDO},
- {"cmp4.eq", A2, OpX2TaC (0xe, 3, 0, 0), {P1, P2, IMM8, R3}},
- {"cmp4.ne", A2, OpX2TaC (0xe, 3, 0, 0), {P2, P1, IMM8, R3}},
- {"cmp4.eq.unc", A2, OpX2TaC (0xe, 3, 0, 1), {P1, P2, IMM8, R3}},
- {"cmp4.ne.unc", A2, OpX2TaC (0xe, 3, 0, 1), {P2, P1, IMM8, R3}},
- {"cmp4.eq.or.andcm", A2, OpX2TaC (0xe, 3, 1, 0), {P1, P2, IMM8, R3}},
- {"cmp4.ne.and.orcm", A2, OpX2TaC (0xe, 3, 1, 0), {P2, P1, IMM8, R3}, PSEUDO},
- {"cmp4.ne.or.andcm", A2, OpX2TaC (0xe, 3, 1, 1), {P1, P2, IMM8, R3}},
- {"cmp4.eq.and.orcm", A2, OpX2TaC (0xe, 3, 1, 1), {P2, P1, IMM8, R3}, PSEUDO},
+ {"cmp.lt", A2, OpX2TbTaC (0xc, 0, 0, 0, 0), {P1, P2, R2, R3}, EMPTY},
+ {"cmp.le", A2, OpX2TbTaC (0xc, 0, 0, 0, 0), {P2, P1, R3, R2}, EMPTY},
+ {"cmp.gt", A2, OpX2TbTaC (0xc, 0, 0, 0, 0), {P1, P2, R3, R2}, EMPTY},
+ {"cmp.ge", A2, OpX2TbTaC (0xc, 0, 0, 0, 0), {P2, P1, R2, R3}, EMPTY},
+ {"cmp.lt.unc", A2, OpX2TbTaC (0xc, 0, 0, 0, 1), {P1, P2, R2, R3}, EMPTY},
+ {"cmp.le.unc", A2, OpX2TbTaC (0xc, 0, 0, 0, 1), {P2, P1, R3, R2}, EMPTY},
+ {"cmp.gt.unc", A2, OpX2TbTaC (0xc, 0, 0, 0, 1), {P1, P2, R3, R2}, EMPTY},
+ {"cmp.ge.unc", A2, OpX2TbTaC (0xc, 0, 0, 0, 1), {P2, P1, R2, R3}, EMPTY},
+ {"cmp.eq.and", A2, OpX2TbTaC (0xc, 0, 0, 1, 0), {P1, P2, R2, R3}, EMPTY},
+ {"cmp.ne.andcm", A2, OpX2TbTaC (0xc, 0, 0, 1, 0), {P1, P2, R2, R3}, PSEUDO, 0, NULL},
+ {"cmp.ne.and", A2, OpX2TbTaC (0xc, 0, 0, 1, 1), {P1, P2, R2, R3}, EMPTY},
+ {"cmp.eq.andcm", A2, OpX2TbTaC (0xc, 0, 0, 1, 1), {P1, P2, R2, R3}, PSEUDO, 0, NULL},
+ {"cmp4.lt", A2, OpX2TbTaC (0xc, 1, 0, 0, 0), {P1, P2, R2, R3}, EMPTY},
+ {"cmp4.le", A2, OpX2TbTaC (0xc, 1, 0, 0, 0), {P2, P1, R3, R2}, EMPTY},
+ {"cmp4.gt", A2, OpX2TbTaC (0xc, 1, 0, 0, 0), {P1, P2, R3, R2}, EMPTY},
+ {"cmp4.ge", A2, OpX2TbTaC (0xc, 1, 0, 0, 0), {P2, P1, R2, R3}, EMPTY},
+ {"cmp4.lt.unc", A2, OpX2TbTaC (0xc, 1, 0, 0, 1), {P1, P2, R2, R3}, EMPTY},
+ {"cmp4.le.unc", A2, OpX2TbTaC (0xc, 1, 0, 0, 1), {P2, P1, R3, R2}, EMPTY},
+ {"cmp4.gt.unc", A2, OpX2TbTaC (0xc, 1, 0, 0, 1), {P1, P2, R3, R2}, EMPTY},
+ {"cmp4.ge.unc", A2, OpX2TbTaC (0xc, 1, 0, 0, 1), {P2, P1, R2, R3}, EMPTY},
+ {"cmp4.eq.and", A2, OpX2TbTaC (0xc, 1, 0, 1, 0), {P1, P2, R2, R3}, EMPTY},
+ {"cmp4.ne.andcm", A2, OpX2TbTaC (0xc, 1, 0, 1, 0), {P1, P2, R2, R3}, PSEUDO, 0, NULL},
+ {"cmp4.ne.and", A2, OpX2TbTaC (0xc, 1, 0, 1, 1), {P1, P2, R2, R3}, EMPTY},
+ {"cmp4.eq.andcm", A2, OpX2TbTaC (0xc, 1, 0, 1, 1), {P1, P2, R2, R3}, PSEUDO, 0, NULL},
+ {"cmp.gt.and", A2, OpX2TbTaC (0xc, 0, 1, 0, 0), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp.lt.and", A2, OpX2TbTaC (0xc, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.le.andcm", A2, OpX2TbTaC (0xc, 0, 1, 0, 0), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp.ge.andcm", A2, OpX2TbTaC (0xc, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.le.and", A2, OpX2TbTaC (0xc, 0, 1, 0, 1), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp.ge.and", A2, OpX2TbTaC (0xc, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.gt.andcm", A2, OpX2TbTaC (0xc, 0, 1, 0, 1), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp.lt.andcm", A2, OpX2TbTaC (0xc, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.ge.and", A2, OpX2TbTaC (0xc, 0, 1, 1, 0), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp.le.and", A2, OpX2TbTaC (0xc, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.lt.andcm", A2, OpX2TbTaC (0xc, 0, 1, 1, 0), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp.gt.andcm", A2, OpX2TbTaC (0xc, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.lt.and", A2, OpX2TbTaC (0xc, 0, 1, 1, 1), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp.gt.and", A2, OpX2TbTaC (0xc, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.ge.andcm", A2, OpX2TbTaC (0xc, 0, 1, 1, 1), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp.le.andcm", A2, OpX2TbTaC (0xc, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.gt.and", A2, OpX2TbTaC (0xc, 1, 1, 0, 0), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp4.lt.and", A2, OpX2TbTaC (0xc, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.le.andcm", A2, OpX2TbTaC (0xc, 1, 1, 0, 0), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp4.ge.andcm", A2, OpX2TbTaC (0xc, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.le.and", A2, OpX2TbTaC (0xc, 1, 1, 0, 1), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp4.ge.and", A2, OpX2TbTaC (0xc, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.gt.andcm", A2, OpX2TbTaC (0xc, 1, 1, 0, 1), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp4.lt.andcm", A2, OpX2TbTaC (0xc, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.ge.and", A2, OpX2TbTaC (0xc, 1, 1, 1, 0), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp4.le.and", A2, OpX2TbTaC (0xc, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.lt.andcm", A2, OpX2TbTaC (0xc, 1, 1, 1, 0), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp4.gt.andcm", A2, OpX2TbTaC (0xc, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.lt.and", A2, OpX2TbTaC (0xc, 1, 1, 1, 1), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp4.gt.and", A2, OpX2TbTaC (0xc, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.ge.andcm", A2, OpX2TbTaC (0xc, 1, 1, 1, 1), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp4.le.andcm", A2, OpX2TbTaC (0xc, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.lt", A2, OpX2TaC (0xc, 2, 0, 0), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp.le", A2, OpX2TaC (0xc, 2, 0, 0), {P1, P2, IMM8M1, R3}, EMPTY},
+ {"cmp.gt", A2, OpX2TaC (0xc, 2, 0, 0), {P2, P1, IMM8M1, R3}, EMPTY},
+ {"cmp.ge", A2, OpX2TaC (0xc, 2, 0, 0), {P2, P1, IMM8, R3}, EMPTY},
+ {"cmp.lt.unc", A2, OpX2TaC (0xc, 2, 0, 1), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp.le.unc", A2, OpX2TaC (0xc, 2, 0, 1), {P1, P2, IMM8M1, R3}, EMPTY},
+ {"cmp.gt.unc", A2, OpX2TaC (0xc, 2, 0, 1), {P2, P1, IMM8M1, R3}, EMPTY},
+ {"cmp.ge.unc", A2, OpX2TaC (0xc, 2, 0, 1), {P2, P1, IMM8, R3}, EMPTY},
+ {"cmp.eq.and", A2, OpX2TaC (0xc, 2, 1, 0), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp.ne.andcm", A2, OpX2TaC (0xc, 2, 1, 0), {P1, P2, IMM8, R3}, PSEUDO, 0, NULL},
+ {"cmp.ne.and", A2, OpX2TaC (0xc, 2, 1, 1), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp.eq.andcm", A2, OpX2TaC (0xc, 2, 1, 1), {P1, P2, IMM8, R3}, PSEUDO, 0, NULL},
+ {"cmp4.lt", A2, OpX2TaC (0xc, 3, 0, 0), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp4.le", A2, OpX2TaC (0xc, 3, 0, 0), {P1, P2, IMM8M1, R3}, EMPTY},
+ {"cmp4.gt", A2, OpX2TaC (0xc, 3, 0, 0), {P2, P1, IMM8M1, R3}, EMPTY},
+ {"cmp4.ge", A2, OpX2TaC (0xc, 3, 0, 0), {P2, P1, IMM8, R3}, EMPTY},
+ {"cmp4.lt.unc", A2, OpX2TaC (0xc, 3, 0, 1), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp4.le.unc", A2, OpX2TaC (0xc, 3, 0, 1), {P1, P2, IMM8M1, R3}, EMPTY},
+ {"cmp4.gt.unc", A2, OpX2TaC (0xc, 3, 0, 1), {P2, P1, IMM8M1, R3}, EMPTY},
+ {"cmp4.ge.unc", A2, OpX2TaC (0xc, 3, 0, 1), {P2, P1, IMM8, R3}, EMPTY},
+ {"cmp4.eq.and", A2, OpX2TaC (0xc, 3, 1, 0), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp4.ne.andcm", A2, OpX2TaC (0xc, 3, 1, 0), {P1, P2, IMM8, R3}, PSEUDO, 0, NULL},
+ {"cmp4.ne.and", A2, OpX2TaC (0xc, 3, 1, 1), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp4.eq.andcm", A2, OpX2TaC (0xc, 3, 1, 1), {P1, P2, IMM8, R3}, PSEUDO, 0, NULL},
+ {"cmp.ltu", A2, OpX2TbTaC (0xd, 0, 0, 0, 0), {P1, P2, R2, R3}, EMPTY},
+ {"cmp.leu", A2, OpX2TbTaC (0xd, 0, 0, 0, 0), {P2, P1, R3, R2}, EMPTY},
+ {"cmp.gtu", A2, OpX2TbTaC (0xd, 0, 0, 0, 0), {P1, P2, R3, R2}, EMPTY},
+ {"cmp.geu", A2, OpX2TbTaC (0xd, 0, 0, 0, 0), {P2, P1, R2, R3}, EMPTY},
+ {"cmp.ltu.unc", A2, OpX2TbTaC (0xd, 0, 0, 0, 1), {P1, P2, R2, R3}, EMPTY},
+ {"cmp.leu.unc", A2, OpX2TbTaC (0xd, 0, 0, 0, 1), {P2, P1, R3, R2}, EMPTY},
+ {"cmp.gtu.unc", A2, OpX2TbTaC (0xd, 0, 0, 0, 1), {P1, P2, R3, R2}, EMPTY},
+ {"cmp.geu.unc", A2, OpX2TbTaC (0xd, 0, 0, 0, 1), {P2, P1, R2, R3}, EMPTY},
+ {"cmp.eq.or", A2, OpX2TbTaC (0xd, 0, 0, 1, 0), {P1, P2, R2, R3}, EMPTY},
+ {"cmp.ne.orcm", A2, OpX2TbTaC (0xd, 0, 0, 1, 0), {P1, P2, R2, R3}, PSEUDO, 0, NULL},
+ {"cmp.ne.or", A2, OpX2TbTaC (0xd, 0, 0, 1, 1), {P1, P2, R2, R3}, EMPTY},
+ {"cmp.eq.orcm", A2, OpX2TbTaC (0xd, 0, 0, 1, 1), {P1, P2, R2, R3}, PSEUDO, 0, NULL},
+ {"cmp4.ltu", A2, OpX2TbTaC (0xd, 1, 0, 0, 0), {P1, P2, R2, R3}, EMPTY},
+ {"cmp4.leu", A2, OpX2TbTaC (0xd, 1, 0, 0, 0), {P2, P1, R3, R2}, EMPTY},
+ {"cmp4.gtu", A2, OpX2TbTaC (0xd, 1, 0, 0, 0), {P1, P2, R3, R2}, EMPTY},
+ {"cmp4.geu", A2, OpX2TbTaC (0xd, 1, 0, 0, 0), {P2, P1, R2, R3}, EMPTY},
+ {"cmp4.ltu.unc", A2, OpX2TbTaC (0xd, 1, 0, 0, 1), {P1, P2, R2, R3}, EMPTY},
+ {"cmp4.leu.unc", A2, OpX2TbTaC (0xd, 1, 0, 0, 1), {P2, P1, R3, R2}, EMPTY},
+ {"cmp4.gtu.unc", A2, OpX2TbTaC (0xd, 1, 0, 0, 1), {P1, P2, R3, R2}, EMPTY},
+ {"cmp4.geu.unc", A2, OpX2TbTaC (0xd, 1, 0, 0, 1), {P2, P1, R2, R3}, EMPTY},
+ {"cmp4.eq.or", A2, OpX2TbTaC (0xd, 1, 0, 1, 0), {P1, P2, R2, R3}, EMPTY},
+ {"cmp4.ne.orcm", A2, OpX2TbTaC (0xd, 1, 0, 1, 0), {P1, P2, R2, R3}, PSEUDO, 0, NULL},
+ {"cmp4.ne.or", A2, OpX2TbTaC (0xd, 1, 0, 1, 1), {P1, P2, R2, R3}, EMPTY},
+ {"cmp4.eq.orcm", A2, OpX2TbTaC (0xd, 1, 0, 1, 1), {P1, P2, R2, R3}, PSEUDO, 0, NULL},
+ {"cmp.gt.or", A2, OpX2TbTaC (0xd, 0, 1, 0, 0), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp.lt.or", A2, OpX2TbTaC (0xd, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.le.orcm", A2, OpX2TbTaC (0xd, 0, 1, 0, 0), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp.ge.orcm", A2, OpX2TbTaC (0xd, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.le.or", A2, OpX2TbTaC (0xd, 0, 1, 0, 1), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp.ge.or", A2, OpX2TbTaC (0xd, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.gt.orcm", A2, OpX2TbTaC (0xd, 0, 1, 0, 1), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp.lt.orcm", A2, OpX2TbTaC (0xd, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.ge.or", A2, OpX2TbTaC (0xd, 0, 1, 1, 0), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp.le.or", A2, OpX2TbTaC (0xd, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.lt.orcm", A2, OpX2TbTaC (0xd, 0, 1, 1, 0), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp.gt.orcm", A2, OpX2TbTaC (0xd, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.lt.or", A2, OpX2TbTaC (0xd, 0, 1, 1, 1), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp.gt.or", A2, OpX2TbTaC (0xd, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.ge.orcm", A2, OpX2TbTaC (0xd, 0, 1, 1, 1), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp.le.orcm", A2, OpX2TbTaC (0xd, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.gt.or", A2, OpX2TbTaC (0xd, 1, 1, 0, 0), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp4.lt.or", A2, OpX2TbTaC (0xd, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.le.orcm", A2, OpX2TbTaC (0xd, 1, 1, 0, 0), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp4.ge.orcm", A2, OpX2TbTaC (0xd, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.le.or", A2, OpX2TbTaC (0xd, 1, 1, 0, 1), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp4.ge.or", A2, OpX2TbTaC (0xd, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.gt.orcm", A2, OpX2TbTaC (0xd, 1, 1, 0, 1), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp4.lt.orcm", A2, OpX2TbTaC (0xd, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.ge.or", A2, OpX2TbTaC (0xd, 1, 1, 1, 0), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp4.le.or", A2, OpX2TbTaC (0xd, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.lt.orcm", A2, OpX2TbTaC (0xd, 1, 1, 1, 0), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp4.gt.orcm", A2, OpX2TbTaC (0xd, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.lt.or", A2, OpX2TbTaC (0xd, 1, 1, 1, 1), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp4.gt.or", A2, OpX2TbTaC (0xd, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.ge.orcm", A2, OpX2TbTaC (0xd, 1, 1, 1, 1), {P1, P2, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp4.le.orcm", A2, OpX2TbTaC (0xd, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.ltu", A2, OpX2TaC (0xd, 2, 0, 0), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp.leu", A2, OpX2TaC (0xd, 2, 0, 0), {P1, P2, IMM8M1U8, R3}, EMPTY},
+ {"cmp.gtu", A2, OpX2TaC (0xd, 2, 0, 0), {P2, P1, IMM8M1U8, R3}, EMPTY},
+ {"cmp.geu", A2, OpX2TaC (0xd, 2, 0, 0), {P2, P1, IMM8, R3}, EMPTY},
+ {"cmp.ltu.unc", A2, OpX2TaC (0xd, 2, 0, 1), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp.leu.unc", A2, OpX2TaC (0xd, 2, 0, 1), {P1, P2, IMM8M1U8, R3}, EMPTY},
+ {"cmp.gtu.unc", A2, OpX2TaC (0xd, 2, 0, 1), {P2, P1, IMM8M1U8, R3}, EMPTY},
+ {"cmp.geu.unc", A2, OpX2TaC (0xd, 2, 0, 1), {P2, P1, IMM8, R3}, EMPTY},
+ {"cmp.eq.or", A2, OpX2TaC (0xd, 2, 1, 0), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp.ne.orcm", A2, OpX2TaC (0xd, 2, 1, 0), {P1, P2, IMM8, R3}, PSEUDO, 0, NULL},
+ {"cmp.ne.or", A2, OpX2TaC (0xd, 2, 1, 1), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp.eq.orcm", A2, OpX2TaC (0xd, 2, 1, 1), {P1, P2, IMM8, R3}, PSEUDO, 0, NULL},
+ {"cmp4.ltu", A2, OpX2TaC (0xd, 3, 0, 0), {P1, P2, IMM8U4, R3}, EMPTY},
+ {"cmp4.leu", A2, OpX2TaC (0xd, 3, 0, 0), {P1, P2, IMM8M1U4, R3}, EMPTY},
+ {"cmp4.gtu", A2, OpX2TaC (0xd, 3, 0, 0), {P2, P1, IMM8M1U4, R3}, EMPTY},
+ {"cmp4.geu", A2, OpX2TaC (0xd, 3, 0, 0), {P2, P1, IMM8U4, R3}, EMPTY},
+ {"cmp4.ltu.unc", A2, OpX2TaC (0xd, 3, 0, 1), {P1, P2, IMM8U4, R3}, EMPTY},
+ {"cmp4.leu.unc", A2, OpX2TaC (0xd, 3, 0, 1), {P1, P2, IMM8M1U4, R3}, EMPTY},
+ {"cmp4.gtu.unc", A2, OpX2TaC (0xd, 3, 0, 1), {P2, P1, IMM8M1U4, R3}, EMPTY},
+ {"cmp4.geu.unc", A2, OpX2TaC (0xd, 3, 0, 1), {P2, P1, IMM8U4, R3}, EMPTY},
+ {"cmp4.eq.or", A2, OpX2TaC (0xd, 3, 1, 0), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp4.ne.orcm", A2, OpX2TaC (0xd, 3, 1, 0), {P1, P2, IMM8, R3}, PSEUDO, 0, NULL},
+ {"cmp4.ne.or", A2, OpX2TaC (0xd, 3, 1, 1), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp4.eq.orcm", A2, OpX2TaC (0xd, 3, 1, 1), {P1, P2, IMM8, R3}, PSEUDO, 0, NULL},
+ {"cmp.eq", A2, OpX2TbTaC (0xe, 0, 0, 0, 0), {P1, P2, R2, R3}, EMPTY},
+ {"cmp.ne", A2, OpX2TbTaC (0xe, 0, 0, 0, 0), {P2, P1, R2, R3}, EMPTY},
+ {"cmp.eq.unc", A2, OpX2TbTaC (0xe, 0, 0, 0, 1), {P1, P2, R2, R3}, EMPTY},
+ {"cmp.ne.unc", A2, OpX2TbTaC (0xe, 0, 0, 0, 1), {P2, P1, R2, R3}, EMPTY},
+ {"cmp.eq.or.andcm", A2, OpX2TbTaC (0xe, 0, 0, 1, 0), {P1, P2, R2, R3}, EMPTY},
+ {"cmp.ne.and.orcm", A2, OpX2TbTaC (0xe, 0, 0, 1, 0), {P2, P1, R2, R3}, PSEUDO, 0, NULL},
+ {"cmp.ne.or.andcm", A2, OpX2TbTaC (0xe, 0, 0, 1, 1), {P1, P2, R2, R3}, EMPTY},
+ {"cmp.eq.and.orcm", A2, OpX2TbTaC (0xe, 0, 0, 1, 1), {P2, P1, R2, R3}, PSEUDO, 0, NULL},
+ {"cmp4.eq", A2, OpX2TbTaC (0xe, 1, 0, 0, 0), {P1, P2, R2, R3}, EMPTY},
+ {"cmp4.ne", A2, OpX2TbTaC (0xe, 1, 0, 0, 0), {P2, P1, R2, R3}, EMPTY},
+ {"cmp4.eq.unc", A2, OpX2TbTaC (0xe, 1, 0, 0, 1), {P1, P2, R2, R3}, EMPTY},
+ {"cmp4.ne.unc", A2, OpX2TbTaC (0xe, 1, 0, 0, 1), {P2, P1, R2, R3}, EMPTY},
+ {"cmp4.eq.or.andcm", A2, OpX2TbTaC (0xe, 1, 0, 1, 0), {P1, P2, R2, R3}, EMPTY},
+ {"cmp4.ne.and.orcm", A2, OpX2TbTaC (0xe, 1, 0, 1, 0), {P2, P1, R2, R3}, PSEUDO, 0, NULL},
+ {"cmp4.ne.or.andcm", A2, OpX2TbTaC (0xe, 1, 0, 1, 1), {P1, P2, R2, R3}, EMPTY},
+ {"cmp4.eq.and.orcm", A2, OpX2TbTaC (0xe, 1, 0, 1, 1), {P2, P1, R2, R3}, PSEUDO, 0, NULL},
+ {"cmp.gt.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 0), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp.lt.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.le.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 0), {P2, P1, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp.ge.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 0), {P2, P1, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.le.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 1), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp.ge.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.gt.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 1), {P2, P1, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp.lt.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 1), {P2, P1, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.ge.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 0), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp.le.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.lt.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 0), {P2, P1, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp.gt.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 0), {P2, P1, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.lt.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 1), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp.gt.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.ge.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 1), {P2, P1, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp.le.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 1), {P2, P1, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.gt.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 0), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp4.lt.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.le.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 0), {P2, P1, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp4.ge.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 0), {P2, P1, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.le.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 1), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp4.ge.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.gt.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 1), {P2, P1, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp4.lt.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 1), {P2, P1, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.ge.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 0), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp4.le.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.lt.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 0), {P2, P1, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp4.gt.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 0), {P2, P1, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.lt.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 1), {P1, P2, GR0, R3}, EMPTY},
+ {"cmp4.gt.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp4.ge.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 1), {P2, P1, GR0, R3}, PSEUDO, 0, NULL},
+ {"cmp4.le.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 1), {P2, P1, R3, GR0}, PSEUDO, 0, NULL},
+ {"cmp.eq", A2, OpX2TaC (0xe, 2, 0, 0), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp.ne", A2, OpX2TaC (0xe, 2, 0, 0), {P2, P1, IMM8, R3}, EMPTY},
+ {"cmp.eq.unc", A2, OpX2TaC (0xe, 2, 0, 1), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp.ne.unc", A2, OpX2TaC (0xe, 2, 0, 1), {P2, P1, IMM8, R3}, EMPTY},
+ {"cmp.eq.or.andcm", A2, OpX2TaC (0xe, 2, 1, 0), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp.ne.and.orcm", A2, OpX2TaC (0xe, 2, 1, 0), {P2, P1, IMM8, R3}, PSEUDO, 0, NULL},
+ {"cmp.ne.or.andcm", A2, OpX2TaC (0xe, 2, 1, 1), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp.eq.and.orcm", A2, OpX2TaC (0xe, 2, 1, 1), {P2, P1, IMM8, R3}, PSEUDO, 0, NULL},
+ {"cmp4.eq", A2, OpX2TaC (0xe, 3, 0, 0), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp4.ne", A2, OpX2TaC (0xe, 3, 0, 0), {P2, P1, IMM8, R3}, EMPTY},
+ {"cmp4.eq.unc", A2, OpX2TaC (0xe, 3, 0, 1), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp4.ne.unc", A2, OpX2TaC (0xe, 3, 0, 1), {P2, P1, IMM8, R3}, EMPTY},
+ {"cmp4.eq.or.andcm", A2, OpX2TaC (0xe, 3, 1, 0), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp4.ne.and.orcm", A2, OpX2TaC (0xe, 3, 1, 0), {P2, P1, IMM8, R3}, PSEUDO, 0, NULL},
+ {"cmp4.ne.or.andcm", A2, OpX2TaC (0xe, 3, 1, 1), {P1, P2, IMM8, R3}, EMPTY},
+ {"cmp4.eq.and.orcm", A2, OpX2TaC (0xe, 3, 1, 1), {P2, P1, IMM8, R3}, PSEUDO, 0, NULL},
- {0}
+ {NULL, 0, 0, 0, 0, {0}, 0, 0, NULL}
};
#undef A
@@ -410,3 +414,4 @@ struct ia64_opcode ia64_opcodes_a[] =
#undef OpX2TaC
#undef OpX2aZaZbX4
#undef OpX2aZaZbX4X2b
+#undef EMPTY
diff --git a/opcodes/ia64-opc-b.c b/opcodes/ia64-opc-b.c
index 9a4a8506998..efc2536e8bf 100644
--- a/opcodes/ia64-opc-b.c
+++ b/opcodes/ia64-opc-b.c
@@ -1,5 +1,5 @@
/* ia64-opc-b.c -- IA-64 `B' opcode table.
- Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of GDB, GAS, and the GNU binutils.
@@ -69,12 +69,16 @@
(bOp (a) | bX6 (b) | bIh (c) | bWhb (d)), \
(mOp | mX6 | mIh | mWhb)
+/* Used to initialise unused fields in ia64_opcode struct,
+ in order to stop gcc from complaining. */
+#define EMPTY 0,0,NULL
+
struct ia64_opcode ia64_opcodes_b[] =
{
/* B-type instruction encodings (sorted according to major opcode) */
#define BR(a,b) \
- B0, OpX6BtypePaWhaDPr (0, 0x20, 0, a, 0, b, 0), {B2}, PSEUDO
+ B0, OpX6BtypePaWhaDPr (0, 0x20, 0, a, 0, b, 0), {B2}, PSEUDO, 0, NULL
{"br.few", BR (0, 0)},
{"br", BR (0, 0)},
{"br.few.clr", BR (0, 1)},
@@ -83,23 +87,25 @@ struct ia64_opcode ia64_opcodes_b[] =
{"br.many.clr", BR (1, 1)},
#undef BR
-#define BR(a,b,c,d,e) B0, OpX6BtypePaWhaD (0, a, b, c, d, e), {B2}
+#define BR(a,b,c,d,e) B0, OpX6BtypePaWhaD (0, a, b, c, d, e), {B2}, EMPTY
+#define BRP(a,b,c,d,e) B0, OpX6BtypePaWhaD (0, a, b, c, d, e), {B2}, PSEUDO, 0, NULL
+#define BRT(a,b,c,d,e,f) B0, OpX6BtypePaWhaD (0, a, b, c, d, e), {B2}, f, 0, NULL
{"br.cond.sptk.few", BR (0x20, 0, 0, 0, 0)},
- {"br.cond.sptk", BR (0x20, 0, 0, 0, 0), PSEUDO},
+ {"br.cond.sptk", BRP (0x20, 0, 0, 0, 0)},
{"br.cond.sptk.few.clr", BR (0x20, 0, 0, 0, 1)},
- {"br.cond.sptk.clr", BR (0x20, 0, 0, 0, 1), PSEUDO},
+ {"br.cond.sptk.clr", BRP (0x20, 0, 0, 0, 1)},
{"br.cond.spnt.few", BR (0x20, 0, 0, 1, 0)},
- {"br.cond.spnt", BR (0x20, 0, 0, 1, 0), PSEUDO},
+ {"br.cond.spnt", BRP (0x20, 0, 0, 1, 0)},
{"br.cond.spnt.few.clr", BR (0x20, 0, 0, 1, 1)},
- {"br.cond.spnt.clr", BR (0x20, 0, 0, 1, 1), PSEUDO},
+ {"br.cond.spnt.clr", BRP (0x20, 0, 0, 1, 1)},
{"br.cond.dptk.few", BR (0x20, 0, 0, 2, 0)},
- {"br.cond.dptk", BR (0x20, 0, 0, 2, 0), PSEUDO},
+ {"br.cond.dptk", BRP (0x20, 0, 0, 2, 0)},
{"br.cond.dptk.few.clr", BR (0x20, 0, 0, 2, 1)},
- {"br.cond.dptk.clr", BR (0x20, 0, 0, 2, 1), PSEUDO},
+ {"br.cond.dptk.clr", BRP (0x20, 0, 0, 2, 1)},
{"br.cond.dpnt.few", BR (0x20, 0, 0, 3, 0)},
- {"br.cond.dpnt", BR (0x20, 0, 0, 3, 0), PSEUDO},
+ {"br.cond.dpnt", BRP (0x20, 0, 0, 3, 0)},
{"br.cond.dpnt.few.clr", BR (0x20, 0, 0, 3, 1)},
- {"br.cond.dpnt.clr", BR (0x20, 0, 0, 3, 1), PSEUDO},
+ {"br.cond.dpnt.clr", BRP (0x20, 0, 0, 3, 1)},
{"br.cond.sptk.many", BR (0x20, 0, 1, 0, 0)},
{"br.cond.sptk.many.clr", BR (0x20, 0, 1, 0, 1)},
{"br.cond.spnt.many", BR (0x20, 0, 1, 1, 0)},
@@ -109,21 +115,21 @@ struct ia64_opcode ia64_opcodes_b[] =
{"br.cond.dpnt.many", BR (0x20, 0, 1, 3, 0)},
{"br.cond.dpnt.many.clr", BR (0x20, 0, 1, 3, 1)},
{"br.sptk.few", BR (0x20, 0, 0, 0, 0)},
- {"br.sptk", BR (0x20, 0, 0, 0, 0), PSEUDO},
+ {"br.sptk", BRP (0x20, 0, 0, 0, 0)},
{"br.sptk.few.clr", BR (0x20, 0, 0, 0, 1)},
- {"br.sptk.clr", BR (0x20, 0, 0, 0, 1), PSEUDO},
+ {"br.sptk.clr", BRP (0x20, 0, 0, 0, 1)},
{"br.spnt.few", BR (0x20, 0, 0, 1, 0)},
- {"br.spnt", BR (0x20, 0, 0, 1, 0), PSEUDO},
+ {"br.spnt", BRP (0x20, 0, 0, 1, 0)},
{"br.spnt.few.clr", BR (0x20, 0, 0, 1, 1)},
- {"br.spnt.clr", BR (0x20, 0, 0, 1, 1), PSEUDO},
+ {"br.spnt.clr", BRP (0x20, 0, 0, 1, 1)},
{"br.dptk.few", BR (0x20, 0, 0, 2, 0)},
- {"br.dptk", BR (0x20, 0, 0, 2, 0), PSEUDO},
+ {"br.dptk", BRP (0x20, 0, 0, 2, 0)},
{"br.dptk.few.clr", BR (0x20, 0, 0, 2, 1)},
- {"br.dptk.clr", BR (0x20, 0, 0, 2, 1), PSEUDO},
+ {"br.dptk.clr", BRP (0x20, 0, 0, 2, 1)},
{"br.dpnt.few", BR (0x20, 0, 0, 3, 0)},
- {"br.dpnt", BR (0x20, 0, 0, 3, 0), PSEUDO},
+ {"br.dpnt", BRP (0x20, 0, 0, 3, 0)},
{"br.dpnt.few.clr", BR (0x20, 0, 0, 3, 1)},
- {"br.dpnt.clr", BR (0x20, 0, 0, 3, 1), PSEUDO},
+ {"br.dpnt.clr", BRP (0x20, 0, 0, 3, 1)},
{"br.sptk.many", BR (0x20, 0, 1, 0, 0)},
{"br.sptk.many.clr", BR (0x20, 0, 1, 0, 1)},
{"br.spnt.many", BR (0x20, 0, 1, 1, 0)},
@@ -133,21 +139,21 @@ struct ia64_opcode ia64_opcodes_b[] =
{"br.dpnt.many", BR (0x20, 0, 1, 3, 0)},
{"br.dpnt.many.clr", BR (0x20, 0, 1, 3, 1)},
{"br.ia.sptk.few", BR (0x20, 1, 0, 0, 0)},
- {"br.ia.sptk", BR (0x20, 1, 0, 0, 0), PSEUDO},
+ {"br.ia.sptk", BRP (0x20, 1, 0, 0, 0)},
{"br.ia.sptk.few.clr", BR (0x20, 1, 0, 0, 1)},
- {"br.ia.sptk.clr", BR (0x20, 1, 0, 0, 1), PSEUDO},
+ {"br.ia.sptk.clr", BRP (0x20, 1, 0, 0, 1)},
{"br.ia.spnt.few", BR (0x20, 1, 0, 1, 0)},
- {"br.ia.spnt", BR (0x20, 1, 0, 1, 0), PSEUDO},
+ {"br.ia.spnt", BRP (0x20, 1, 0, 1, 0)},
{"br.ia.spnt.few.clr", BR (0x20, 1, 0, 1, 1)},
- {"br.ia.spnt.clr", BR (0x20, 1, 0, 1, 1), PSEUDO},
+ {"br.ia.spnt.clr", BRP (0x20, 1, 0, 1, 1)},
{"br.ia.dptk.few", BR (0x20, 1, 0, 2, 0)},
- {"br.ia.dptk", BR (0x20, 1, 0, 2, 0), PSEUDO},
+ {"br.ia.dptk", BRP (0x20, 1, 0, 2, 0)},
{"br.ia.dptk.few.clr", BR (0x20, 1, 0, 2, 1)},
- {"br.ia.dptk.clr", BR (0x20, 1, 0, 2, 1), PSEUDO},
+ {"br.ia.dptk.clr", BRP (0x20, 1, 0, 2, 1)},
{"br.ia.dpnt.few", BR (0x20, 1, 0, 3, 0)},
- {"br.ia.dpnt", BR (0x20, 1, 0, 3, 0), PSEUDO},
+ {"br.ia.dpnt", BRP (0x20, 1, 0, 3, 0)},
{"br.ia.dpnt.few.clr", BR (0x20, 1, 0, 3, 1)},
- {"br.ia.dpnt.clr", BR (0x20, 1, 0, 3, 1), PSEUDO},
+ {"br.ia.dpnt.clr", BRP (0x20, 1, 0, 3, 1)},
{"br.ia.sptk.many", BR (0x20, 1, 1, 0, 0)},
{"br.ia.sptk.many.clr", BR (0x20, 1, 1, 0, 1)},
{"br.ia.spnt.many", BR (0x20, 1, 1, 1, 0)},
@@ -156,69 +162,71 @@ struct ia64_opcode ia64_opcodes_b[] =
{"br.ia.dptk.many.clr", BR (0x20, 1, 1, 2, 1)},
{"br.ia.dpnt.many", BR (0x20, 1, 1, 3, 0)},
{"br.ia.dpnt.many.clr", BR (0x20, 1, 1, 3, 1)},
- {"br.ret.sptk.few", BR (0x21, 4, 0, 0, 0), MOD_RRBS},
- {"br.ret.sptk", BR (0x21, 4, 0, 0, 0), PSEUDO | MOD_RRBS},
- {"br.ret.sptk.few.clr", BR (0x21, 4, 0, 0, 1), MOD_RRBS},
- {"br.ret.sptk.clr", BR (0x21, 4, 0, 0, 1), PSEUDO | MOD_RRBS},
- {"br.ret.spnt.few", BR (0x21, 4, 0, 1, 0), MOD_RRBS},
- {"br.ret.spnt", BR (0x21, 4, 0, 1, 0), PSEUDO | MOD_RRBS},
- {"br.ret.spnt.few.clr", BR (0x21, 4, 0, 1, 1), MOD_RRBS},
- {"br.ret.spnt.clr", BR (0x21, 4, 0, 1, 1), PSEUDO | MOD_RRBS},
- {"br.ret.dptk.few", BR (0x21, 4, 0, 2, 0), MOD_RRBS},
- {"br.ret.dptk", BR (0x21, 4, 0, 2, 0), PSEUDO | MOD_RRBS},
- {"br.ret.dptk.few.clr", BR (0x21, 4, 0, 2, 1), MOD_RRBS},
- {"br.ret.dptk.clr", BR (0x21, 4, 0, 2, 1), PSEUDO | MOD_RRBS},
- {"br.ret.dpnt.few", BR (0x21, 4, 0, 3, 0), MOD_RRBS},
- {"br.ret.dpnt", BR (0x21, 4, 0, 3, 0), PSEUDO | MOD_RRBS},
- {"br.ret.dpnt.few.clr", BR (0x21, 4, 0, 3, 1), MOD_RRBS},
- {"br.ret.dpnt.clr", BR (0x21, 4, 0, 3, 1), PSEUDO | MOD_RRBS},
- {"br.ret.sptk.many", BR (0x21, 4, 1, 0, 0), MOD_RRBS},
- {"br.ret.sptk.many.clr", BR (0x21, 4, 1, 0, 1), MOD_RRBS},
- {"br.ret.spnt.many", BR (0x21, 4, 1, 1, 0), MOD_RRBS},
- {"br.ret.spnt.many.clr", BR (0x21, 4, 1, 1, 1), MOD_RRBS},
- {"br.ret.dptk.many", BR (0x21, 4, 1, 2, 0), MOD_RRBS},
- {"br.ret.dptk.many.clr", BR (0x21, 4, 1, 2, 1), MOD_RRBS},
- {"br.ret.dpnt.many", BR (0x21, 4, 1, 3, 0), MOD_RRBS},
- {"br.ret.dpnt.many.clr", BR (0x21, 4, 1, 3, 1), MOD_RRBS},
+ {"br.ret.sptk.few", BRT (0x21, 4, 0, 0, 0, MOD_RRBS)},
+ {"br.ret.sptk", BRT (0x21, 4, 0, 0, 0, PSEUDO | MOD_RRBS)},
+ {"br.ret.sptk.few.clr", BRT (0x21, 4, 0, 0, 1, MOD_RRBS)},
+ {"br.ret.sptk.clr", BRT (0x21, 4, 0, 0, 1, PSEUDO | MOD_RRBS)},
+ {"br.ret.spnt.few", BRT (0x21, 4, 0, 1, 0, MOD_RRBS)},
+ {"br.ret.spnt", BRT (0x21, 4, 0, 1, 0, PSEUDO | MOD_RRBS)},
+ {"br.ret.spnt.few.clr", BRT (0x21, 4, 0, 1, 1, MOD_RRBS)},
+ {"br.ret.spnt.clr", BRT (0x21, 4, 0, 1, 1, PSEUDO | MOD_RRBS)},
+ {"br.ret.dptk.few", BRT (0x21, 4, 0, 2, 0, MOD_RRBS)},
+ {"br.ret.dptk", BRT (0x21, 4, 0, 2, 0, PSEUDO | MOD_RRBS)},
+ {"br.ret.dptk.few.clr", BRT (0x21, 4, 0, 2, 1, MOD_RRBS)},
+ {"br.ret.dptk.clr", BRT (0x21, 4, 0, 2, 1, PSEUDO | MOD_RRBS)},
+ {"br.ret.dpnt.few", BRT (0x21, 4, 0, 3, 0, MOD_RRBS)},
+ {"br.ret.dpnt", BRT (0x21, 4, 0, 3, 0, PSEUDO | MOD_RRBS)},
+ {"br.ret.dpnt.few.clr", BRT (0x21, 4, 0, 3, 1, MOD_RRBS)},
+ {"br.ret.dpnt.clr", BRT (0x21, 4, 0, 3, 1, PSEUDO | MOD_RRBS)},
+ {"br.ret.sptk.many", BRT (0x21, 4, 1, 0, 0, MOD_RRBS)},
+ {"br.ret.sptk.many.clr", BRT (0x21, 4, 1, 0, 1, MOD_RRBS)},
+ {"br.ret.spnt.many", BRT (0x21, 4, 1, 1, 0, MOD_RRBS)},
+ {"br.ret.spnt.many.clr", BRT (0x21, 4, 1, 1, 1, MOD_RRBS)},
+ {"br.ret.dptk.many", BRT (0x21, 4, 1, 2, 0, MOD_RRBS)},
+ {"br.ret.dptk.many.clr", BRT (0x21, 4, 1, 2, 1, MOD_RRBS)},
+ {"br.ret.dpnt.many", BRT (0x21, 4, 1, 3, 0, MOD_RRBS)},
+ {"br.ret.dpnt.many.clr", BRT (0x21, 4, 1, 3, 1, MOD_RRBS)},
#undef BR
+#undef BRP
+#undef BRT
+
+ {"cover", B0, OpX6 (0, 0x02), {0, }, NO_PRED | LAST | MOD_RRBS, 0, NULL},
+ {"clrrrb", B0, OpX6 (0, 0x04), {0, }, NO_PRED | LAST | MOD_RRBS, 0, NULL},
+ {"clrrrb.pr", B0, OpX6 (0, 0x05), {0, }, NO_PRED | LAST | MOD_RRBS, 0, NULL},
+ {"rfi", B0, OpX6 (0, 0x08), {0, }, NO_PRED | LAST | PRIV | MOD_RRBS, 0, NULL},
+ {"bsw.0", B0, OpX6 (0, 0x0c), {0, }, NO_PRED | LAST | PRIV, 0, NULL},
+ {"bsw.1", B0, OpX6 (0, 0x0d), {0, }, NO_PRED | LAST | PRIV, 0, NULL},
+ {"epc", B0, OpX6 (0, 0x10), {0, }, NO_PRED, 0, NULL},
- {"cover", B0, OpX6 (0, 0x02), {0, }, NO_PRED | LAST | MOD_RRBS},
- {"clrrrb", B0, OpX6 (0, 0x04), {0, }, NO_PRED | LAST | MOD_RRBS},
- {"clrrrb.pr", B0, OpX6 (0, 0x05), {0, }, NO_PRED | LAST | MOD_RRBS},
- {"rfi", B0, OpX6 (0, 0x08), {0, }, NO_PRED | LAST | PRIV | MOD_RRBS},
- {"bsw.0", B0, OpX6 (0, 0x0c), {0, }, NO_PRED | LAST | PRIV},
- {"bsw.1", B0, OpX6 (0, 0x0d), {0, }, NO_PRED | LAST | PRIV},
- {"epc", B0, OpX6 (0, 0x10), {0, }, NO_PRED},
-
- {"break.b", B0, OpX6 (0, 0x00), {IMMU21}},
+ {"break.b", B0, OpX6 (0, 0x00), {IMMU21}, EMPTY},
- {"br.call.sptk.few", B, OpPaWhcD (1, 0, 1, 0), {B1, B2}},
- {"br.call.sptk", B, OpPaWhcD (1, 0, 1, 0), {B1, B2}, PSEUDO},
- {"br.call.sptk.few.clr", B, OpPaWhcD (1, 0, 1, 1), {B1, B2}},
- {"br.call.sptk.clr", B, OpPaWhcD (1, 0, 1, 1), {B1, B2}, PSEUDO},
- {"br.call.spnt.few", B, OpPaWhcD (1, 0, 3, 0), {B1, B2}},
- {"br.call.spnt", B, OpPaWhcD (1, 0, 3, 0), {B1, B2}, PSEUDO},
- {"br.call.spnt.few.clr", B, OpPaWhcD (1, 0, 3, 1), {B1, B2}},
- {"br.call.spnt.clr", B, OpPaWhcD (1, 0, 3, 1), {B1, B2}, PSEUDO},
- {"br.call.dptk.few", B, OpPaWhcD (1, 0, 5, 0), {B1, B2}},
- {"br.call.dptk", B, OpPaWhcD (1, 0, 5, 0), {B1, B2}, PSEUDO},
- {"br.call.dptk.few.clr", B, OpPaWhcD (1, 0, 5, 1), {B1, B2}},
- {"br.call.dptk.clr", B, OpPaWhcD (1, 0, 5, 1), {B1, B2}, PSEUDO},
- {"br.call.dpnt.few", B, OpPaWhcD (1, 0, 7, 0), {B1, B2}},
- {"br.call.dpnt", B, OpPaWhcD (1, 0, 7, 0), {B1, B2}, PSEUDO},
- {"br.call.dpnt.few.clr", B, OpPaWhcD (1, 0, 7, 1), {B1, B2}},
- {"br.call.dpnt.clr", B, OpPaWhcD (1, 0, 7, 1), {B1, B2}, PSEUDO},
- {"br.call.sptk.many", B, OpPaWhcD (1, 1, 1, 0), {B1, B2}},
- {"br.call.sptk.many.clr", B, OpPaWhcD (1, 1, 1, 1), {B1, B2}},
- {"br.call.spnt.many", B, OpPaWhcD (1, 1, 3, 0), {B1, B2}},
- {"br.call.spnt.many.clr", B, OpPaWhcD (1, 1, 3, 1), {B1, B2}},
- {"br.call.dptk.many", B, OpPaWhcD (1, 1, 5, 0), {B1, B2}},
- {"br.call.dptk.many.clr", B, OpPaWhcD (1, 1, 5, 1), {B1, B2}},
- {"br.call.dpnt.many", B, OpPaWhcD (1, 1, 7, 0), {B1, B2}},
- {"br.call.dpnt.many.clr", B, OpPaWhcD (1, 1, 7, 1), {B1, B2}},
+ {"br.call.sptk.few", B, OpPaWhcD (1, 0, 1, 0), {B1, B2}, EMPTY},
+ {"br.call.sptk", B, OpPaWhcD (1, 0, 1, 0), {B1, B2}, PSEUDO, 0, NULL},
+ {"br.call.sptk.few.clr", B, OpPaWhcD (1, 0, 1, 1), {B1, B2}, EMPTY},
+ {"br.call.sptk.clr", B, OpPaWhcD (1, 0, 1, 1), {B1, B2}, PSEUDO, 0, NULL},
+ {"br.call.spnt.few", B, OpPaWhcD (1, 0, 3, 0), {B1, B2}, EMPTY},
+ {"br.call.spnt", B, OpPaWhcD (1, 0, 3, 0), {B1, B2}, PSEUDO, 0, NULL},
+ {"br.call.spnt.few.clr", B, OpPaWhcD (1, 0, 3, 1), {B1, B2}, EMPTY},
+ {"br.call.spnt.clr", B, OpPaWhcD (1, 0, 3, 1), {B1, B2}, PSEUDO, 0, NULL},
+ {"br.call.dptk.few", B, OpPaWhcD (1, 0, 5, 0), {B1, B2}, EMPTY},
+ {"br.call.dptk", B, OpPaWhcD (1, 0, 5, 0), {B1, B2}, PSEUDO, 0, NULL},
+ {"br.call.dptk.few.clr", B, OpPaWhcD (1, 0, 5, 1), {B1, B2}, EMPTY},
+ {"br.call.dptk.clr", B, OpPaWhcD (1, 0, 5, 1), {B1, B2}, PSEUDO, 0, NULL},
+ {"br.call.dpnt.few", B, OpPaWhcD (1, 0, 7, 0), {B1, B2}, EMPTY},
+ {"br.call.dpnt", B, OpPaWhcD (1, 0, 7, 0), {B1, B2}, PSEUDO, 0, NULL},
+ {"br.call.dpnt.few.clr", B, OpPaWhcD (1, 0, 7, 1), {B1, B2}, EMPTY},
+ {"br.call.dpnt.clr", B, OpPaWhcD (1, 0, 7, 1), {B1, B2}, PSEUDO, 0, NULL},
+ {"br.call.sptk.many", B, OpPaWhcD (1, 1, 1, 0), {B1, B2}, EMPTY},
+ {"br.call.sptk.many.clr", B, OpPaWhcD (1, 1, 1, 1), {B1, B2}, EMPTY},
+ {"br.call.spnt.many", B, OpPaWhcD (1, 1, 3, 0), {B1, B2}, EMPTY},
+ {"br.call.spnt.many.clr", B, OpPaWhcD (1, 1, 3, 1), {B1, B2}, EMPTY},
+ {"br.call.dptk.many", B, OpPaWhcD (1, 1, 5, 0), {B1, B2}, EMPTY},
+ {"br.call.dptk.many.clr", B, OpPaWhcD (1, 1, 5, 1), {B1, B2}, EMPTY},
+ {"br.call.dpnt.many", B, OpPaWhcD (1, 1, 7, 0), {B1, B2}, EMPTY},
+ {"br.call.dpnt.many.clr", B, OpPaWhcD (1, 1, 7, 1), {B1, B2}, EMPTY},
#define BRP(a,b,c) \
- B0, OpX6IhWhb (2, a, b, c), {B2, TAG13}, NO_PRED
+ B0, OpX6IhWhb (2, a, b, c), {B2, TAG13}, NO_PRED, 0, NULL
{"brp.sptk", BRP (0x10, 0, 0)},
{"brp.dptk", BRP (0x10, 0, 2)},
{"brp.sptk.imp", BRP (0x10, 1, 0)},
@@ -229,10 +237,10 @@ struct ia64_opcode ia64_opcodes_b[] =
{"brp.ret.dptk.imp", BRP (0x11, 1, 2)},
#undef BRP
- {"nop.b", B0, OpX6 (2, 0x00), {IMMU21}},
+ {"nop.b", B0, OpX6 (2, 0x00), {IMMU21}, EMPTY},
#define BR(a,b) \
- B0, OpBtypePaWhaDPr (4, 0, a, 0, b, 0), {TGT25c}, PSEUDO
+ B0, OpBtypePaWhaDPr (4, 0, a, 0, b, 0), {TGT25c}, PSEUDO, 0, NULL
{"br.few", BR (0, 0)},
{"br", BR (0, 0)},
{"br.few.clr", BR (0, 1)},
@@ -242,23 +250,25 @@ struct ia64_opcode ia64_opcodes_b[] =
#undef BR
#define BR(a,b,c) \
- B0, OpBtypePaWhaD (4, 0, a, b, c), {TGT25c}
+ B0, OpBtypePaWhaD (4, 0, a, b, c), {TGT25c}, EMPTY
+#define BRP(a,b,c) \
+ B0, OpBtypePaWhaD (4, 0, a, b, c), {TGT25c}, PSEUDO, 0, NULL
{"br.cond.sptk.few", BR (0, 0, 0)},
- {"br.cond.sptk", BR (0, 0, 0), PSEUDO},
+ {"br.cond.sptk", BRP (0, 0, 0)},
{"br.cond.sptk.few.clr", BR (0, 0, 1)},
- {"br.cond.sptk.clr", BR (0, 0, 1), PSEUDO},
+ {"br.cond.sptk.clr", BRP (0, 0, 1)},
{"br.cond.spnt.few", BR (0, 1, 0)},
- {"br.cond.spnt", BR (0, 1, 0), PSEUDO},
+ {"br.cond.spnt", BRP (0, 1, 0)},
{"br.cond.spnt.few.clr", BR (0, 1, 1)},
- {"br.cond.spnt.clr", BR (0, 1, 1), PSEUDO},
+ {"br.cond.spnt.clr", BRP (0, 1, 1)},
{"br.cond.dptk.few", BR (0, 2, 0)},
- {"br.cond.dptk", BR (0, 2, 0), PSEUDO},
+ {"br.cond.dptk", BRP (0, 2, 0)},
{"br.cond.dptk.few.clr", BR (0, 2, 1)},
- {"br.cond.dptk.clr", BR (0, 2, 1), PSEUDO},
+ {"br.cond.dptk.clr", BRP (0, 2, 1)},
{"br.cond.dpnt.few", BR (0, 3, 0)},
- {"br.cond.dpnt", BR (0, 3, 0), PSEUDO},
+ {"br.cond.dpnt", BRP (0, 3, 0)},
{"br.cond.dpnt.few.clr", BR (0, 3, 1)},
- {"br.cond.dpnt.clr", BR (0, 3, 1), PSEUDO},
+ {"br.cond.dpnt.clr", BRP (0, 3, 1)},
{"br.cond.sptk.many", BR (1, 0, 0)},
{"br.cond.sptk.many.clr", BR (1, 0, 1)},
{"br.cond.spnt.many", BR (1, 1, 0)},
@@ -268,21 +278,21 @@ struct ia64_opcode ia64_opcodes_b[] =
{"br.cond.dpnt.many", BR (1, 3, 0)},
{"br.cond.dpnt.many.clr", BR (1, 3, 1)},
{"br.sptk.few", BR (0, 0, 0)},
- {"br.sptk", BR (0, 0, 0), PSEUDO},
+ {"br.sptk", BRP (0, 0, 0)},
{"br.sptk.few.clr", BR (0, 0, 1)},
- {"br.sptk.clr", BR (0, 0, 1), PSEUDO},
+ {"br.sptk.clr", BRP (0, 0, 1)},
{"br.spnt.few", BR (0, 1, 0)},
- {"br.spnt", BR (0, 1, 0), PSEUDO},
+ {"br.spnt", BRP (0, 1, 0)},
{"br.spnt.few.clr", BR (0, 1, 1)},
- {"br.spnt.clr", BR (0, 1, 1), PSEUDO},
+ {"br.spnt.clr", BRP (0, 1, 1)},
{"br.dptk.few", BR (0, 2, 0)},
- {"br.dptk", BR (0, 2, 0), PSEUDO},
+ {"br.dptk", BRP (0, 2, 0)},
{"br.dptk.few.clr", BR (0, 2, 1)},
- {"br.dptk.clr", BR (0, 2, 1), PSEUDO},
+ {"br.dptk.clr", BRP (0, 2, 1)},
{"br.dpnt.few", BR (0, 3, 0)},
- {"br.dpnt", BR (0, 3, 0), PSEUDO},
+ {"br.dpnt", BRP (0, 3, 0)},
{"br.dpnt.few.clr", BR (0, 3, 1)},
- {"br.dpnt.clr", BR (0, 3, 1), PSEUDO},
+ {"br.dpnt.clr", BRP (0, 3, 1)},
{"br.sptk.many", BR (1, 0, 0)},
{"br.sptk.many.clr", BR (1, 0, 1)},
{"br.spnt.many", BR (1, 1, 0)},
@@ -292,77 +302,80 @@ struct ia64_opcode ia64_opcodes_b[] =
{"br.dpnt.many", BR (1, 3, 0)},
{"br.dpnt.many.clr", BR (1, 3, 1)},
#undef BR
+#undef BRP
-#define BR(a,b,c,d) \
- B0, OpBtypePaWhaD (4, a, b, c, d), {TGT25c}, SLOT2
- {"br.wexit.sptk.few", BR (2, 0, 0, 0) | MOD_RRBS},
- {"br.wexit.sptk", BR (2, 0, 0, 0) | PSEUDO | MOD_RRBS},
- {"br.wexit.sptk.few.clr", BR (2, 0, 0, 1) | MOD_RRBS},
- {"br.wexit.sptk.clr", BR (2, 0, 0, 1) | PSEUDO | MOD_RRBS},
- {"br.wexit.spnt.few", BR (2, 0, 1, 0) | MOD_RRBS},
- {"br.wexit.spnt", BR (2, 0, 1, 0) | PSEUDO | MOD_RRBS},
- {"br.wexit.spnt.few.clr", BR (2, 0, 1, 1) | MOD_RRBS},
- {"br.wexit.spnt.clr", BR (2, 0, 1, 1) | PSEUDO | MOD_RRBS},
- {"br.wexit.dptk.few", BR (2, 0, 2, 0) | MOD_RRBS},
- {"br.wexit.dptk", BR (2, 0, 2, 0) | PSEUDO | MOD_RRBS},
- {"br.wexit.dptk.few.clr", BR (2, 0, 2, 1) | MOD_RRBS},
- {"br.wexit.dptk.clr", BR (2, 0, 2, 1) | PSEUDO | MOD_RRBS},
- {"br.wexit.dpnt.few", BR (2, 0, 3, 0) | MOD_RRBS},
- {"br.wexit.dpnt", BR (2, 0, 3, 0) | PSEUDO | MOD_RRBS},
- {"br.wexit.dpnt.few.clr", BR (2, 0, 3, 1) | MOD_RRBS},
- {"br.wexit.dpnt.clr", BR (2, 0, 3, 1) | PSEUDO | MOD_RRBS},
- {"br.wexit.sptk.many", BR (2, 1, 0, 0) | MOD_RRBS},
- {"br.wexit.sptk.many.clr", BR (2, 1, 0, 1) | MOD_RRBS},
- {"br.wexit.spnt.many", BR (2, 1, 1, 0) | MOD_RRBS},
- {"br.wexit.spnt.many.clr", BR (2, 1, 1, 1) | MOD_RRBS},
- {"br.wexit.dptk.many", BR (2, 1, 2, 0) | MOD_RRBS},
- {"br.wexit.dptk.many.clr", BR (2, 1, 2, 1) | MOD_RRBS},
- {"br.wexit.dpnt.many", BR (2, 1, 3, 0) | MOD_RRBS},
- {"br.wexit.dpnt.many.clr", BR (2, 1, 3, 1) | MOD_RRBS},
- {"br.wtop.sptk.few", BR (3, 0, 0, 0) | MOD_RRBS},
- {"br.wtop.sptk", BR (3, 0, 0, 0) | PSEUDO | MOD_RRBS},
- {"br.wtop.sptk.few.clr", BR (3, 0, 0, 1) | MOD_RRBS},
- {"br.wtop.sptk.clr", BR (3, 0, 0, 1) | PSEUDO | MOD_RRBS},
- {"br.wtop.spnt.few", BR (3, 0, 1, 0) | MOD_RRBS},
- {"br.wtop.spnt", BR (3, 0, 1, 0) | PSEUDO | MOD_RRBS},
- {"br.wtop.spnt.few.clr", BR (3, 0, 1, 1) | MOD_RRBS},
- {"br.wtop.spnt.clr", BR (3, 0, 1, 1) | PSEUDO | MOD_RRBS},
- {"br.wtop.dptk.few", BR (3, 0, 2, 0) | MOD_RRBS},
- {"br.wtop.dptk", BR (3, 0, 2, 0) | PSEUDO | MOD_RRBS},
- {"br.wtop.dptk.few.clr", BR (3, 0, 2, 1) | MOD_RRBS},
- {"br.wtop.dptk.clr", BR (3, 0, 2, 1) | PSEUDO | MOD_RRBS},
- {"br.wtop.dpnt.few", BR (3, 0, 3, 0) | MOD_RRBS},
- {"br.wtop.dpnt", BR (3, 0, 3, 0) | PSEUDO | MOD_RRBS},
- {"br.wtop.dpnt.few.clr", BR (3, 0, 3, 1) | MOD_RRBS},
- {"br.wtop.dpnt.clr", BR (3, 0, 3, 1) | PSEUDO | MOD_RRBS},
- {"br.wtop.sptk.many", BR (3, 1, 0, 0) | MOD_RRBS},
- {"br.wtop.sptk.many.clr", BR (3, 1, 0, 1) | MOD_RRBS},
- {"br.wtop.spnt.many", BR (3, 1, 1, 0) | MOD_RRBS},
- {"br.wtop.spnt.many.clr", BR (3, 1, 1, 1) | MOD_RRBS},
- {"br.wtop.dptk.many", BR (3, 1, 2, 0) | MOD_RRBS},
- {"br.wtop.dptk.many.clr", BR (3, 1, 2, 1) | MOD_RRBS},
- {"br.wtop.dpnt.many", BR (3, 1, 3, 0) | MOD_RRBS},
- {"br.wtop.dpnt.many.clr", BR (3, 1, 3, 1) | MOD_RRBS},
+#define BR(a,b,c,d, e) \
+ B0, OpBtypePaWhaD (4, a, b, c, d), {TGT25c}, SLOT2 | e, 0, NULL
+ {"br.wexit.sptk.few", BR (2, 0, 0, 0, MOD_RRBS)},
+ {"br.wexit.sptk", BR (2, 0, 0, 0, PSEUDO | MOD_RRBS)},
+ {"br.wexit.sptk.few.clr", BR (2, 0, 0, 1, MOD_RRBS)},
+ {"br.wexit.sptk.clr", BR (2, 0, 0, 1, PSEUDO | MOD_RRBS)},
+ {"br.wexit.spnt.few", BR (2, 0, 1, 0, MOD_RRBS)},
+ {"br.wexit.spnt", BR (2, 0, 1, 0, PSEUDO | MOD_RRBS)},
+ {"br.wexit.spnt.few.clr", BR (2, 0, 1, 1, MOD_RRBS)},
+ {"br.wexit.spnt.clr", BR (2, 0, 1, 1, PSEUDO | MOD_RRBS)},
+ {"br.wexit.dptk.few", BR (2, 0, 2, 0, MOD_RRBS)},
+ {"br.wexit.dptk", BR (2, 0, 2, 0, PSEUDO | MOD_RRBS)},
+ {"br.wexit.dptk.few.clr", BR (2, 0, 2, 1, MOD_RRBS)},
+ {"br.wexit.dptk.clr", BR (2, 0, 2, 1, PSEUDO | MOD_RRBS)},
+ {"br.wexit.dpnt.few", BR (2, 0, 3, 0, MOD_RRBS)},
+ {"br.wexit.dpnt", BR (2, 0, 3, 0, PSEUDO | MOD_RRBS)},
+ {"br.wexit.dpnt.few.clr", BR (2, 0, 3, 1, MOD_RRBS)},
+ {"br.wexit.dpnt.clr", BR (2, 0, 3, 1, PSEUDO | MOD_RRBS)},
+ {"br.wexit.sptk.many", BR (2, 1, 0, 0, MOD_RRBS)},
+ {"br.wexit.sptk.many.clr", BR (2, 1, 0, 1, MOD_RRBS)},
+ {"br.wexit.spnt.many", BR (2, 1, 1, 0, MOD_RRBS)},
+ {"br.wexit.spnt.many.clr", BR (2, 1, 1, 1, MOD_RRBS)},
+ {"br.wexit.dptk.many", BR (2, 1, 2, 0, MOD_RRBS)},
+ {"br.wexit.dptk.many.clr", BR (2, 1, 2, 1, MOD_RRBS)},
+ {"br.wexit.dpnt.many", BR (2, 1, 3, 0, MOD_RRBS)},
+ {"br.wexit.dpnt.many.clr", BR (2, 1, 3, 1, MOD_RRBS)},
+ {"br.wtop.sptk.few", BR (3, 0, 0, 0, MOD_RRBS)},
+ {"br.wtop.sptk", BR (3, 0, 0, 0, PSEUDO | MOD_RRBS)},
+ {"br.wtop.sptk.few.clr", BR (3, 0, 0, 1, MOD_RRBS)},
+ {"br.wtop.sptk.clr", BR (3, 0, 0, 1, PSEUDO | MOD_RRBS)},
+ {"br.wtop.spnt.few", BR (3, 0, 1, 0, MOD_RRBS)},
+ {"br.wtop.spnt", BR (3, 0, 1, 0, PSEUDO | MOD_RRBS)},
+ {"br.wtop.spnt.few.clr", BR (3, 0, 1, 1, MOD_RRBS)},
+ {"br.wtop.spnt.clr", BR (3, 0, 1, 1, PSEUDO | MOD_RRBS)},
+ {"br.wtop.dptk.few", BR (3, 0, 2, 0, MOD_RRBS)},
+ {"br.wtop.dptk", BR (3, 0, 2, 0, PSEUDO | MOD_RRBS)},
+ {"br.wtop.dptk.few.clr", BR (3, 0, 2, 1, MOD_RRBS)},
+ {"br.wtop.dptk.clr", BR (3, 0, 2, 1, PSEUDO | MOD_RRBS)},
+ {"br.wtop.dpnt.few", BR (3, 0, 3, 0, MOD_RRBS)},
+ {"br.wtop.dpnt", BR (3, 0, 3, 0, PSEUDO | MOD_RRBS)},
+ {"br.wtop.dpnt.few.clr", BR (3, 0, 3, 1, MOD_RRBS)},
+ {"br.wtop.dpnt.clr", BR (3, 0, 3, 1, PSEUDO | MOD_RRBS)},
+ {"br.wtop.sptk.many", BR (3, 1, 0, 0, MOD_RRBS)},
+ {"br.wtop.sptk.many.clr", BR (3, 1, 0, 1, MOD_RRBS)},
+ {"br.wtop.spnt.many", BR (3, 1, 1, 0, MOD_RRBS)},
+ {"br.wtop.spnt.many.clr", BR (3, 1, 1, 1, MOD_RRBS)},
+ {"br.wtop.dptk.many", BR (3, 1, 2, 0, MOD_RRBS)},
+ {"br.wtop.dptk.many.clr", BR (3, 1, 2, 1, MOD_RRBS)},
+ {"br.wtop.dpnt.many", BR (3, 1, 3, 0, MOD_RRBS)},
+ {"br.wtop.dpnt.many.clr", BR (3, 1, 3, 1, MOD_RRBS)},
#undef BR
#define BR(a,b,c,d) \
- B0, OpBtypePaWhaD (4, a, b, c, d), {TGT25c}, SLOT2 | NO_PRED
+ B0, OpBtypePaWhaD (4, a, b, c, d), {TGT25c}, SLOT2 | NO_PRED, 0, NULL
+#define BRT(a,b,c,d,e) \
+ B0, OpBtypePaWhaD (4, a, b, c, d), {TGT25c}, SLOT2 | NO_PRED | e, 0, NULL
{"br.cloop.sptk.few", BR (5, 0, 0, 0)},
- {"br.cloop.sptk", BR (5, 0, 0, 0) | PSEUDO},
+ {"br.cloop.sptk", BRT (5, 0, 0, 0, PSEUDO)},
{"br.cloop.sptk.few.clr", BR (5, 0, 0, 1)},
- {"br.cloop.sptk.clr", BR (5, 0, 0, 1) | PSEUDO},
+ {"br.cloop.sptk.clr", BRT (5, 0, 0, 1, PSEUDO)},
{"br.cloop.spnt.few", BR (5, 0, 1, 0)},
- {"br.cloop.spnt", BR (5, 0, 1, 0) | PSEUDO},
+ {"br.cloop.spnt", BRT (5, 0, 1, 0, PSEUDO)},
{"br.cloop.spnt.few.clr", BR (5, 0, 1, 1)},
- {"br.cloop.spnt.clr", BR (5, 0, 1, 1) | PSEUDO},
+ {"br.cloop.spnt.clr", BRT (5, 0, 1, 1, PSEUDO)},
{"br.cloop.dptk.few", BR (5, 0, 2, 0)},
- {"br.cloop.dptk", BR (5, 0, 2, 0) | PSEUDO},
+ {"br.cloop.dptk", BRT (5, 0, 2, 0, PSEUDO)},
{"br.cloop.dptk.few.clr", BR (5, 0, 2, 1)},
- {"br.cloop.dptk.clr", BR (5, 0, 2, 1) | PSEUDO},
+ {"br.cloop.dptk.clr", BRT (5, 0, 2, 1, PSEUDO)},
{"br.cloop.dpnt.few", BR (5, 0, 3, 0)},
- {"br.cloop.dpnt", BR (5, 0, 3, 0) | PSEUDO},
+ {"br.cloop.dpnt", BRT (5, 0, 3, 0, PSEUDO)},
{"br.cloop.dpnt.few.clr", BR (5, 0, 3, 1)},
- {"br.cloop.dpnt.clr", BR (5, 0, 3, 1) | PSEUDO},
+ {"br.cloop.dpnt.clr", BRT (5, 0, 3, 1, PSEUDO)},
{"br.cloop.sptk.many", BR (5, 1, 0, 0)},
{"br.cloop.sptk.many.clr", BR (5, 1, 0, 1)},
{"br.cloop.spnt.many", BR (5, 1, 1, 0)},
@@ -371,87 +384,85 @@ struct ia64_opcode ia64_opcodes_b[] =
{"br.cloop.dptk.many.clr", BR (5, 1, 2, 1)},
{"br.cloop.dpnt.many", BR (5, 1, 3, 0)},
{"br.cloop.dpnt.many.clr", BR (5, 1, 3, 1)},
- {"br.cexit.sptk.few", BR (6, 0, 0, 0) | MOD_RRBS},
- {"br.cexit.sptk", BR (6, 0, 0, 0) | PSEUDO | MOD_RRBS},
- {"br.cexit.sptk.few.clr", BR (6, 0, 0, 1) | MOD_RRBS},
- {"br.cexit.sptk.clr", BR (6, 0, 0, 1) | PSEUDO | MOD_RRBS},
- {"br.cexit.spnt.few", BR (6, 0, 1, 0) | MOD_RRBS},
- {"br.cexit.spnt", BR (6, 0, 1, 0) | PSEUDO | MOD_RRBS},
- {"br.cexit.spnt.few.clr", BR (6, 0, 1, 1) | MOD_RRBS},
- {"br.cexit.spnt.clr", BR (6, 0, 1, 1) | PSEUDO | MOD_RRBS},
- {"br.cexit.dptk.few", BR (6, 0, 2, 0) | MOD_RRBS},
- {"br.cexit.dptk", BR (6, 0, 2, 0) | PSEUDO | MOD_RRBS},
- {"br.cexit.dptk.few.clr", BR (6, 0, 2, 1) | MOD_RRBS},
- {"br.cexit.dptk.clr", BR (6, 0, 2, 1) | PSEUDO | MOD_RRBS},
- {"br.cexit.dpnt.few", BR (6, 0, 3, 0) | MOD_RRBS},
- {"br.cexit.dpnt", BR (6, 0, 3, 0) | PSEUDO | MOD_RRBS},
- {"br.cexit.dpnt.few.clr", BR (6, 0, 3, 1) | MOD_RRBS},
- {"br.cexit.dpnt.clr", BR (6, 0, 3, 1) | PSEUDO | MOD_RRBS},
- {"br.cexit.sptk.many", BR (6, 1, 0, 0) | MOD_RRBS},
- {"br.cexit.sptk.many.clr", BR (6, 1, 0, 1) | MOD_RRBS},
- {"br.cexit.spnt.many", BR (6, 1, 1, 0) | MOD_RRBS},
- {"br.cexit.spnt.many.clr", BR (6, 1, 1, 1) | MOD_RRBS},
- {"br.cexit.dptk.many", BR (6, 1, 2, 0) | MOD_RRBS},
- {"br.cexit.dptk.many.clr", BR (6, 1, 2, 1) | MOD_RRBS},
- {"br.cexit.dpnt.many", BR (6, 1, 3, 0) | MOD_RRBS},
- {"br.cexit.dpnt.many.clr", BR (6, 1, 3, 1) | MOD_RRBS},
- {"br.ctop.sptk.few", BR (7, 0, 0, 0) | MOD_RRBS},
- {"br.ctop.sptk", BR (7, 0, 0, 0) | PSEUDO | MOD_RRBS},
- {"br.ctop.sptk.few.clr", BR (7, 0, 0, 1) | MOD_RRBS},
- {"br.ctop.sptk.clr", BR (7, 0, 0, 1) | PSEUDO | MOD_RRBS},
- {"br.ctop.spnt.few", BR (7, 0, 1, 0) | MOD_RRBS},
- {"br.ctop.spnt", BR (7, 0, 1, 0) | PSEUDO | MOD_RRBS},
- {"br.ctop.spnt.few.clr", BR (7, 0, 1, 1) | MOD_RRBS},
- {"br.ctop.spnt.clr", BR (7, 0, 1, 1) | PSEUDO | MOD_RRBS},
- {"br.ctop.dptk.few", BR (7, 0, 2, 0) | MOD_RRBS},
- {"br.ctop.dptk", BR (7, 0, 2, 0) | PSEUDO | MOD_RRBS},
- {"br.ctop.dptk.few.clr", BR (7, 0, 2, 1) | MOD_RRBS},
- {"br.ctop.dptk.clr", BR (7, 0, 2, 1) | PSEUDO | MOD_RRBS},
- {"br.ctop.dpnt.few", BR (7, 0, 3, 0) | MOD_RRBS},
- {"br.ctop.dpnt", BR (7, 0, 3, 0) | PSEUDO | MOD_RRBS},
- {"br.ctop.dpnt.few.clr", BR (7, 0, 3, 1) | MOD_RRBS},
- {"br.ctop.dpnt.clr", BR (7, 0, 3, 1) | PSEUDO | MOD_RRBS},
- {"br.ctop.sptk.many", BR (7, 1, 0, 0) | MOD_RRBS},
- {"br.ctop.sptk.many.clr", BR (7, 1, 0, 1) | MOD_RRBS},
- {"br.ctop.spnt.many", BR (7, 1, 1, 0) | MOD_RRBS},
- {"br.ctop.spnt.many.clr", BR (7, 1, 1, 1) | MOD_RRBS},
- {"br.ctop.dptk.many", BR (7, 1, 2, 0) | MOD_RRBS},
- {"br.ctop.dptk.many.clr", BR (7, 1, 2, 1) | MOD_RRBS},
- {"br.ctop.dpnt.many", BR (7, 1, 3, 0) | MOD_RRBS},
- {"br.ctop.dpnt.many.clr", BR (7, 1, 3, 1) | MOD_RRBS},
-
-#undef BR
-#define BR(a,b,c,d) \
- B0, OpBtypePaWhaD (4, a, b, c, d), {TGT25c}, SLOT2
- {"br.call.sptk.few", B, OpPaWhaD (5, 0, 0, 0), {B1, TGT25c}},
- {"br.call.sptk", B, OpPaWhaD (5, 0, 0, 0), {B1, TGT25c}, PSEUDO},
- {"br.call.sptk.few.clr", B, OpPaWhaD (5, 0, 0, 1), {B1, TGT25c}},
- {"br.call.sptk.clr", B, OpPaWhaD (5, 0, 0, 1), {B1, TGT25c}, PSEUDO},
- {"br.call.spnt.few", B, OpPaWhaD (5, 0, 1, 0), {B1, TGT25c}},
- {"br.call.spnt", B, OpPaWhaD (5, 0, 1, 0), {B1, TGT25c}, PSEUDO},
- {"br.call.spnt.few.clr", B, OpPaWhaD (5, 0, 1, 1), {B1, TGT25c}},
- {"br.call.spnt.clr", B, OpPaWhaD (5, 0, 1, 1), {B1, TGT25c}, PSEUDO},
- {"br.call.dptk.few", B, OpPaWhaD (5, 0, 2, 0), {B1, TGT25c}},
- {"br.call.dptk", B, OpPaWhaD (5, 0, 2, 0), {B1, TGT25c}, PSEUDO},
- {"br.call.dptk.few.clr", B, OpPaWhaD (5, 0, 2, 1), {B1, TGT25c}},
- {"br.call.dptk.clr", B, OpPaWhaD (5, 0, 2, 1), {B1, TGT25c}, PSEUDO},
- {"br.call.dpnt.few", B, OpPaWhaD (5, 0, 3, 0), {B1, TGT25c}},
- {"br.call.dpnt", B, OpPaWhaD (5, 0, 3, 0), {B1, TGT25c}, PSEUDO},
- {"br.call.dpnt.few.clr", B, OpPaWhaD (5, 0, 3, 1), {B1, TGT25c}},
- {"br.call.dpnt.clr", B, OpPaWhaD (5, 0, 3, 1), {B1, TGT25c}, PSEUDO},
- {"br.call.sptk.many", B, OpPaWhaD (5, 1, 0, 0), {B1, TGT25c}},
- {"br.call.sptk.many.clr", B, OpPaWhaD (5, 1, 0, 1), {B1, TGT25c}},
- {"br.call.spnt.many", B, OpPaWhaD (5, 1, 1, 0), {B1, TGT25c}},
- {"br.call.spnt.many.clr", B, OpPaWhaD (5, 1, 1, 1), {B1, TGT25c}},
- {"br.call.dptk.many", B, OpPaWhaD (5, 1, 2, 0), {B1, TGT25c}},
- {"br.call.dptk.many.clr", B, OpPaWhaD (5, 1, 2, 1), {B1, TGT25c}},
- {"br.call.dpnt.many", B, OpPaWhaD (5, 1, 3, 0), {B1, TGT25c}},
- {"br.call.dpnt.many.clr", B, OpPaWhaD (5, 1, 3, 1), {B1, TGT25c}},
+ {"br.cexit.sptk.few", BRT (6, 0, 0, 0, MOD_RRBS)},
+ {"br.cexit.sptk", BRT (6, 0, 0, 0, PSEUDO | MOD_RRBS)},
+ {"br.cexit.sptk.few.clr", BRT (6, 0, 0, 1, MOD_RRBS)},
+ {"br.cexit.sptk.clr", BRT (6, 0, 0, 1, PSEUDO | MOD_RRBS)},
+ {"br.cexit.spnt.few", BRT (6, 0, 1, 0, MOD_RRBS)},
+ {"br.cexit.spnt", BRT (6, 0, 1, 0, PSEUDO | MOD_RRBS)},
+ {"br.cexit.spnt.few.clr", BRT (6, 0, 1, 1, MOD_RRBS)},
+ {"br.cexit.spnt.clr", BRT (6, 0, 1, 1, PSEUDO | MOD_RRBS)},
+ {"br.cexit.dptk.few", BRT (6, 0, 2, 0, MOD_RRBS)},
+ {"br.cexit.dptk", BRT (6, 0, 2, 0, PSEUDO | MOD_RRBS)},
+ {"br.cexit.dptk.few.clr", BRT (6, 0, 2, 1, MOD_RRBS)},
+ {"br.cexit.dptk.clr", BRT (6, 0, 2, 1, PSEUDO | MOD_RRBS)},
+ {"br.cexit.dpnt.few", BRT (6, 0, 3, 0, MOD_RRBS)},
+ {"br.cexit.dpnt", BRT (6, 0, 3, 0, PSEUDO | MOD_RRBS)},
+ {"br.cexit.dpnt.few.clr", BRT (6, 0, 3, 1, MOD_RRBS)},
+ {"br.cexit.dpnt.clr", BRT (6, 0, 3, 1, PSEUDO | MOD_RRBS)},
+ {"br.cexit.sptk.many", BRT (6, 1, 0, 0, MOD_RRBS)},
+ {"br.cexit.sptk.many.clr", BRT (6, 1, 0, 1, MOD_RRBS)},
+ {"br.cexit.spnt.many", BRT (6, 1, 1, 0, MOD_RRBS)},
+ {"br.cexit.spnt.many.clr", BRT (6, 1, 1, 1, MOD_RRBS)},
+ {"br.cexit.dptk.many", BRT (6, 1, 2, 0, MOD_RRBS)},
+ {"br.cexit.dptk.many.clr", BRT (6, 1, 2, 1, MOD_RRBS)},
+ {"br.cexit.dpnt.many", BRT (6, 1, 3, 0, MOD_RRBS)},
+ {"br.cexit.dpnt.many.clr", BRT (6, 1, 3, 1, MOD_RRBS)},
+ {"br.ctop.sptk.few", BRT (7, 0, 0, 0, MOD_RRBS)},
+ {"br.ctop.sptk", BRT (7, 0, 0, 0, PSEUDO | MOD_RRBS)},
+ {"br.ctop.sptk.few.clr", BRT (7, 0, 0, 1, MOD_RRBS)},
+ {"br.ctop.sptk.clr", BRT (7, 0, 0, 1, PSEUDO | MOD_RRBS)},
+ {"br.ctop.spnt.few", BRT (7, 0, 1, 0, MOD_RRBS)},
+ {"br.ctop.spnt", BRT (7, 0, 1, 0, PSEUDO | MOD_RRBS)},
+ {"br.ctop.spnt.few.clr", BRT (7, 0, 1, 1, MOD_RRBS)},
+ {"br.ctop.spnt.clr", BRT (7, 0, 1, 1, PSEUDO | MOD_RRBS)},
+ {"br.ctop.dptk.few", BRT (7, 0, 2, 0, MOD_RRBS)},
+ {"br.ctop.dptk", BRT (7, 0, 2, 0, PSEUDO | MOD_RRBS)},
+ {"br.ctop.dptk.few.clr", BRT (7, 0, 2, 1, MOD_RRBS)},
+ {"br.ctop.dptk.clr", BRT (7, 0, 2, 1, PSEUDO | MOD_RRBS)},
+ {"br.ctop.dpnt.few", BRT (7, 0, 3, 0, MOD_RRBS)},
+ {"br.ctop.dpnt", BRT (7, 0, 3, 0, PSEUDO | MOD_RRBS)},
+ {"br.ctop.dpnt.few.clr", BRT (7, 0, 3, 1, MOD_RRBS)},
+ {"br.ctop.dpnt.clr", BRT (7, 0, 3, 1, PSEUDO | MOD_RRBS)},
+ {"br.ctop.sptk.many", BRT (7, 1, 0, 0, MOD_RRBS)},
+ {"br.ctop.sptk.many.clr", BRT (7, 1, 0, 1, MOD_RRBS)},
+ {"br.ctop.spnt.many", BRT (7, 1, 1, 0, MOD_RRBS)},
+ {"br.ctop.spnt.many.clr", BRT (7, 1, 1, 1, MOD_RRBS)},
+ {"br.ctop.dptk.many", BRT (7, 1, 2, 0, MOD_RRBS)},
+ {"br.ctop.dptk.many.clr", BRT (7, 1, 2, 1, MOD_RRBS)},
+ {"br.ctop.dpnt.many", BRT (7, 1, 3, 0, MOD_RRBS)},
+ {"br.ctop.dpnt.many.clr", BRT (7, 1, 3, 1, MOD_RRBS)},
#undef BR
+#undef BRT
+
+ {"br.call.sptk.few", B, OpPaWhaD (5, 0, 0, 0), {B1, TGT25c}, EMPTY},
+ {"br.call.sptk", B, OpPaWhaD (5, 0, 0, 0), {B1, TGT25c}, PSEUDO, 0, NULL},
+ {"br.call.sptk.few.clr", B, OpPaWhaD (5, 0, 0, 1), {B1, TGT25c}, EMPTY},
+ {"br.call.sptk.clr", B, OpPaWhaD (5, 0, 0, 1), {B1, TGT25c}, PSEUDO, 0, NULL},
+ {"br.call.spnt.few", B, OpPaWhaD (5, 0, 1, 0), {B1, TGT25c}, EMPTY},
+ {"br.call.spnt", B, OpPaWhaD (5, 0, 1, 0), {B1, TGT25c}, PSEUDO, 0, NULL},
+ {"br.call.spnt.few.clr", B, OpPaWhaD (5, 0, 1, 1), {B1, TGT25c}, EMPTY},
+ {"br.call.spnt.clr", B, OpPaWhaD (5, 0, 1, 1), {B1, TGT25c}, PSEUDO, 0, NULL},
+ {"br.call.dptk.few", B, OpPaWhaD (5, 0, 2, 0), {B1, TGT25c}, EMPTY},
+ {"br.call.dptk", B, OpPaWhaD (5, 0, 2, 0), {B1, TGT25c}, PSEUDO, 0, NULL},
+ {"br.call.dptk.few.clr", B, OpPaWhaD (5, 0, 2, 1), {B1, TGT25c}, EMPTY},
+ {"br.call.dptk.clr", B, OpPaWhaD (5, 0, 2, 1), {B1, TGT25c}, PSEUDO, 0, NULL},
+ {"br.call.dpnt.few", B, OpPaWhaD (5, 0, 3, 0), {B1, TGT25c}, EMPTY},
+ {"br.call.dpnt", B, OpPaWhaD (5, 0, 3, 0), {B1, TGT25c}, PSEUDO, 0, NULL},
+ {"br.call.dpnt.few.clr", B, OpPaWhaD (5, 0, 3, 1), {B1, TGT25c}, EMPTY},
+ {"br.call.dpnt.clr", B, OpPaWhaD (5, 0, 3, 1), {B1, TGT25c}, PSEUDO, 0, NULL},
+ {"br.call.sptk.many", B, OpPaWhaD (5, 1, 0, 0), {B1, TGT25c}, EMPTY},
+ {"br.call.sptk.many.clr", B, OpPaWhaD (5, 1, 0, 1), {B1, TGT25c}, EMPTY},
+ {"br.call.spnt.many", B, OpPaWhaD (5, 1, 1, 0), {B1, TGT25c}, EMPTY},
+ {"br.call.spnt.many.clr", B, OpPaWhaD (5, 1, 1, 1), {B1, TGT25c}, EMPTY},
+ {"br.call.dptk.many", B, OpPaWhaD (5, 1, 2, 0), {B1, TGT25c}, EMPTY},
+ {"br.call.dptk.many.clr", B, OpPaWhaD (5, 1, 2, 1), {B1, TGT25c}, EMPTY},
+ {"br.call.dpnt.many", B, OpPaWhaD (5, 1, 3, 0), {B1, TGT25c}, EMPTY},
+ {"br.call.dpnt.many.clr", B, OpPaWhaD (5, 1, 3, 1), {B1, TGT25c}, EMPTY},
- /* branch predict */
+ /* Branch predict. */
#define BRP(a,b) \
- B0, OpIhWhb (7, a, b), {TGT25c, TAG13}, NO_PRED
+ B0, OpIhWhb (7, a, b), {TGT25c, TAG13}, NO_PRED, 0, NULL
{"brp.sptk", BRP (0, 0)},
{"brp.loop", BRP (0, 1)},
{"brp.dptk", BRP (0, 2)},
@@ -462,7 +473,7 @@ struct ia64_opcode ia64_opcodes_b[] =
{"brp.exit.imp", BRP (1, 3)},
#undef BRP
- {0}
+ {NULL, 0, 0, 0, 0, {0}, 0, 0, NULL}
};
#undef B0
@@ -494,3 +505,4 @@ struct ia64_opcode ia64_opcodes_b[] =
#undef OpX6BtypePaWhaDPr
#undef OpIhWhb
#undef OpX6IhWhb
+#undef EMPTY
diff --git a/opcodes/ia64-opc-d.c b/opcodes/ia64-opc-d.c
index 27390f59f2e..f0761ddccf0 100644
--- a/opcodes/ia64-opc-d.c
+++ b/opcodes/ia64-opc-d.c
@@ -1,14 +1,33 @@
+/* ia64-opc-d.c -- IA-64 `D' opcode table.
+ Copyright 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+ This file is part of GDB, GAS, and the GNU binutils.
+
+ GDB, GAS, and the GNU binutils are free software; you can redistribute
+ them and/or modify them under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either version
+ 2, or (at your option) any later version.
+
+ GDB, GAS, and the GNU binutils are distributed in the hope that they
+ will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+ the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this file; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
struct ia64_opcode ia64_opcodes_d[] =
{
- {"add", IA64_TYPE_DYN, 1, 0, 0,
- {IA64_OPND_R1, IA64_OPND_IMM22, IA64_OPND_R3_2}},
- {"add", IA64_TYPE_DYN, 1, 0, 0,
- {IA64_OPND_R1, IA64_OPND_IMM14, IA64_OPND_R3}},
- {"break", IA64_TYPE_DYN, 0, 0, 0, {IA64_OPND_IMMU21}},
- {"chk.s", IA64_TYPE_DYN, 0, 0, 0, {IA64_OPND_R2, IA64_OPND_TGT25b}},
- {"mov", IA64_TYPE_DYN, 1, 0, 0, {IA64_OPND_R1, IA64_OPND_AR3}},
- {"mov", IA64_TYPE_DYN, 1, 0, 0, {IA64_OPND_AR3, IA64_OPND_IMM8}},
- {"mov", IA64_TYPE_DYN, 1, 0, 0, {IA64_OPND_AR3, IA64_OPND_R2}},
- {"nop", IA64_TYPE_DYN, 0, 0, 0, {IA64_OPND_IMMU21}},
- {0}
+ {"add", IA64_TYPE_DYN, 1, 0, 0, {IA64_OPND_R1, IA64_OPND_IMM22, IA64_OPND_R3_2}, 0, 0, NULL},
+ {"add", IA64_TYPE_DYN, 1, 0, 0, {IA64_OPND_R1, IA64_OPND_IMM14, IA64_OPND_R3}, 0, 0, NULL},
+ {"break", IA64_TYPE_DYN, 0, 0, 0, {IA64_OPND_IMMU21}, 0, 0, NULL},
+ {"chk.s", IA64_TYPE_DYN, 0, 0, 0, {IA64_OPND_R2, IA64_OPND_TGT25b}, 0, 0, NULL},
+ {"mov", IA64_TYPE_DYN, 1, 0, 0, {IA64_OPND_R1, IA64_OPND_AR3}, 0, 0, NULL},
+ {"mov", IA64_TYPE_DYN, 1, 0, 0, {IA64_OPND_AR3, IA64_OPND_IMM8}, 0, 0, NULL},
+ {"mov", IA64_TYPE_DYN, 1, 0, 0, {IA64_OPND_AR3, IA64_OPND_R2}, 0, 0, NULL},
+ {"nop", IA64_TYPE_DYN, 0, 0, 0, {IA64_OPND_IMMU21}, 0, 0, NULL},
+ {NULL, 0, 0, 0, 0, {0}, 0, 0, NULL}
};
diff --git a/opcodes/ia64-opc-f.c b/opcodes/ia64-opc-f.c
index 2f898c64d5c..41d4a006405 100644
--- a/opcodes/ia64-opc-f.c
+++ b/opcodes/ia64-opc-f.c
@@ -1,5 +1,5 @@
/* ia64-opc-f.c -- IA-64 `F' opcode table.
- Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of GDB, GAS, and the GNU binutils.
@@ -74,537 +74,541 @@
#define OpXbX6Sf(a,b,c,d) \
(bOp (a) | bXb (b) | bX6 (c) | bSf (d)), (mOp | mXb | mX6 | mSf)
+/* Used to initialise unused fields in ia64_opcode struct,
+ in order to stop gcc from complaining. */
+#define EMPTY 0,0,NULL
+
struct ia64_opcode ia64_opcodes_f[] =
{
- /* F-type instruction encodings (sorted according to major opcode) */
-
- {"frcpa.s0", f2, OpXbQSf (0, 1, 0, 0), {F1, P2, F2, F3}},
- {"frcpa", f2, OpXbQSf (0, 1, 0, 0), {F1, P2, F2, F3}, PSEUDO},
- {"frcpa.s1", f2, OpXbQSf (0, 1, 0, 1), {F1, P2, F2, F3}},
- {"frcpa.s2", f2, OpXbQSf (0, 1, 0, 2), {F1, P2, F2, F3}},
- {"frcpa.s3", f2, OpXbQSf (0, 1, 0, 3), {F1, P2, F2, F3}},
-
- {"frsqrta.s0", f2, OpXbQSf (0, 1, 1, 0), {F1, P2, F3}},
- {"frsqrta", f2, OpXbQSf (0, 1, 1, 0), {F1, P2, F3}, PSEUDO},
- {"frsqrta.s1", f2, OpXbQSf (0, 1, 1, 1), {F1, P2, F3}},
- {"frsqrta.s2", f2, OpXbQSf (0, 1, 1, 2), {F1, P2, F3}},
- {"frsqrta.s3", f2, OpXbQSf (0, 1, 1, 3), {F1, P2, F3}},
-
- {"fmin.s0", f, OpXbX6Sf (0, 0, 0x14, 0), {F1, F2, F3}},
- {"fmin", f, OpXbX6Sf (0, 0, 0x14, 0), {F1, F2, F3}, PSEUDO},
- {"fmin.s1", f, OpXbX6Sf (0, 0, 0x14, 1), {F1, F2, F3}},
- {"fmin.s2", f, OpXbX6Sf (0, 0, 0x14, 2), {F1, F2, F3}},
- {"fmin.s3", f, OpXbX6Sf (0, 0, 0x14, 3), {F1, F2, F3}},
- {"fmax.s0", f, OpXbX6Sf (0, 0, 0x15, 0), {F1, F2, F3}},
- {"fmax", f, OpXbX6Sf (0, 0, 0x15, 0), {F1, F2, F3}, PSEUDO},
- {"fmax.s1", f, OpXbX6Sf (0, 0, 0x15, 1), {F1, F2, F3}},
- {"fmax.s2", f, OpXbX6Sf (0, 0, 0x15, 2), {F1, F2, F3}},
- {"fmax.s3", f, OpXbX6Sf (0, 0, 0x15, 3), {F1, F2, F3}},
- {"famin.s0", f, OpXbX6Sf (0, 0, 0x16, 0), {F1, F2, F3}},
- {"famin", f, OpXbX6Sf (0, 0, 0x16, 0), {F1, F2, F3}, PSEUDO},
- {"famin.s1", f, OpXbX6Sf (0, 0, 0x16, 1), {F1, F2, F3}},
- {"famin.s2", f, OpXbX6Sf (0, 0, 0x16, 2), {F1, F2, F3}},
- {"famin.s3", f, OpXbX6Sf (0, 0, 0x16, 3), {F1, F2, F3}},
- {"famax.s0", f, OpXbX6Sf (0, 0, 0x17, 0), {F1, F2, F3}},
- {"famax", f, OpXbX6Sf (0, 0, 0x17, 0), {F1, F2, F3}, PSEUDO},
- {"famax.s1", f, OpXbX6Sf (0, 0, 0x17, 1), {F1, F2, F3}},
- {"famax.s2", f, OpXbX6Sf (0, 0, 0x17, 2), {F1, F2, F3}},
- {"famax.s3", f, OpXbX6Sf (0, 0, 0x17, 3), {F1, F2, F3}},
-
- {"mov", f, OpXbX6 (0, 0, 0x10), {F1, F3}, PSEUDO | F2_EQ_F3},
- {"fabs", f, OpXbX6F2 (0, 0, 0x10, 0), {F1, F3}, PSEUDO},
- {"fneg", f, OpXbX6 (0, 0, 0x11), {F1, F3}, PSEUDO | F2_EQ_F3},
- {"fnegabs", f, OpXbX6F2 (0, 0, 0x11, 0), {F1, F3}, PSEUDO},
- {"fmerge.s", f, OpXbX6 (0, 0, 0x10), {F1, F2, F3}},
- {"fmerge.ns", f, OpXbX6 (0, 0, 0x11), {F1, F2, F3}},
-
- {"fmerge.se", f, OpXbX6 (0, 0, 0x12), {F1, F2, F3}},
- {"fmix.lr", f, OpXbX6 (0, 0, 0x39), {F1, F2, F3}},
- {"fmix.r", f, OpXbX6 (0, 0, 0x3a), {F1, F2, F3}},
- {"fmix.l", f, OpXbX6 (0, 0, 0x3b), {F1, F2, F3}},
- {"fsxt.r", f, OpXbX6 (0, 0, 0x3c), {F1, F2, F3}},
- {"fsxt.l", f, OpXbX6 (0, 0, 0x3d), {F1, F2, F3}},
- {"fpack", f, OpXbX6 (0, 0, 0x28), {F1, F2, F3}},
- {"fswap", f, OpXbX6 (0, 0, 0x34), {F1, F2, F3}},
- {"fswap.nl", f, OpXbX6 (0, 0, 0x35), {F1, F2, F3}},
- {"fswap.nr", f, OpXbX6 (0, 0, 0x36), {F1, F2, F3}},
- {"fand", f, OpXbX6 (0, 0, 0x2c), {F1, F2, F3}},
- {"fandcm", f, OpXbX6 (0, 0, 0x2d), {F1, F2, F3}},
- {"for", f, OpXbX6 (0, 0, 0x2e), {F1, F2, F3}},
- {"fxor", f, OpXbX6 (0, 0, 0x2f), {F1, F2, F3}},
-
- {"fcvt.fx.s0", f, OpXbX6Sf (0, 0, 0x18, 0), {F1, F2}},
- {"fcvt.fx", f, OpXbX6Sf (0, 0, 0x18, 0), {F1, F2}, PSEUDO},
- {"fcvt.fx.s1", f, OpXbX6Sf (0, 0, 0x18, 1), {F1, F2}},
- {"fcvt.fx.s2", f, OpXbX6Sf (0, 0, 0x18, 2), {F1, F2}},
- {"fcvt.fx.s3", f, OpXbX6Sf (0, 0, 0x18, 3), {F1, F2}},
- {"fcvt.fxu.s0", f, OpXbX6Sf (0, 0, 0x19, 0), {F1, F2}},
- {"fcvt.fxu", f, OpXbX6Sf (0, 0, 0x19, 0), {F1, F2}, PSEUDO},
- {"fcvt.fxu.s1", f, OpXbX6Sf (0, 0, 0x19, 1), {F1, F2}},
- {"fcvt.fxu.s2", f, OpXbX6Sf (0, 0, 0x19, 2), {F1, F2}},
- {"fcvt.fxu.s3", f, OpXbX6Sf (0, 0, 0x19, 3), {F1, F2}},
- {"fcvt.fx.trunc.s0", f, OpXbX6Sf (0, 0, 0x1a, 0), {F1, F2}},
- {"fcvt.fx.trunc", f, OpXbX6Sf (0, 0, 0x1a, 0), {F1, F2}, PSEUDO},
- {"fcvt.fx.trunc.s1", f, OpXbX6Sf (0, 0, 0x1a, 1), {F1, F2}},
- {"fcvt.fx.trunc.s2", f, OpXbX6Sf (0, 0, 0x1a, 2), {F1, F2}},
- {"fcvt.fx.trunc.s3", f, OpXbX6Sf (0, 0, 0x1a, 3), {F1, F2}},
- {"fcvt.fxu.trunc.s0", f, OpXbX6Sf (0, 0, 0x1b, 0), {F1, F2}},
- {"fcvt.fxu.trunc", f, OpXbX6Sf (0, 0, 0x1b, 0), {F1, F2}, PSEUDO},
- {"fcvt.fxu.trunc.s1", f, OpXbX6Sf (0, 0, 0x1b, 1), {F1, F2}},
- {"fcvt.fxu.trunc.s2", f, OpXbX6Sf (0, 0, 0x1b, 2), {F1, F2}},
- {"fcvt.fxu.trunc.s3", f, OpXbX6Sf (0, 0, 0x1b, 3), {F1, F2}},
-
- {"fcvt.xf", f, OpXbX6 (0, 0, 0x1c), {F1, F2}},
-
- {"fsetc.s0", f0, OpXbX6Sf (0, 0, 0x04, 0), {IMMU7a, IMMU7b}},
- {"fsetc", f0, OpXbX6Sf (0, 0, 0x04, 0), {IMMU7a, IMMU7b}, PSEUDO},
- {"fsetc.s1", f0, OpXbX6Sf (0, 0, 0x04, 1), {IMMU7a, IMMU7b}},
- {"fsetc.s2", f0, OpXbX6Sf (0, 0, 0x04, 2), {IMMU7a, IMMU7b}},
- {"fsetc.s3", f0, OpXbX6Sf (0, 0, 0x04, 3), {IMMU7a, IMMU7b}},
- {"fclrf.s0", f0, OpXbX6Sf (0, 0, 0x05, 0)},
- {"fclrf", f0, OpXbX6Sf (0, 0, 0x05, 0), {0}, PSEUDO},
- {"fclrf.s1", f0, OpXbX6Sf (0, 0, 0x05, 1)},
- {"fclrf.s2", f0, OpXbX6Sf (0, 0, 0x05, 2)},
- {"fclrf.s3", f0, OpXbX6Sf (0, 0, 0x05, 3)},
- {"fchkf.s0", f0, OpXbX6Sf (0, 0, 0x08, 0), {TGT25}},
- {"fchkf", f0, OpXbX6Sf (0, 0, 0x08, 0), {TGT25}, PSEUDO},
- {"fchkf.s1", f0, OpXbX6Sf (0, 0, 0x08, 1), {TGT25}},
- {"fchkf.s2", f0, OpXbX6Sf (0, 0, 0x08, 2), {TGT25}},
- {"fchkf.s3", f0, OpXbX6Sf (0, 0, 0x08, 3), {TGT25}},
-
- {"break.f", f0, OpXbX6 (0, 0, 0x00), {IMMU21}},
- {"nop.f", f0, OpXbX6 (0, 0, 0x01), {IMMU21}},
-
- {"fprcpa.s0", f2, OpXbQSf (1, 1, 0, 0), {F1, P2, F2, F3}},
- {"fprcpa", f2, OpXbQSf (1, 1, 0, 0), {F1, P2, F2, F3}, PSEUDO},
- {"fprcpa.s1", f2, OpXbQSf (1, 1, 0, 1), {F1, P2, F2, F3}},
- {"fprcpa.s2", f2, OpXbQSf (1, 1, 0, 2), {F1, P2, F2, F3}},
- {"fprcpa.s3", f2, OpXbQSf (1, 1, 0, 3), {F1, P2, F2, F3}},
-
- {"fprsqrta.s0", f2, OpXbQSf (1, 1, 1, 0), {F1, P2, F3}},
- {"fprsqrta", f2, OpXbQSf (1, 1, 1, 0), {F1, P2, F3}, PSEUDO},
- {"fprsqrta.s1", f2, OpXbQSf (1, 1, 1, 1), {F1, P2, F3}},
- {"fprsqrta.s2", f2, OpXbQSf (1, 1, 1, 2), {F1, P2, F3}},
- {"fprsqrta.s3", f2, OpXbQSf (1, 1, 1, 3), {F1, P2, F3}},
-
- {"fpmin.s0", f, OpXbX6Sf (1, 0, 0x14, 0), {F1, F2, F3}},
- {"fpmin", f, OpXbX6Sf (1, 0, 0x14, 0), {F1, F2, F3}, PSEUDO},
- {"fpmin.s1", f, OpXbX6Sf (1, 0, 0x14, 1), {F1, F2, F3}},
- {"fpmin.s2", f, OpXbX6Sf (1, 0, 0x14, 2), {F1, F2, F3}},
- {"fpmin.s3", f, OpXbX6Sf (1, 0, 0x14, 3), {F1, F2, F3}},
- {"fpmax.s0", f, OpXbX6Sf (1, 0, 0x15, 0), {F1, F2, F3}},
- {"fpmax", f, OpXbX6Sf (1, 0, 0x15, 0), {F1, F2, F3}, PSEUDO},
- {"fpmax.s1", f, OpXbX6Sf (1, 0, 0x15, 1), {F1, F2, F3}},
- {"fpmax.s2", f, OpXbX6Sf (1, 0, 0x15, 2), {F1, F2, F3}},
- {"fpmax.s3", f, OpXbX6Sf (1, 0, 0x15, 3), {F1, F2, F3}},
- {"fpamin.s0", f, OpXbX6Sf (1, 0, 0x16, 0), {F1, F2, F3}},
- {"fpamin", f, OpXbX6Sf (1, 0, 0x16, 0), {F1, F2, F3}, PSEUDO},
- {"fpamin.s1", f, OpXbX6Sf (1, 0, 0x16, 1), {F1, F2, F3}},
- {"fpamin.s2", f, OpXbX6Sf (1, 0, 0x16, 2), {F1, F2, F3}},
- {"fpamin.s3", f, OpXbX6Sf (1, 0, 0x16, 3), {F1, F2, F3}},
- {"fpamax.s0", f, OpXbX6Sf (1, 0, 0x17, 0), {F1, F2, F3}},
- {"fpamax", f, OpXbX6Sf (1, 0, 0x17, 0), {F1, F2, F3}, PSEUDO},
- {"fpamax.s1", f, OpXbX6Sf (1, 0, 0x17, 1), {F1, F2, F3}},
- {"fpamax.s2", f, OpXbX6Sf (1, 0, 0x17, 2), {F1, F2, F3}},
- {"fpamax.s3", f, OpXbX6Sf (1, 0, 0x17, 3), {F1, F2, F3}},
-
- {"fpcmp.eq.s0", f, OpXbX6Sf (1, 0, 0x30, 0), {F1, F2, F3}},
- {"fpcmp.eq", f, OpXbX6Sf (1, 0, 0x30, 0), {F1, F2, F3}, PSEUDO},
- {"fpcmp.eq.s1", f, OpXbX6Sf (1, 0, 0x30, 1), {F1, F2, F3}},
- {"fpcmp.eq.s2", f, OpXbX6Sf (1, 0, 0x30, 2), {F1, F2, F3}},
- {"fpcmp.eq.s3", f, OpXbX6Sf (1, 0, 0x30, 3), {F1, F2, F3}},
- {"fpcmp.lt.s0", f, OpXbX6Sf (1, 0, 0x31, 0), {F1, F2, F3}},
- {"fpcmp.lt", f, OpXbX6Sf (1, 0, 0x31, 0), {F1, F2, F3}, PSEUDO},
- {"fpcmp.lt.s1", f, OpXbX6Sf (1, 0, 0x31, 1), {F1, F2, F3}},
- {"fpcmp.lt.s2", f, OpXbX6Sf (1, 0, 0x31, 2), {F1, F2, F3}},
- {"fpcmp.lt.s3", f, OpXbX6Sf (1, 0, 0x31, 3), {F1, F2, F3}},
- {"fpcmp.le.s0", f, OpXbX6Sf (1, 0, 0x32, 0), {F1, F2, F3}},
- {"fpcmp.le", f, OpXbX6Sf (1, 0, 0x32, 0), {F1, F2, F3}, PSEUDO},
- {"fpcmp.le.s1", f, OpXbX6Sf (1, 0, 0x32, 1), {F1, F2, F3}},
- {"fpcmp.le.s2", f, OpXbX6Sf (1, 0, 0x32, 2), {F1, F2, F3}},
- {"fpcmp.le.s3", f, OpXbX6Sf (1, 0, 0x32, 3), {F1, F2, F3}},
- {"fpcmp.gt.s0", f, OpXbX6Sf (1, 0, 0x31, 0), {F1, F3, F2}, PSEUDO},
- {"fpcmp.gt", f, OpXbX6Sf (1, 0, 0x31, 0), {F1, F3, F2}, PSEUDO},
- {"fpcmp.gt.s1", f, OpXbX6Sf (1, 0, 0x31, 1), {F1, F3, F2}, PSEUDO},
- {"fpcmp.gt.s2", f, OpXbX6Sf (1, 0, 0x31, 2), {F1, F3, F2}, PSEUDO},
- {"fpcmp.gt.s3", f, OpXbX6Sf (1, 0, 0x31, 3), {F1, F3, F2}, PSEUDO},
- {"fpcmp.ge.s0", f, OpXbX6Sf (1, 0, 0x32, 0), {F1, F3, F2}, PSEUDO},
- {"fpcmp.ge", f, OpXbX6Sf (1, 0, 0x32, 0), {F1, F3, F2}, PSEUDO},
- {"fpcmp.ge.s1", f, OpXbX6Sf (1, 0, 0x32, 1), {F1, F3, F2}, PSEUDO},
- {"fpcmp.ge.s2", f, OpXbX6Sf (1, 0, 0x32, 2), {F1, F3, F2}, PSEUDO},
- {"fpcmp.ge.s3", f, OpXbX6Sf (1, 0, 0x32, 3), {F1, F3, F2}, PSEUDO},
- {"fpcmp.unord.s0", f, OpXbX6Sf (1, 0, 0x33, 0), {F1, F2, F3}},
- {"fpcmp.unord", f, OpXbX6Sf (1, 0, 0x33, 0), {F1, F2, F3}, PSEUDO},
- {"fpcmp.unord.s1", f, OpXbX6Sf (1, 0, 0x33, 1), {F1, F2, F3}},
- {"fpcmp.unord.s2", f, OpXbX6Sf (1, 0, 0x33, 2), {F1, F2, F3}},
- {"fpcmp.unord.s3", f, OpXbX6Sf (1, 0, 0x33, 3), {F1, F2, F3}},
- {"fpcmp.neq.s0", f, OpXbX6Sf (1, 0, 0x34, 0), {F1, F2, F3}},
- {"fpcmp.neq", f, OpXbX6Sf (1, 0, 0x34, 0), {F1, F2, F3}, PSEUDO},
- {"fpcmp.neq.s1", f, OpXbX6Sf (1, 0, 0x34, 1), {F1, F2, F3}},
- {"fpcmp.neq.s2", f, OpXbX6Sf (1, 0, 0x34, 2), {F1, F2, F3}},
- {"fpcmp.neq.s3", f, OpXbX6Sf (1, 0, 0x34, 3), {F1, F2, F3}},
- {"fpcmp.nlt.s0", f, OpXbX6Sf (1, 0, 0x35, 0), {F1, F2, F3}},
- {"fpcmp.nlt", f, OpXbX6Sf (1, 0, 0x35, 0), {F1, F2, F3}, PSEUDO},
- {"fpcmp.nlt.s1", f, OpXbX6Sf (1, 0, 0x35, 1), {F1, F2, F3}},
- {"fpcmp.nlt.s2", f, OpXbX6Sf (1, 0, 0x35, 2), {F1, F2, F3}},
- {"fpcmp.nlt.s3", f, OpXbX6Sf (1, 0, 0x35, 3), {F1, F2, F3}},
- {"fpcmp.nle.s0", f, OpXbX6Sf (1, 0, 0x36, 0), {F1, F2, F3}},
- {"fpcmp.nle", f, OpXbX6Sf (1, 0, 0x36, 0), {F1, F2, F3}, PSEUDO},
- {"fpcmp.nle.s1", f, OpXbX6Sf (1, 0, 0x36, 1), {F1, F2, F3}},
- {"fpcmp.nle.s2", f, OpXbX6Sf (1, 0, 0x36, 2), {F1, F2, F3}},
- {"fpcmp.nle.s3", f, OpXbX6Sf (1, 0, 0x36, 3), {F1, F2, F3}},
- {"fpcmp.ngt.s0", f, OpXbX6Sf (1, 0, 0x35, 0), {F1, F3, F2}, PSEUDO},
- {"fpcmp.ngt", f, OpXbX6Sf (1, 0, 0x35, 0), {F1, F3, F2}, PSEUDO},
- {"fpcmp.ngt.s1", f, OpXbX6Sf (1, 0, 0x35, 1), {F1, F3, F2}, PSEUDO},
- {"fpcmp.ngt.s2", f, OpXbX6Sf (1, 0, 0x35, 2), {F1, F3, F2}, PSEUDO},
- {"fpcmp.ngt.s3", f, OpXbX6Sf (1, 0, 0x35, 3), {F1, F3, F2}, PSEUDO},
- {"fpcmp.nge.s0", f, OpXbX6Sf (1, 0, 0x36, 0), {F1, F3, F2}, PSEUDO},
- {"fpcmp.nge", f, OpXbX6Sf (1, 0, 0x36, 0), {F1, F3, F2}, PSEUDO},
- {"fpcmp.nge.s1", f, OpXbX6Sf (1, 0, 0x36, 1), {F1, F3, F2}, PSEUDO},
- {"fpcmp.nge.s2", f, OpXbX6Sf (1, 0, 0x36, 2), {F1, F3, F2}, PSEUDO},
- {"fpcmp.nge.s3", f, OpXbX6Sf (1, 0, 0x36, 3), {F1, F3, F2}, PSEUDO},
- {"fpcmp.ord.s0", f, OpXbX6Sf (1, 0, 0x37, 0), {F1, F2, F3}},
- {"fpcmp.ord", f, OpXbX6Sf (1, 0, 0x37, 0), {F1, F2, F3}, PSEUDO},
- {"fpcmp.ord.s1", f, OpXbX6Sf (1, 0, 0x37, 1), {F1, F2, F3}},
- {"fpcmp.ord.s2", f, OpXbX6Sf (1, 0, 0x37, 2), {F1, F2, F3}},
- {"fpcmp.ord.s3", f, OpXbX6Sf (1, 0, 0x37, 3), {F1, F2, F3}},
-
- {"fpabs", f, OpXbX6F2 (1, 0, 0x10, 0), {F1, F3}, PSEUDO},
- {"fpneg", f, OpXbX6 (1, 0, 0x11), {F1, F3}, PSEUDO | F2_EQ_F3},
- {"fpnegabs", f, OpXbX6F2 (1, 0, 0x11, 0), {F1, F3}, PSEUDO},
- {"fpmerge.s", f, OpXbX6 (1, 0, 0x10), {F1, F2, F3}},
- {"fpmerge.ns", f, OpXbX6 (1, 0, 0x11), {F1, F2, F3}},
- {"fpmerge.se", f, OpXbX6 (1, 0, 0x12), {F1, F2, F3}},
-
- {"fpcvt.fx.s0", f, OpXbX6Sf (1, 0, 0x18, 0), {F1, F2}},
- {"fpcvt.fx", f, OpXbX6Sf (1, 0, 0x18, 0), {F1, F2}, PSEUDO},
- {"fpcvt.fx.s1", f, OpXbX6Sf (1, 0, 0x18, 1), {F1, F2}},
- {"fpcvt.fx.s2", f, OpXbX6Sf (1, 0, 0x18, 2), {F1, F2}},
- {"fpcvt.fx.s3", f, OpXbX6Sf (1, 0, 0x18, 3), {F1, F2}},
- {"fpcvt.fxu.s0", f, OpXbX6Sf (1, 0, 0x19, 0), {F1, F2}},
- {"fpcvt.fxu", f, OpXbX6Sf (1, 0, 0x19, 0), {F1, F2}, PSEUDO},
- {"fpcvt.fxu.s1", f, OpXbX6Sf (1, 0, 0x19, 1), {F1, F2}},
- {"fpcvt.fxu.s2", f, OpXbX6Sf (1, 0, 0x19, 2), {F1, F2}},
- {"fpcvt.fxu.s3", f, OpXbX6Sf (1, 0, 0x19, 3), {F1, F2}},
- {"fpcvt.fx.trunc.s0", f, OpXbX6Sf (1, 0, 0x1a, 0), {F1, F2}},
- {"fpcvt.fx.trunc", f, OpXbX6Sf (1, 0, 0x1a, 0), {F1, F2}, PSEUDO},
- {"fpcvt.fx.trunc.s1", f, OpXbX6Sf (1, 0, 0x1a, 1), {F1, F2}},
- {"fpcvt.fx.trunc.s2", f, OpXbX6Sf (1, 0, 0x1a, 2), {F1, F2}},
- {"fpcvt.fx.trunc.s3", f, OpXbX6Sf (1, 0, 0x1a, 3), {F1, F2}},
- {"fpcvt.fxu.trunc.s0", f, OpXbX6Sf (1, 0, 0x1b, 0), {F1, F2}},
- {"fpcvt.fxu.trunc", f, OpXbX6Sf (1, 0, 0x1b, 0), {F1, F2}, PSEUDO},
- {"fpcvt.fxu.trunc.s1", f, OpXbX6Sf (1, 0, 0x1b, 1), {F1, F2}},
- {"fpcvt.fxu.trunc.s2", f, OpXbX6Sf (1, 0, 0x1b, 2), {F1, F2}},
- {"fpcvt.fxu.trunc.s3", f, OpXbX6Sf (1, 0, 0x1b, 3), {F1, F2}},
-
- {"fcmp.eq.s0", f2, OpRaRbTaSf (4, 0, 0, 0, 0), {P1, P2, F2, F3}},
- {"fcmp.eq", f2, OpRaRbTaSf (4, 0, 0, 0, 0), {P1, P2, F2, F3}, PSEUDO},
- {"fcmp.eq.s1", f2, OpRaRbTaSf (4, 0, 0, 0, 1), {P1, P2, F2, F3}},
- {"fcmp.eq.s2", f2, OpRaRbTaSf (4, 0, 0, 0, 2), {P1, P2, F2, F3}},
- {"fcmp.eq.s3", f2, OpRaRbTaSf (4, 0, 0, 0, 3), {P1, P2, F2, F3}},
- {"fcmp.lt.s0", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P1, P2, F2, F3}},
- {"fcmp.lt", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P1, P2, F2, F3}, PSEUDO},
- {"fcmp.lt.s1", f2, OpRaRbTaSf (4, 0, 1, 0, 1), {P1, P2, F2, F3}},
- {"fcmp.lt.s2", f2, OpRaRbTaSf (4, 0, 1, 0, 2), {P1, P2, F2, F3}},
- {"fcmp.lt.s3", f2, OpRaRbTaSf (4, 0, 1, 0, 3), {P1, P2, F2, F3}},
- {"fcmp.le.s0", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P1, P2, F2, F3}},
- {"fcmp.le", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P1, P2, F2, F3}, PSEUDO},
- {"fcmp.le.s1", f2, OpRaRbTaSf (4, 1, 0, 0, 1), {P1, P2, F2, F3}},
- {"fcmp.le.s2", f2, OpRaRbTaSf (4, 1, 0, 0, 2), {P1, P2, F2, F3}},
- {"fcmp.le.s3", f2, OpRaRbTaSf (4, 1, 0, 0, 3), {P1, P2, F2, F3}},
- {"fcmp.unord.s0", f2, OpRaRbTaSf (4, 1, 1, 0, 0), {P1, P2, F2, F3}},
- {"fcmp.unord", f2, OpRaRbTaSf (4, 1, 1, 0, 0), {P1, P2, F2, F3}, PSEUDO},
- {"fcmp.unord.s1", f2, OpRaRbTaSf (4, 1, 1, 0, 1), {P1, P2, F2, F3}},
- {"fcmp.unord.s2", f2, OpRaRbTaSf (4, 1, 1, 0, 2), {P1, P2, F2, F3}},
- {"fcmp.unord.s3", f2, OpRaRbTaSf (4, 1, 1, 0, 3), {P1, P2, F2, F3}},
- {"fcmp.eq.unc.s0", f2, OpRaRbTaSf (4, 0, 0, 1, 0), {P1, P2, F2, F3}},
- {"fcmp.eq.unc", f2, OpRaRbTaSf (4, 0, 0, 1, 0), {P1, P2, F2, F3}, PSEUDO},
- {"fcmp.eq.unc.s1", f2, OpRaRbTaSf (4, 0, 0, 1, 1), {P1, P2, F2, F3}},
- {"fcmp.eq.unc.s2", f2, OpRaRbTaSf (4, 0, 0, 1, 2), {P1, P2, F2, F3}},
- {"fcmp.eq.unc.s3", f2, OpRaRbTaSf (4, 0, 0, 1, 3), {P1, P2, F2, F3}},
- {"fcmp.lt.unc.s0", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P1, P2, F2, F3}},
- {"fcmp.lt.unc", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P1, P2, F2, F3}, PSEUDO},
- {"fcmp.lt.unc.s1", f2, OpRaRbTaSf (4, 0, 1, 1, 1), {P1, P2, F2, F3}},
- {"fcmp.lt.unc.s2", f2, OpRaRbTaSf (4, 0, 1, 1, 2), {P1, P2, F2, F3}},
- {"fcmp.lt.unc.s3", f2, OpRaRbTaSf (4, 0, 1, 1, 3), {P1, P2, F2, F3}},
- {"fcmp.le.unc.s0", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P1, P2, F2, F3}},
- {"fcmp.le.unc", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P1, P2, F2, F3}, PSEUDO},
- {"fcmp.le.unc.s1", f2, OpRaRbTaSf (4, 1, 0, 1, 1), {P1, P2, F2, F3}},
- {"fcmp.le.unc.s2", f2, OpRaRbTaSf (4, 1, 0, 1, 2), {P1, P2, F2, F3}},
- {"fcmp.le.unc.s3", f2, OpRaRbTaSf (4, 1, 0, 1, 3), {P1, P2, F2, F3}},
- {"fcmp.unord.unc.s0", f2, OpRaRbTaSf (4, 1, 1, 1, 0), {P1, P2, F2, F3}},
- {"fcmp.unord.unc", f2, OpRaRbTaSf (4, 1, 1, 1, 0), {P1, P2, F2, F3}, PSEUDO},
- {"fcmp.unord.unc.s1", f2, OpRaRbTaSf (4, 1, 1, 1, 1), {P1, P2, F2, F3}},
- {"fcmp.unord.unc.s2", f2, OpRaRbTaSf (4, 1, 1, 1, 2), {P1, P2, F2, F3}},
- {"fcmp.unord.unc.s3", f2, OpRaRbTaSf (4, 1, 1, 1, 3), {P1, P2, F2, F3}},
+ /* F-type instruction encodings (sorted according to major opcode). */
+
+ {"frcpa.s0", f2, OpXbQSf (0, 1, 0, 0), {F1, P2, F2, F3}, EMPTY},
+ {"frcpa", f2, OpXbQSf (0, 1, 0, 0), {F1, P2, F2, F3}, PSEUDO, 0, NULL},
+ {"frcpa.s1", f2, OpXbQSf (0, 1, 0, 1), {F1, P2, F2, F3}, EMPTY},
+ {"frcpa.s2", f2, OpXbQSf (0, 1, 0, 2), {F1, P2, F2, F3}, EMPTY},
+ {"frcpa.s3", f2, OpXbQSf (0, 1, 0, 3), {F1, P2, F2, F3}, EMPTY},
+
+ {"frsqrta.s0", f2, OpXbQSf (0, 1, 1, 0), {F1, P2, F3}, EMPTY},
+ {"frsqrta", f2, OpXbQSf (0, 1, 1, 0), {F1, P2, F3}, PSEUDO, 0, NULL},
+ {"frsqrta.s1", f2, OpXbQSf (0, 1, 1, 1), {F1, P2, F3}, EMPTY},
+ {"frsqrta.s2", f2, OpXbQSf (0, 1, 1, 2), {F1, P2, F3}, EMPTY},
+ {"frsqrta.s3", f2, OpXbQSf (0, 1, 1, 3), {F1, P2, F3}, EMPTY},
+
+ {"fmin.s0", f, OpXbX6Sf (0, 0, 0x14, 0), {F1, F2, F3}, EMPTY},
+ {"fmin", f, OpXbX6Sf (0, 0, 0x14, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fmin.s1", f, OpXbX6Sf (0, 0, 0x14, 1), {F1, F2, F3}, EMPTY},
+ {"fmin.s2", f, OpXbX6Sf (0, 0, 0x14, 2), {F1, F2, F3}, EMPTY},
+ {"fmin.s3", f, OpXbX6Sf (0, 0, 0x14, 3), {F1, F2, F3}, EMPTY},
+ {"fmax.s0", f, OpXbX6Sf (0, 0, 0x15, 0), {F1, F2, F3}, EMPTY},
+ {"fmax", f, OpXbX6Sf (0, 0, 0x15, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fmax.s1", f, OpXbX6Sf (0, 0, 0x15, 1), {F1, F2, F3}, EMPTY},
+ {"fmax.s2", f, OpXbX6Sf (0, 0, 0x15, 2), {F1, F2, F3}, EMPTY},
+ {"fmax.s3", f, OpXbX6Sf (0, 0, 0x15, 3), {F1, F2, F3}, EMPTY},
+ {"famin.s0", f, OpXbX6Sf (0, 0, 0x16, 0), {F1, F2, F3}, EMPTY},
+ {"famin", f, OpXbX6Sf (0, 0, 0x16, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"famin.s1", f, OpXbX6Sf (0, 0, 0x16, 1), {F1, F2, F3}, EMPTY},
+ {"famin.s2", f, OpXbX6Sf (0, 0, 0x16, 2), {F1, F2, F3}, EMPTY},
+ {"famin.s3", f, OpXbX6Sf (0, 0, 0x16, 3), {F1, F2, F3}, EMPTY},
+ {"famax.s0", f, OpXbX6Sf (0, 0, 0x17, 0), {F1, F2, F3}, EMPTY},
+ {"famax", f, OpXbX6Sf (0, 0, 0x17, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"famax.s1", f, OpXbX6Sf (0, 0, 0x17, 1), {F1, F2, F3}, EMPTY},
+ {"famax.s2", f, OpXbX6Sf (0, 0, 0x17, 2), {F1, F2, F3}, EMPTY},
+ {"famax.s3", f, OpXbX6Sf (0, 0, 0x17, 3), {F1, F2, F3}, EMPTY},
+
+ {"mov", f, OpXbX6 (0, 0, 0x10), {F1, F3}, PSEUDO | F2_EQ_F3, 0, NULL},
+ {"fabs", f, OpXbX6F2 (0, 0, 0x10, 0), {F1, F3}, PSEUDO, 0, NULL},
+ {"fneg", f, OpXbX6 (0, 0, 0x11), {F1, F3}, PSEUDO | F2_EQ_F3, 0, NULL},
+ {"fnegabs", f, OpXbX6F2 (0, 0, 0x11, 0), {F1, F3}, PSEUDO, 0, NULL},
+ {"fmerge.s", f, OpXbX6 (0, 0, 0x10), {F1, F2, F3}, EMPTY},
+ {"fmerge.ns", f, OpXbX6 (0, 0, 0x11), {F1, F2, F3}, EMPTY},
+
+ {"fmerge.se", f, OpXbX6 (0, 0, 0x12), {F1, F2, F3}, EMPTY},
+ {"fmix.lr", f, OpXbX6 (0, 0, 0x39), {F1, F2, F3}, EMPTY},
+ {"fmix.r", f, OpXbX6 (0, 0, 0x3a), {F1, F2, F3}, EMPTY},
+ {"fmix.l", f, OpXbX6 (0, 0, 0x3b), {F1, F2, F3}, EMPTY},
+ {"fsxt.r", f, OpXbX6 (0, 0, 0x3c), {F1, F2, F3}, EMPTY},
+ {"fsxt.l", f, OpXbX6 (0, 0, 0x3d), {F1, F2, F3}, EMPTY},
+ {"fpack", f, OpXbX6 (0, 0, 0x28), {F1, F2, F3}, EMPTY},
+ {"fswap", f, OpXbX6 (0, 0, 0x34), {F1, F2, F3}, EMPTY},
+ {"fswap.nl", f, OpXbX6 (0, 0, 0x35), {F1, F2, F3}, EMPTY},
+ {"fswap.nr", f, OpXbX6 (0, 0, 0x36), {F1, F2, F3}, EMPTY},
+ {"fand", f, OpXbX6 (0, 0, 0x2c), {F1, F2, F3}, EMPTY},
+ {"fandcm", f, OpXbX6 (0, 0, 0x2d), {F1, F2, F3}, EMPTY},
+ {"for", f, OpXbX6 (0, 0, 0x2e), {F1, F2, F3}, EMPTY},
+ {"fxor", f, OpXbX6 (0, 0, 0x2f), {F1, F2, F3}, EMPTY},
+
+ {"fcvt.fx.s0", f, OpXbX6Sf (0, 0, 0x18, 0), {F1, F2}, EMPTY},
+ {"fcvt.fx", f, OpXbX6Sf (0, 0, 0x18, 0), {F1, F2}, PSEUDO, 0, NULL},
+ {"fcvt.fx.s1", f, OpXbX6Sf (0, 0, 0x18, 1), {F1, F2}, EMPTY},
+ {"fcvt.fx.s2", f, OpXbX6Sf (0, 0, 0x18, 2), {F1, F2}, EMPTY},
+ {"fcvt.fx.s3", f, OpXbX6Sf (0, 0, 0x18, 3), {F1, F2}, EMPTY},
+ {"fcvt.fxu.s0", f, OpXbX6Sf (0, 0, 0x19, 0), {F1, F2}, EMPTY},
+ {"fcvt.fxu", f, OpXbX6Sf (0, 0, 0x19, 0), {F1, F2}, PSEUDO, 0, NULL},
+ {"fcvt.fxu.s1", f, OpXbX6Sf (0, 0, 0x19, 1), {F1, F2}, EMPTY},
+ {"fcvt.fxu.s2", f, OpXbX6Sf (0, 0, 0x19, 2), {F1, F2}, EMPTY},
+ {"fcvt.fxu.s3", f, OpXbX6Sf (0, 0, 0x19, 3), {F1, F2}, EMPTY},
+ {"fcvt.fx.trunc.s0", f, OpXbX6Sf (0, 0, 0x1a, 0), {F1, F2}, EMPTY},
+ {"fcvt.fx.trunc", f, OpXbX6Sf (0, 0, 0x1a, 0), {F1, F2}, PSEUDO, 0, NULL},
+ {"fcvt.fx.trunc.s1", f, OpXbX6Sf (0, 0, 0x1a, 1), {F1, F2}, EMPTY},
+ {"fcvt.fx.trunc.s2", f, OpXbX6Sf (0, 0, 0x1a, 2), {F1, F2}, EMPTY},
+ {"fcvt.fx.trunc.s3", f, OpXbX6Sf (0, 0, 0x1a, 3), {F1, F2}, EMPTY},
+ {"fcvt.fxu.trunc.s0", f, OpXbX6Sf (0, 0, 0x1b, 0), {F1, F2}, EMPTY},
+ {"fcvt.fxu.trunc", f, OpXbX6Sf (0, 0, 0x1b, 0), {F1, F2}, PSEUDO, 0, NULL},
+ {"fcvt.fxu.trunc.s1", f, OpXbX6Sf (0, 0, 0x1b, 1), {F1, F2}, EMPTY},
+ {"fcvt.fxu.trunc.s2", f, OpXbX6Sf (0, 0, 0x1b, 2), {F1, F2}, EMPTY},
+ {"fcvt.fxu.trunc.s3", f, OpXbX6Sf (0, 0, 0x1b, 3), {F1, F2}, EMPTY},
+
+ {"fcvt.xf", f, OpXbX6 (0, 0, 0x1c), {F1, F2}, EMPTY},
+
+ {"fsetc.s0", f0, OpXbX6Sf (0, 0, 0x04, 0), {IMMU7a, IMMU7b}, EMPTY},
+ {"fsetc", f0, OpXbX6Sf (0, 0, 0x04, 0), {IMMU7a, IMMU7b}, PSEUDO, 0, NULL},
+ {"fsetc.s1", f0, OpXbX6Sf (0, 0, 0x04, 1), {IMMU7a, IMMU7b}, EMPTY},
+ {"fsetc.s2", f0, OpXbX6Sf (0, 0, 0x04, 2), {IMMU7a, IMMU7b}, EMPTY},
+ {"fsetc.s3", f0, OpXbX6Sf (0, 0, 0x04, 3), {IMMU7a, IMMU7b}, EMPTY},
+ {"fclrf.s0", f0, OpXbX6Sf (0, 0, 0x05, 0), {}, EMPTY},
+ {"fclrf", f0, OpXbX6Sf (0, 0, 0x05, 0), {0}, PSEUDO, 0, NULL},
+ {"fclrf.s1", f0, OpXbX6Sf (0, 0, 0x05, 1), {}, EMPTY},
+ {"fclrf.s2", f0, OpXbX6Sf (0, 0, 0x05, 2), {}, EMPTY},
+ {"fclrf.s3", f0, OpXbX6Sf (0, 0, 0x05, 3), {}, EMPTY},
+ {"fchkf.s0", f0, OpXbX6Sf (0, 0, 0x08, 0), {TGT25}, EMPTY},
+ {"fchkf", f0, OpXbX6Sf (0, 0, 0x08, 0), {TGT25}, PSEUDO, 0, NULL},
+ {"fchkf.s1", f0, OpXbX6Sf (0, 0, 0x08, 1), {TGT25}, EMPTY},
+ {"fchkf.s2", f0, OpXbX6Sf (0, 0, 0x08, 2), {TGT25}, EMPTY},
+ {"fchkf.s3", f0, OpXbX6Sf (0, 0, 0x08, 3), {TGT25}, EMPTY},
+
+ {"break.f", f0, OpXbX6 (0, 0, 0x00), {IMMU21}, EMPTY},
+ {"nop.f", f0, OpXbX6 (0, 0, 0x01), {IMMU21}, EMPTY},
+
+ {"fprcpa.s0", f2, OpXbQSf (1, 1, 0, 0), {F1, P2, F2, F3}, EMPTY},
+ {"fprcpa", f2, OpXbQSf (1, 1, 0, 0), {F1, P2, F2, F3}, PSEUDO, 0, NULL},
+ {"fprcpa.s1", f2, OpXbQSf (1, 1, 0, 1), {F1, P2, F2, F3}, EMPTY},
+ {"fprcpa.s2", f2, OpXbQSf (1, 1, 0, 2), {F1, P2, F2, F3}, EMPTY},
+ {"fprcpa.s3", f2, OpXbQSf (1, 1, 0, 3), {F1, P2, F2, F3}, EMPTY},
+
+ {"fprsqrta.s0", f2, OpXbQSf (1, 1, 1, 0), {F1, P2, F3}, EMPTY},
+ {"fprsqrta", f2, OpXbQSf (1, 1, 1, 0), {F1, P2, F3}, PSEUDO, 0, NULL},
+ {"fprsqrta.s1", f2, OpXbQSf (1, 1, 1, 1), {F1, P2, F3}, EMPTY},
+ {"fprsqrta.s2", f2, OpXbQSf (1, 1, 1, 2), {F1, P2, F3}, EMPTY},
+ {"fprsqrta.s3", f2, OpXbQSf (1, 1, 1, 3), {F1, P2, F3}, EMPTY},
+
+ {"fpmin.s0", f, OpXbX6Sf (1, 0, 0x14, 0), {F1, F2, F3}, EMPTY},
+ {"fpmin", f, OpXbX6Sf (1, 0, 0x14, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fpmin.s1", f, OpXbX6Sf (1, 0, 0x14, 1), {F1, F2, F3}, EMPTY},
+ {"fpmin.s2", f, OpXbX6Sf (1, 0, 0x14, 2), {F1, F2, F3}, EMPTY},
+ {"fpmin.s3", f, OpXbX6Sf (1, 0, 0x14, 3), {F1, F2, F3}, EMPTY},
+ {"fpmax.s0", f, OpXbX6Sf (1, 0, 0x15, 0), {F1, F2, F3}, EMPTY},
+ {"fpmax", f, OpXbX6Sf (1, 0, 0x15, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fpmax.s1", f, OpXbX6Sf (1, 0, 0x15, 1), {F1, F2, F3}, EMPTY},
+ {"fpmax.s2", f, OpXbX6Sf (1, 0, 0x15, 2), {F1, F2, F3}, EMPTY},
+ {"fpmax.s3", f, OpXbX6Sf (1, 0, 0x15, 3), {F1, F2, F3}, EMPTY},
+ {"fpamin.s0", f, OpXbX6Sf (1, 0, 0x16, 0), {F1, F2, F3}, EMPTY},
+ {"fpamin", f, OpXbX6Sf (1, 0, 0x16, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fpamin.s1", f, OpXbX6Sf (1, 0, 0x16, 1), {F1, F2, F3}, EMPTY},
+ {"fpamin.s2", f, OpXbX6Sf (1, 0, 0x16, 2), {F1, F2, F3}, EMPTY},
+ {"fpamin.s3", f, OpXbX6Sf (1, 0, 0x16, 3), {F1, F2, F3}, EMPTY},
+ {"fpamax.s0", f, OpXbX6Sf (1, 0, 0x17, 0), {F1, F2, F3}, EMPTY},
+ {"fpamax", f, OpXbX6Sf (1, 0, 0x17, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fpamax.s1", f, OpXbX6Sf (1, 0, 0x17, 1), {F1, F2, F3}, EMPTY},
+ {"fpamax.s2", f, OpXbX6Sf (1, 0, 0x17, 2), {F1, F2, F3}, EMPTY},
+ {"fpamax.s3", f, OpXbX6Sf (1, 0, 0x17, 3), {F1, F2, F3}, EMPTY},
+
+ {"fpcmp.eq.s0", f, OpXbX6Sf (1, 0, 0x30, 0), {F1, F2, F3}, EMPTY},
+ {"fpcmp.eq", f, OpXbX6Sf (1, 0, 0x30, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fpcmp.eq.s1", f, OpXbX6Sf (1, 0, 0x30, 1), {F1, F2, F3}, EMPTY},
+ {"fpcmp.eq.s2", f, OpXbX6Sf (1, 0, 0x30, 2), {F1, F2, F3}, EMPTY},
+ {"fpcmp.eq.s3", f, OpXbX6Sf (1, 0, 0x30, 3), {F1, F2, F3}, EMPTY},
+ {"fpcmp.lt.s0", f, OpXbX6Sf (1, 0, 0x31, 0), {F1, F2, F3}, EMPTY},
+ {"fpcmp.lt", f, OpXbX6Sf (1, 0, 0x31, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fpcmp.lt.s1", f, OpXbX6Sf (1, 0, 0x31, 1), {F1, F2, F3}, EMPTY},
+ {"fpcmp.lt.s2", f, OpXbX6Sf (1, 0, 0x31, 2), {F1, F2, F3}, EMPTY},
+ {"fpcmp.lt.s3", f, OpXbX6Sf (1, 0, 0x31, 3), {F1, F2, F3}, EMPTY},
+ {"fpcmp.le.s0", f, OpXbX6Sf (1, 0, 0x32, 0), {F1, F2, F3}, EMPTY},
+ {"fpcmp.le", f, OpXbX6Sf (1, 0, 0x32, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fpcmp.le.s1", f, OpXbX6Sf (1, 0, 0x32, 1), {F1, F2, F3}, EMPTY},
+ {"fpcmp.le.s2", f, OpXbX6Sf (1, 0, 0x32, 2), {F1, F2, F3}, EMPTY},
+ {"fpcmp.le.s3", f, OpXbX6Sf (1, 0, 0x32, 3), {F1, F2, F3}, EMPTY},
+ {"fpcmp.gt.s0", f, OpXbX6Sf (1, 0, 0x31, 0), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.gt", f, OpXbX6Sf (1, 0, 0x31, 0), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.gt.s1", f, OpXbX6Sf (1, 0, 0x31, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.gt.s2", f, OpXbX6Sf (1, 0, 0x31, 2), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.gt.s3", f, OpXbX6Sf (1, 0, 0x31, 3), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.ge.s0", f, OpXbX6Sf (1, 0, 0x32, 0), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.ge", f, OpXbX6Sf (1, 0, 0x32, 0), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.ge.s1", f, OpXbX6Sf (1, 0, 0x32, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.ge.s2", f, OpXbX6Sf (1, 0, 0x32, 2), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.ge.s3", f, OpXbX6Sf (1, 0, 0x32, 3), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.unord.s0", f, OpXbX6Sf (1, 0, 0x33, 0), {F1, F2, F3}, EMPTY},
+ {"fpcmp.unord", f, OpXbX6Sf (1, 0, 0x33, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fpcmp.unord.s1", f, OpXbX6Sf (1, 0, 0x33, 1), {F1, F2, F3}, EMPTY},
+ {"fpcmp.unord.s2", f, OpXbX6Sf (1, 0, 0x33, 2), {F1, F2, F3}, EMPTY},
+ {"fpcmp.unord.s3", f, OpXbX6Sf (1, 0, 0x33, 3), {F1, F2, F3}, EMPTY},
+ {"fpcmp.neq.s0", f, OpXbX6Sf (1, 0, 0x34, 0), {F1, F2, F3}, EMPTY},
+ {"fpcmp.neq", f, OpXbX6Sf (1, 0, 0x34, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fpcmp.neq.s1", f, OpXbX6Sf (1, 0, 0x34, 1), {F1, F2, F3}, EMPTY},
+ {"fpcmp.neq.s2", f, OpXbX6Sf (1, 0, 0x34, 2), {F1, F2, F3}, EMPTY},
+ {"fpcmp.neq.s3", f, OpXbX6Sf (1, 0, 0x34, 3), {F1, F2, F3}, EMPTY},
+ {"fpcmp.nlt.s0", f, OpXbX6Sf (1, 0, 0x35, 0), {F1, F2, F3}, EMPTY},
+ {"fpcmp.nlt", f, OpXbX6Sf (1, 0, 0x35, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fpcmp.nlt.s1", f, OpXbX6Sf (1, 0, 0x35, 1), {F1, F2, F3}, EMPTY},
+ {"fpcmp.nlt.s2", f, OpXbX6Sf (1, 0, 0x35, 2), {F1, F2, F3}, EMPTY},
+ {"fpcmp.nlt.s3", f, OpXbX6Sf (1, 0, 0x35, 3), {F1, F2, F3}, EMPTY},
+ {"fpcmp.nle.s0", f, OpXbX6Sf (1, 0, 0x36, 0), {F1, F2, F3}, EMPTY},
+ {"fpcmp.nle", f, OpXbX6Sf (1, 0, 0x36, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fpcmp.nle.s1", f, OpXbX6Sf (1, 0, 0x36, 1), {F1, F2, F3}, EMPTY},
+ {"fpcmp.nle.s2", f, OpXbX6Sf (1, 0, 0x36, 2), {F1, F2, F3}, EMPTY},
+ {"fpcmp.nle.s3", f, OpXbX6Sf (1, 0, 0x36, 3), {F1, F2, F3}, EMPTY},
+ {"fpcmp.ngt.s0", f, OpXbX6Sf (1, 0, 0x35, 0), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.ngt", f, OpXbX6Sf (1, 0, 0x35, 0), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.ngt.s1", f, OpXbX6Sf (1, 0, 0x35, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.ngt.s2", f, OpXbX6Sf (1, 0, 0x35, 2), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.ngt.s3", f, OpXbX6Sf (1, 0, 0x35, 3), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.nge.s0", f, OpXbX6Sf (1, 0, 0x36, 0), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.nge", f, OpXbX6Sf (1, 0, 0x36, 0), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.nge.s1", f, OpXbX6Sf (1, 0, 0x36, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.nge.s2", f, OpXbX6Sf (1, 0, 0x36, 2), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.nge.s3", f, OpXbX6Sf (1, 0, 0x36, 3), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fpcmp.ord.s0", f, OpXbX6Sf (1, 0, 0x37, 0), {F1, F2, F3}, EMPTY},
+ {"fpcmp.ord", f, OpXbX6Sf (1, 0, 0x37, 0), {F1, F2, F3}, PSEUDO, 0, NULL},
+ {"fpcmp.ord.s1", f, OpXbX6Sf (1, 0, 0x37, 1), {F1, F2, F3}, EMPTY},
+ {"fpcmp.ord.s2", f, OpXbX6Sf (1, 0, 0x37, 2), {F1, F2, F3}, EMPTY},
+ {"fpcmp.ord.s3", f, OpXbX6Sf (1, 0, 0x37, 3), {F1, F2, F3}, EMPTY},
+
+ {"fpabs", f, OpXbX6F2 (1, 0, 0x10, 0), {F1, F3}, PSEUDO, 0, NULL},
+ {"fpneg", f, OpXbX6 (1, 0, 0x11), {F1, F3}, PSEUDO | F2_EQ_F3, 0, NULL},
+ {"fpnegabs", f, OpXbX6F2 (1, 0, 0x11, 0), {F1, F3}, PSEUDO, 0, NULL},
+ {"fpmerge.s", f, OpXbX6 (1, 0, 0x10), {F1, F2, F3}, EMPTY},
+ {"fpmerge.ns", f, OpXbX6 (1, 0, 0x11), {F1, F2, F3}, EMPTY},
+ {"fpmerge.se", f, OpXbX6 (1, 0, 0x12), {F1, F2, F3}, EMPTY},
+
+ {"fpcvt.fx.s0", f, OpXbX6Sf (1, 0, 0x18, 0), {F1, F2}, EMPTY},
+ {"fpcvt.fx", f, OpXbX6Sf (1, 0, 0x18, 0), {F1, F2}, PSEUDO, 0, NULL},
+ {"fpcvt.fx.s1", f, OpXbX6Sf (1, 0, 0x18, 1), {F1, F2}, EMPTY},
+ {"fpcvt.fx.s2", f, OpXbX6Sf (1, 0, 0x18, 2), {F1, F2}, EMPTY},
+ {"fpcvt.fx.s3", f, OpXbX6Sf (1, 0, 0x18, 3), {F1, F2}, EMPTY},
+ {"fpcvt.fxu.s0", f, OpXbX6Sf (1, 0, 0x19, 0), {F1, F2}, EMPTY},
+ {"fpcvt.fxu", f, OpXbX6Sf (1, 0, 0x19, 0), {F1, F2}, PSEUDO, 0, NULL},
+ {"fpcvt.fxu.s1", f, OpXbX6Sf (1, 0, 0x19, 1), {F1, F2}, EMPTY},
+ {"fpcvt.fxu.s2", f, OpXbX6Sf (1, 0, 0x19, 2), {F1, F2}, EMPTY},
+ {"fpcvt.fxu.s3", f, OpXbX6Sf (1, 0, 0x19, 3), {F1, F2}, EMPTY},
+ {"fpcvt.fx.trunc.s0", f, OpXbX6Sf (1, 0, 0x1a, 0), {F1, F2}, EMPTY},
+ {"fpcvt.fx.trunc", f, OpXbX6Sf (1, 0, 0x1a, 0), {F1, F2}, PSEUDO, 0, NULL},
+ {"fpcvt.fx.trunc.s1", f, OpXbX6Sf (1, 0, 0x1a, 1), {F1, F2}, EMPTY},
+ {"fpcvt.fx.trunc.s2", f, OpXbX6Sf (1, 0, 0x1a, 2), {F1, F2}, EMPTY},
+ {"fpcvt.fx.trunc.s3", f, OpXbX6Sf (1, 0, 0x1a, 3), {F1, F2}, EMPTY},
+ {"fpcvt.fxu.trunc.s0", f, OpXbX6Sf (1, 0, 0x1b, 0), {F1, F2}, EMPTY},
+ {"fpcvt.fxu.trunc", f, OpXbX6Sf (1, 0, 0x1b, 0), {F1, F2}, PSEUDO, 0, NULL},
+ {"fpcvt.fxu.trunc.s1", f, OpXbX6Sf (1, 0, 0x1b, 1), {F1, F2}, EMPTY},
+ {"fpcvt.fxu.trunc.s2", f, OpXbX6Sf (1, 0, 0x1b, 2), {F1, F2}, EMPTY},
+ {"fpcvt.fxu.trunc.s3", f, OpXbX6Sf (1, 0, 0x1b, 3), {F1, F2}, EMPTY},
+
+ {"fcmp.eq.s0", f2, OpRaRbTaSf (4, 0, 0, 0, 0), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.eq", f2, OpRaRbTaSf (4, 0, 0, 0, 0), {P1, P2, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.eq.s1", f2, OpRaRbTaSf (4, 0, 0, 0, 1), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.eq.s2", f2, OpRaRbTaSf (4, 0, 0, 0, 2), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.eq.s3", f2, OpRaRbTaSf (4, 0, 0, 0, 3), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.lt.s0", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.lt", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P1, P2, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.lt.s1", f2, OpRaRbTaSf (4, 0, 1, 0, 1), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.lt.s2", f2, OpRaRbTaSf (4, 0, 1, 0, 2), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.lt.s3", f2, OpRaRbTaSf (4, 0, 1, 0, 3), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.le.s0", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.le", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P1, P2, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.le.s1", f2, OpRaRbTaSf (4, 1, 0, 0, 1), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.le.s2", f2, OpRaRbTaSf (4, 1, 0, 0, 2), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.le.s3", f2, OpRaRbTaSf (4, 1, 0, 0, 3), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.unord.s0", f2, OpRaRbTaSf (4, 1, 1, 0, 0), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.unord", f2, OpRaRbTaSf (4, 1, 1, 0, 0), {P1, P2, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.unord.s1", f2, OpRaRbTaSf (4, 1, 1, 0, 1), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.unord.s2", f2, OpRaRbTaSf (4, 1, 1, 0, 2), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.unord.s3", f2, OpRaRbTaSf (4, 1, 1, 0, 3), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.eq.unc.s0", f2, OpRaRbTaSf (4, 0, 0, 1, 0), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.eq.unc", f2, OpRaRbTaSf (4, 0, 0, 1, 0), {P1, P2, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.eq.unc.s1", f2, OpRaRbTaSf (4, 0, 0, 1, 1), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.eq.unc.s2", f2, OpRaRbTaSf (4, 0, 0, 1, 2), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.eq.unc.s3", f2, OpRaRbTaSf (4, 0, 0, 1, 3), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.lt.unc.s0", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.lt.unc", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P1, P2, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.lt.unc.s1", f2, OpRaRbTaSf (4, 0, 1, 1, 1), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.lt.unc.s2", f2, OpRaRbTaSf (4, 0, 1, 1, 2), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.lt.unc.s3", f2, OpRaRbTaSf (4, 0, 1, 1, 3), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.le.unc.s0", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.le.unc", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P1, P2, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.le.unc.s1", f2, OpRaRbTaSf (4, 1, 0, 1, 1), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.le.unc.s2", f2, OpRaRbTaSf (4, 1, 0, 1, 2), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.le.unc.s3", f2, OpRaRbTaSf (4, 1, 0, 1, 3), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.unord.unc.s0", f2, OpRaRbTaSf (4, 1, 1, 1, 0), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.unord.unc", f2, OpRaRbTaSf (4, 1, 1, 1, 0), {P1, P2, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.unord.unc.s1", f2, OpRaRbTaSf (4, 1, 1, 1, 1), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.unord.unc.s2", f2, OpRaRbTaSf (4, 1, 1, 1, 2), {P1, P2, F2, F3}, EMPTY},
+ {"fcmp.unord.unc.s3", f2, OpRaRbTaSf (4, 1, 1, 1, 3), {P1, P2, F2, F3}, EMPTY},
/* pseudo-ops of the above */
- {"fcmp.gt.s0", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P1, P2, F3, F2}},
- {"fcmp.gt", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P1, P2, F3, F2}, PSEUDO},
- {"fcmp.gt.s1", f2, OpRaRbTaSf (4, 0, 1, 0, 1), {P1, P2, F3, F2}},
- {"fcmp.gt.s2", f2, OpRaRbTaSf (4, 0, 1, 0, 2), {P1, P2, F3, F2}},
- {"fcmp.gt.s3", f2, OpRaRbTaSf (4, 0, 1, 0, 3), {P1, P2, F3, F2}},
- {"fcmp.ge.s0", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P1, P2, F3, F2}},
- {"fcmp.ge", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P1, P2, F3, F2}, PSEUDO},
- {"fcmp.ge.s1", f2, OpRaRbTaSf (4, 1, 0, 0, 1), {P1, P2, F3, F2}},
- {"fcmp.ge.s2", f2, OpRaRbTaSf (4, 1, 0, 0, 2), {P1, P2, F3, F2}},
- {"fcmp.ge.s3", f2, OpRaRbTaSf (4, 1, 0, 0, 3), {P1, P2, F3, F2}},
- {"fcmp.neq.s0", f2, OpRaRbTaSf (4, 0, 0, 0, 0), {P2, P1, F2, F3}},
- {"fcmp.neq", f2, OpRaRbTaSf (4, 0, 0, 0, 0), {P2, P1, F2, F3}, PSEUDO},
- {"fcmp.neq.s1", f2, OpRaRbTaSf (4, 0, 0, 0, 1), {P2, P1, F2, F3}},
- {"fcmp.neq.s2", f2, OpRaRbTaSf (4, 0, 0, 0, 2), {P2, P1, F2, F3}},
- {"fcmp.neq.s3", f2, OpRaRbTaSf (4, 0, 0, 0, 3), {P2, P1, F2, F3}},
- {"fcmp.nlt.s0", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P2, P1, F2, F3}},
- {"fcmp.nlt", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P2, P1, F2, F3}, PSEUDO},
- {"fcmp.nlt.s1", f2, OpRaRbTaSf (4, 0, 1, 0, 1), {P2, P1, F2, F3}},
- {"fcmp.nlt.s2", f2, OpRaRbTaSf (4, 0, 1, 0, 2), {P2, P1, F2, F3}},
- {"fcmp.nlt.s3", f2, OpRaRbTaSf (4, 0, 1, 0, 3), {P2, P1, F2, F3}},
- {"fcmp.nle.s0", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P2, P1, F2, F3}},
- {"fcmp.nle", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P2, P1, F2, F3}, PSEUDO},
- {"fcmp.nle.s1", f2, OpRaRbTaSf (4, 1, 0, 0, 1), {P2, P1, F2, F3}},
- {"fcmp.nle.s2", f2, OpRaRbTaSf (4, 1, 0, 0, 2), {P2, P1, F2, F3}},
- {"fcmp.nle.s3", f2, OpRaRbTaSf (4, 1, 0, 0, 3), {P2, P1, F2, F3}},
- {"fcmp.ngt.s0", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P2, P1, F3, F2}},
- {"fcmp.ngt", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P2, P1, F3, F2}, PSEUDO},
- {"fcmp.ngt.s1", f2, OpRaRbTaSf (4, 0, 1, 0, 1), {P2, P1, F3, F2}},
- {"fcmp.ngt.s2", f2, OpRaRbTaSf (4, 0, 1, 0, 2), {P2, P1, F3, F2}},
- {"fcmp.ngt.s3", f2, OpRaRbTaSf (4, 0, 1, 0, 3), {P2, P1, F3, F2}},
- {"fcmp.nge.s0", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P2, P1, F3, F2}},
- {"fcmp.nge", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P2, P1, F3, F2}, PSEUDO},
- {"fcmp.nge.s1", f2, OpRaRbTaSf (4, 1, 0, 0, 1), {P2, P1, F3, F2}},
- {"fcmp.nge.s2", f2, OpRaRbTaSf (4, 1, 0, 0, 2), {P2, P1, F3, F2}},
- {"fcmp.nge.s3", f2, OpRaRbTaSf (4, 1, 0, 0, 3), {P2, P1, F3, F2}},
- {"fcmp.ord.s0", f2, OpRaRbTaSf (4, 1, 1, 0, 0), {P2, P1, F2, F3}},
- {"fcmp.ord", f2, OpRaRbTaSf (4, 1, 1, 0, 0), {P2, P1, F2, F3}, PSEUDO},
- {"fcmp.ord.s1", f2, OpRaRbTaSf (4, 1, 1, 0, 1), {P2, P1, F2, F3}},
- {"fcmp.ord.s2", f2, OpRaRbTaSf (4, 1, 1, 0, 2), {P2, P1, F2, F3}},
- {"fcmp.ord.s3", f2, OpRaRbTaSf (4, 1, 1, 0, 3), {P2, P1, F2, F3}},
- {"fcmp.gt.unc.s0", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P1, P2, F3, F2}},
- {"fcmp.gt.unc", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P1, P2, F3, F2}, PSEUDO},
- {"fcmp.gt.unc.s1", f2, OpRaRbTaSf (4, 0, 1, 1, 1), {P1, P2, F3, F2}},
- {"fcmp.gt.unc.s2", f2, OpRaRbTaSf (4, 0, 1, 1, 2), {P1, P2, F3, F2}},
- {"fcmp.gt.unc.s3", f2, OpRaRbTaSf (4, 0, 1, 1, 3), {P1, P2, F3, F2}},
- {"fcmp.ge.unc.s0", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P1, P2, F3, F2}},
- {"fcmp.ge.unc", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P1, P2, F3, F2}, PSEUDO},
- {"fcmp.ge.unc.s1", f2, OpRaRbTaSf (4, 1, 0, 1, 1), {P1, P2, F3, F2}},
- {"fcmp.ge.unc.s2", f2, OpRaRbTaSf (4, 1, 0, 1, 2), {P1, P2, F3, F2}},
- {"fcmp.ge.unc.s3", f2, OpRaRbTaSf (4, 1, 0, 1, 3), {P1, P2, F3, F2}},
- {"fcmp.neq.unc.s0", f2, OpRaRbTaSf (4, 0, 0, 1, 0), {P2, P1, F2, F3}},
- {"fcmp.neq.unc", f2, OpRaRbTaSf (4, 0, 0, 1, 0), {P2, P1, F2, F3}, PSEUDO},
- {"fcmp.neq.unc.s1", f2, OpRaRbTaSf (4, 0, 0, 1, 1), {P2, P1, F2, F3}},
- {"fcmp.neq.unc.s2", f2, OpRaRbTaSf (4, 0, 0, 1, 2), {P2, P1, F2, F3}},
- {"fcmp.neq.unc.s3", f2, OpRaRbTaSf (4, 0, 0, 1, 3), {P2, P1, F2, F3}},
- {"fcmp.nlt.unc.s0", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P2, P1, F2, F3}},
- {"fcmp.nlt.unc", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P2, P1, F2, F3}, PSEUDO},
- {"fcmp.nlt.unc.s1", f2, OpRaRbTaSf (4, 0, 1, 1, 1), {P2, P1, F2, F3}},
- {"fcmp.nlt.unc.s2", f2, OpRaRbTaSf (4, 0, 1, 1, 2), {P2, P1, F2, F3}},
- {"fcmp.nlt.unc.s3", f2, OpRaRbTaSf (4, 0, 1, 1, 3), {P2, P1, F2, F3}},
- {"fcmp.nle.unc.s0", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P2, P1, F2, F3}},
- {"fcmp.nle.unc", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P2, P1, F2, F3}, PSEUDO},
- {"fcmp.nle.unc.s1", f2, OpRaRbTaSf (4, 1, 0, 1, 1), {P2, P1, F2, F3}},
- {"fcmp.nle.unc.s2", f2, OpRaRbTaSf (4, 1, 0, 1, 2), {P2, P1, F2, F3}},
- {"fcmp.nle.unc.s3", f2, OpRaRbTaSf (4, 1, 0, 1, 3), {P2, P1, F2, F3}},
- {"fcmp.ngt.unc.s0", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P2, P1, F3, F2}},
- {"fcmp.ngt.unc", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P2, P1, F3, F2}, PSEUDO},
- {"fcmp.ngt.unc.s1", f2, OpRaRbTaSf (4, 0, 1, 1, 1), {P2, P1, F3, F2}},
- {"fcmp.ngt.unc.s2", f2, OpRaRbTaSf (4, 0, 1, 1, 2), {P2, P1, F3, F2}},
- {"fcmp.ngt.unc.s3", f2, OpRaRbTaSf (4, 0, 1, 1, 3), {P2, P1, F3, F2}},
- {"fcmp.nge.unc.s0", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P2, P1, F3, F2}},
- {"fcmp.nge.unc", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P2, P1, F3, F2}, PSEUDO},
- {"fcmp.nge.unc.s1", f2, OpRaRbTaSf (4, 1, 0, 1, 1), {P2, P1, F3, F2}},
- {"fcmp.nge.unc.s2", f2, OpRaRbTaSf (4, 1, 0, 1, 2), {P2, P1, F3, F2}},
- {"fcmp.nge.unc.s3", f2, OpRaRbTaSf (4, 1, 0, 1, 3), {P2, P1, F3, F2}},
- {"fcmp.ord.unc.s0", f2, OpRaRbTaSf (4, 1, 1, 1, 0), {P2, P1, F2, F3}},
- {"fcmp.ord.unc", f2, OpRaRbTaSf (4, 1, 1, 1, 0), {P2, P1, F2, F3}, PSEUDO},
- {"fcmp.ord.unc.s1", f2, OpRaRbTaSf (4, 1, 1, 1, 1), {P2, P1, F2, F3}},
- {"fcmp.ord.unc.s2", f2, OpRaRbTaSf (4, 1, 1, 1, 2), {P2, P1, F2, F3}},
- {"fcmp.ord.unc.s3", f2, OpRaRbTaSf (4, 1, 1, 1, 3), {P2, P1, F2, F3}},
-
- {"fclass.m", f2, OpTa (5, 0), {P1, P2, F2, IMMU9}},
- {"fclass.nm", f2, OpTa (5, 0), {P2, P1, F2, IMMU9}, PSEUDO},
- {"fclass.m.unc", f2, OpTa (5, 1), {P1, P2, F2, IMMU9}},
- {"fclass.nm.unc", f2, OpTa (5, 1), {P2, P1, F2, IMMU9}, PSEUDO},
+ {"fcmp.gt.s0", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.gt", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P1, P2, F3, F2}, PSEUDO, 0, NULL},
+ {"fcmp.gt.s1", f2, OpRaRbTaSf (4, 0, 1, 0, 1), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.gt.s2", f2, OpRaRbTaSf (4, 0, 1, 0, 2), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.gt.s3", f2, OpRaRbTaSf (4, 0, 1, 0, 3), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.ge.s0", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.ge", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P1, P2, F3, F2}, PSEUDO, 0, NULL},
+ {"fcmp.ge.s1", f2, OpRaRbTaSf (4, 1, 0, 0, 1), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.ge.s2", f2, OpRaRbTaSf (4, 1, 0, 0, 2), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.ge.s3", f2, OpRaRbTaSf (4, 1, 0, 0, 3), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.neq.s0", f2, OpRaRbTaSf (4, 0, 0, 0, 0), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.neq", f2, OpRaRbTaSf (4, 0, 0, 0, 0), {P2, P1, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.neq.s1", f2, OpRaRbTaSf (4, 0, 0, 0, 1), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.neq.s2", f2, OpRaRbTaSf (4, 0, 0, 0, 2), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.neq.s3", f2, OpRaRbTaSf (4, 0, 0, 0, 3), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nlt.s0", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nlt", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P2, P1, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.nlt.s1", f2, OpRaRbTaSf (4, 0, 1, 0, 1), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nlt.s2", f2, OpRaRbTaSf (4, 0, 1, 0, 2), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nlt.s3", f2, OpRaRbTaSf (4, 0, 1, 0, 3), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nle.s0", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nle", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P2, P1, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.nle.s1", f2, OpRaRbTaSf (4, 1, 0, 0, 1), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nle.s2", f2, OpRaRbTaSf (4, 1, 0, 0, 2), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nle.s3", f2, OpRaRbTaSf (4, 1, 0, 0, 3), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.ngt.s0", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.ngt", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P2, P1, F3, F2}, PSEUDO, 0, NULL},
+ {"fcmp.ngt.s1", f2, OpRaRbTaSf (4, 0, 1, 0, 1), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.ngt.s2", f2, OpRaRbTaSf (4, 0, 1, 0, 2), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.ngt.s3", f2, OpRaRbTaSf (4, 0, 1, 0, 3), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.nge.s0", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.nge", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P2, P1, F3, F2}, PSEUDO, 0, NULL},
+ {"fcmp.nge.s1", f2, OpRaRbTaSf (4, 1, 0, 0, 1), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.nge.s2", f2, OpRaRbTaSf (4, 1, 0, 0, 2), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.nge.s3", f2, OpRaRbTaSf (4, 1, 0, 0, 3), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.ord.s0", f2, OpRaRbTaSf (4, 1, 1, 0, 0), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.ord", f2, OpRaRbTaSf (4, 1, 1, 0, 0), {P2, P1, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.ord.s1", f2, OpRaRbTaSf (4, 1, 1, 0, 1), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.ord.s2", f2, OpRaRbTaSf (4, 1, 1, 0, 2), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.ord.s3", f2, OpRaRbTaSf (4, 1, 1, 0, 3), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.gt.unc.s0", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.gt.unc", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P1, P2, F3, F2}, PSEUDO, 0, NULL},
+ {"fcmp.gt.unc.s1", f2, OpRaRbTaSf (4, 0, 1, 1, 1), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.gt.unc.s2", f2, OpRaRbTaSf (4, 0, 1, 1, 2), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.gt.unc.s3", f2, OpRaRbTaSf (4, 0, 1, 1, 3), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.ge.unc.s0", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.ge.unc", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P1, P2, F3, F2}, PSEUDO, 0, NULL},
+ {"fcmp.ge.unc.s1", f2, OpRaRbTaSf (4, 1, 0, 1, 1), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.ge.unc.s2", f2, OpRaRbTaSf (4, 1, 0, 1, 2), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.ge.unc.s3", f2, OpRaRbTaSf (4, 1, 0, 1, 3), {P1, P2, F3, F2}, EMPTY},
+ {"fcmp.neq.unc.s0", f2, OpRaRbTaSf (4, 0, 0, 1, 0), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.neq.unc", f2, OpRaRbTaSf (4, 0, 0, 1, 0), {P2, P1, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.neq.unc.s1", f2, OpRaRbTaSf (4, 0, 0, 1, 1), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.neq.unc.s2", f2, OpRaRbTaSf (4, 0, 0, 1, 2), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.neq.unc.s3", f2, OpRaRbTaSf (4, 0, 0, 1, 3), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nlt.unc.s0", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nlt.unc", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P2, P1, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.nlt.unc.s1", f2, OpRaRbTaSf (4, 0, 1, 1, 1), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nlt.unc.s2", f2, OpRaRbTaSf (4, 0, 1, 1, 2), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nlt.unc.s3", f2, OpRaRbTaSf (4, 0, 1, 1, 3), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nle.unc.s0", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nle.unc", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P2, P1, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.nle.unc.s1", f2, OpRaRbTaSf (4, 1, 0, 1, 1), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nle.unc.s2", f2, OpRaRbTaSf (4, 1, 0, 1, 2), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.nle.unc.s3", f2, OpRaRbTaSf (4, 1, 0, 1, 3), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.ngt.unc.s0", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.ngt.unc", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P2, P1, F3, F2}, PSEUDO, 0, NULL},
+ {"fcmp.ngt.unc.s1", f2, OpRaRbTaSf (4, 0, 1, 1, 1), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.ngt.unc.s2", f2, OpRaRbTaSf (4, 0, 1, 1, 2), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.ngt.unc.s3", f2, OpRaRbTaSf (4, 0, 1, 1, 3), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.nge.unc.s0", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.nge.unc", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P2, P1, F3, F2}, PSEUDO, 0, NULL},
+ {"fcmp.nge.unc.s1", f2, OpRaRbTaSf (4, 1, 0, 1, 1), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.nge.unc.s2", f2, OpRaRbTaSf (4, 1, 0, 1, 2), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.nge.unc.s3", f2, OpRaRbTaSf (4, 1, 0, 1, 3), {P2, P1, F3, F2}, EMPTY},
+ {"fcmp.ord.unc.s0", f2, OpRaRbTaSf (4, 1, 1, 1, 0), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.ord.unc", f2, OpRaRbTaSf (4, 1, 1, 1, 0), {P2, P1, F2, F3}, PSEUDO, 0, NULL},
+ {"fcmp.ord.unc.s1", f2, OpRaRbTaSf (4, 1, 1, 1, 1), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.ord.unc.s2", f2, OpRaRbTaSf (4, 1, 1, 1, 2), {P2, P1, F2, F3}, EMPTY},
+ {"fcmp.ord.unc.s3", f2, OpRaRbTaSf (4, 1, 1, 1, 3), {P2, P1, F2, F3}, EMPTY},
+
+ {"fclass.m", f2, OpTa (5, 0), {P1, P2, F2, IMMU9}, EMPTY},
+ {"fclass.nm", f2, OpTa (5, 0), {P2, P1, F2, IMMU9}, PSEUDO, 0, NULL},
+ {"fclass.m.unc", f2, OpTa (5, 1), {P1, P2, F2, IMMU9}, EMPTY},
+ {"fclass.nm.unc", f2, OpTa (5, 1), {P2, P1, F2, IMMU9}, PSEUDO, 0, NULL},
/* note: fnorm and fcvt.xuf have identical encodings! */
- {"fnorm.s0", f, OpXaSfF2F4 (0x8, 0, 0, 0, 1), {F1, F3}, PSEUDO},
- {"fnorm", f, OpXaSfF2F4 (0x8, 0, 0, 0, 1), {F1, F3}, PSEUDO},
- {"fnorm.s1", f, OpXaSfF2F4 (0x8, 0, 1, 0, 1), {F1, F3}, PSEUDO},
- {"fnorm.s2", f, OpXaSfF2F4 (0x8, 0, 2, 0, 1), {F1, F3}, PSEUDO},
- {"fnorm.s3", f, OpXaSfF2F4 (0x8, 0, 3, 0, 1), {F1, F3}, PSEUDO},
- {"fnorm.s.s0", f, OpXaSfF2F4 (0x8, 1, 0, 0, 1), {F1, F3}, PSEUDO},
- {"fnorm.s", f, OpXaSfF2F4 (0x8, 1, 0, 0, 1), {F1, F3}, PSEUDO},
- {"fnorm.s.s1", f, OpXaSfF2F4 (0x8, 1, 1, 0, 1), {F1, F3}, PSEUDO},
- {"fnorm.s.s2", f, OpXaSfF2F4 (0x8, 1, 2, 0, 1), {F1, F3}, PSEUDO},
- {"fnorm.s.s3", f, OpXaSfF2F4 (0x8, 1, 3, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.s0", f, OpXaSfF2F4 (0x8, 0, 0, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf", f, OpXaSfF2F4 (0x8, 0, 0, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.s1", f, OpXaSfF2F4 (0x8, 0, 1, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.s2", f, OpXaSfF2F4 (0x8, 0, 2, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.s3", f, OpXaSfF2F4 (0x8, 0, 3, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.s.s0", f, OpXaSfF2F4 (0x8, 1, 0, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.s", f, OpXaSfF2F4 (0x8, 1, 0, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.s.s1", f, OpXaSfF2F4 (0x8, 1, 1, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.s.s2", f, OpXaSfF2F4 (0x8, 1, 2, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.s.s3", f, OpXaSfF2F4 (0x8, 1, 3, 0, 1), {F1, F3}, PSEUDO},
- {"fadd.s0", f, OpXaSfF4 (0x8, 0, 0, 1), {F1, F3, F2}, PSEUDO},
- {"fadd", f, OpXaSfF4 (0x8, 0, 0, 1), {F1, F3, F2}, PSEUDO},
- {"fadd.s1", f, OpXaSfF4 (0x8, 0, 1, 1), {F1, F3, F2}, PSEUDO},
- {"fadd.s2", f, OpXaSfF4 (0x8, 0, 2, 1), {F1, F3, F2}, PSEUDO},
- {"fadd.s3", f, OpXaSfF4 (0x8, 0, 3, 1), {F1, F3, F2}, PSEUDO},
- {"fadd.s.s0", f, OpXaSfF4 (0x8, 1, 0, 1), {F1, F3, F2}, PSEUDO},
- {"fadd.s", f, OpXaSfF4 (0x8, 1, 0, 1), {F1, F3, F2}, PSEUDO},
- {"fadd.s.s1", f, OpXaSfF4 (0x8, 1, 1, 1), {F1, F3, F2}, PSEUDO},
- {"fadd.s.s2", f, OpXaSfF4 (0x8, 1, 2, 1), {F1, F3, F2}, PSEUDO},
- {"fadd.s.s3", f, OpXaSfF4 (0x8, 1, 3, 1), {F1, F3, F2}, PSEUDO},
- {"fmpy.s0", f, OpXaSfF2 (0x8, 0, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fmpy", f, OpXaSfF2 (0x8, 0, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fmpy.s1", f, OpXaSfF2 (0x8, 0, 1, 0), {F1, F3, F4}, PSEUDO},
- {"fmpy.s2", f, OpXaSfF2 (0x8, 0, 2, 0), {F1, F3, F4}, PSEUDO},
- {"fmpy.s3", f, OpXaSfF2 (0x8, 0, 3, 0), {F1, F3, F4}, PSEUDO},
- {"fmpy.s.s0", f, OpXaSfF2 (0x8, 1, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fmpy.s", f, OpXaSfF2 (0x8, 1, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fmpy.s.s1", f, OpXaSfF2 (0x8, 1, 1, 0), {F1, F3, F4}, PSEUDO},
- {"fmpy.s.s2", f, OpXaSfF2 (0x8, 1, 2, 0), {F1, F3, F4}, PSEUDO},
- {"fmpy.s.s3", f, OpXaSfF2 (0x8, 1, 3, 0), {F1, F3, F4}, PSEUDO},
- {"fma.s0", f, OpXaSf (0x8, 0, 0), {F1, F3, F4, F2}},
- {"fma", f, OpXaSf (0x8, 0, 0), {F1, F3, F4, F2}, PSEUDO},
- {"fma.s1", f, OpXaSf (0x8, 0, 1), {F1, F3, F4, F2}},
- {"fma.s2", f, OpXaSf (0x8, 0, 2), {F1, F3, F4, F2}},
- {"fma.s3", f, OpXaSf (0x8, 0, 3), {F1, F3, F4, F2}},
- {"fma.s.s0", f, OpXaSf (0x8, 1, 0), {F1, F3, F4, F2}},
- {"fma.s", f, OpXaSf (0x8, 1, 0), {F1, F3, F4, F2}, PSEUDO},
- {"fma.s.s1", f, OpXaSf (0x8, 1, 1), {F1, F3, F4, F2}},
- {"fma.s.s2", f, OpXaSf (0x8, 1, 2), {F1, F3, F4, F2}},
- {"fma.s.s3", f, OpXaSf (0x8, 1, 3), {F1, F3, F4, F2}},
-
- {"fnorm.d.s0", f, OpXaSfF2F4 (0x9, 0, 0, 0, 1), {F1, F3}, PSEUDO},
- {"fnorm.d", f, OpXaSfF2F4 (0x9, 0, 0, 0, 1), {F1, F3}, PSEUDO},
- {"fnorm.d.s1", f, OpXaSfF2F4 (0x9, 0, 1, 0, 1), {F1, F3}, PSEUDO},
- {"fnorm.d.s2", f, OpXaSfF2F4 (0x9, 0, 2, 0, 1), {F1, F3}, PSEUDO},
- {"fnorm.d.s3", f, OpXaSfF2F4 (0x9, 0, 3, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.d.s0", f, OpXaSfF2F4 (0x9, 0, 0, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.d", f, OpXaSfF2F4 (0x9, 0, 0, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.d.s1", f, OpXaSfF2F4 (0x9, 0, 1, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.d.s2", f, OpXaSfF2F4 (0x9, 0, 2, 0, 1), {F1, F3}, PSEUDO},
- {"fcvt.xuf.d.s3", f, OpXaSfF2F4 (0x9, 0, 3, 0, 1), {F1, F3}, PSEUDO},
- {"fadd.d.s0", f, OpXaSfF4 (0x9, 0, 0, 1), {F1, F3, F2}, PSEUDO},
- {"fadd.d", f, OpXaSfF4 (0x9, 0, 0, 1), {F1, F3, F2}, PSEUDO},
- {"fadd.d.s1", f, OpXaSfF4 (0x9, 0, 1, 1), {F1, F3, F2}, PSEUDO},
- {"fadd.d.s2", f, OpXaSfF4 (0x9, 0, 2, 1), {F1, F3, F2}, PSEUDO},
- {"fadd.d.s3", f, OpXaSfF4 (0x9, 0, 3, 1), {F1, F3, F2}, PSEUDO},
- {"fmpy.d.s0", f, OpXaSfF2 (0x9, 0, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fmpy.d", f, OpXaSfF2 (0x9, 0, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fmpy.d.s1", f, OpXaSfF2 (0x9, 0, 1, 0), {F1, F3, F4}, PSEUDO},
- {"fmpy.d.s2", f, OpXaSfF2 (0x9, 0, 2, 0), {F1, F3, F4}, PSEUDO},
- {"fmpy.d.s3", f, OpXaSfF2 (0x9, 0, 3, 0), {F1, F3, F4}, PSEUDO},
- {"fma.d.s0", f, OpXaSf (0x9, 0, 0), {F1, F3, F4, F2}},
- {"fma.d", f, OpXaSf (0x9, 0, 0), {F1, F3, F4, F2}, PSEUDO},
- {"fma.d.s1", f, OpXaSf (0x9, 0, 1), {F1, F3, F4, F2}},
- {"fma.d.s2", f, OpXaSf (0x9, 0, 2), {F1, F3, F4, F2}},
- {"fma.d.s3", f, OpXaSf (0x9, 0, 3), {F1, F3, F4, F2}},
-
- {"fpmpy.s0", f, OpXaSfF2 (0x9, 1, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fpmpy", f, OpXaSfF2 (0x9, 1, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fpmpy.s1", f, OpXaSfF2 (0x9, 1, 1, 0), {F1, F3, F4}, PSEUDO},
- {"fpmpy.s2", f, OpXaSfF2 (0x9, 1, 2, 0), {F1, F3, F4}, PSEUDO},
- {"fpmpy.s3", f, OpXaSfF2 (0x9, 1, 3, 0), {F1, F3, F4}, PSEUDO},
- {"fpma.s0", f, OpXaSf (0x9, 1, 0), {F1, F3, F4, F2}},
- {"fpma", f, OpXaSf (0x9, 1, 0), {F1, F3, F4, F2}, PSEUDO},
- {"fpma.s1", f, OpXaSf (0x9, 1, 1), {F1, F3, F4, F2}},
- {"fpma.s2", f, OpXaSf (0x9, 1, 2), {F1, F3, F4, F2}},
- {"fpma.s3", f, OpXaSf (0x9, 1, 3), {F1, F3, F4, F2}},
-
- {"fsub.s0", f, OpXaSfF4 (0xa, 0, 0, 1), {F1, F3, F2}, PSEUDO},
- {"fsub", f, OpXaSfF4 (0xa, 0, 0, 1), {F1, F3, F2}, PSEUDO},
- {"fsub.s1", f, OpXaSfF4 (0xa, 0, 1, 1), {F1, F3, F2}, PSEUDO},
- {"fsub.s2", f, OpXaSfF4 (0xa, 0, 2, 1), {F1, F3, F2}, PSEUDO},
- {"fsub.s3", f, OpXaSfF4 (0xa, 0, 3, 1), {F1, F3, F2}, PSEUDO},
- {"fsub.s.s0", f, OpXaSfF4 (0xa, 1, 0, 1), {F1, F3, F2}, PSEUDO},
- {"fsub.s", f, OpXaSfF4 (0xa, 1, 0, 1), {F1, F3, F2}, PSEUDO},
- {"fsub.s.s1", f, OpXaSfF4 (0xa, 1, 1, 1), {F1, F3, F2}, PSEUDO},
- {"fsub.s.s2", f, OpXaSfF4 (0xa, 1, 2, 1), {F1, F3, F2}, PSEUDO},
- {"fsub.s.s3", f, OpXaSfF4 (0xa, 1, 3, 1), {F1, F3, F2}, PSEUDO},
- {"fms.s0", f, OpXaSf (0xa, 0, 0), {F1, F3, F4, F2}},
- {"fms", f, OpXaSf (0xa, 0, 0), {F1, F3, F4, F2}, PSEUDO},
- {"fms.s1", f, OpXaSf (0xa, 0, 1), {F1, F3, F4, F2}},
- {"fms.s2", f, OpXaSf (0xa, 0, 2), {F1, F3, F4, F2}},
- {"fms.s3", f, OpXaSf (0xa, 0, 3), {F1, F3, F4, F2}},
- {"fms.s.s0", f, OpXaSf (0xa, 1, 0), {F1, F3, F4, F2}},
- {"fms.s", f, OpXaSf (0xa, 1, 0), {F1, F3, F4, F2}, PSEUDO},
- {"fms.s.s1", f, OpXaSf (0xa, 1, 1), {F1, F3, F4, F2}},
- {"fms.s.s2", f, OpXaSf (0xa, 1, 2), {F1, F3, F4, F2}},
- {"fms.s.s3", f, OpXaSf (0xa, 1, 3), {F1, F3, F4, F2}},
- {"fsub.d.s0", f, OpXaSfF4 (0xb, 0, 0, 1), {F1, F3, F2}, PSEUDO},
- {"fsub.d", f, OpXaSfF4 (0xb, 0, 0, 1), {F1, F3, F2}, PSEUDO},
- {"fsub.d.s1", f, OpXaSfF4 (0xb, 0, 1, 1), {F1, F3, F2}, PSEUDO},
- {"fsub.d.s2", f, OpXaSfF4 (0xb, 0, 2, 1), {F1, F3, F2}, PSEUDO},
- {"fsub.d.s3", f, OpXaSfF4 (0xb, 0, 3, 1), {F1, F3, F2}, PSEUDO},
- {"fms.d.s0", f, OpXaSf (0xb, 0, 0), {F1, F3, F4, F2}},
- {"fms.d", f, OpXaSf (0xb, 0, 0), {F1, F3, F4, F2}, PSEUDO},
- {"fms.d.s1", f, OpXaSf (0xb, 0, 1), {F1, F3, F4, F2}},
- {"fms.d.s2", f, OpXaSf (0xb, 0, 2), {F1, F3, F4, F2}},
- {"fms.d.s3", f, OpXaSf (0xb, 0, 3), {F1, F3, F4, F2}},
-
- {"fpms.s0", f, OpXaSf (0xb, 1, 0), {F1, F3, F4, F2}},
- {"fpms", f, OpXaSf (0xb, 1, 0), {F1, F3, F4, F2}, PSEUDO},
- {"fpms.s1", f, OpXaSf (0xb, 1, 1), {F1, F3, F4, F2}},
- {"fpms.s2", f, OpXaSf (0xb, 1, 2), {F1, F3, F4, F2}},
- {"fpms.s3", f, OpXaSf (0xb, 1, 3), {F1, F3, F4, F2}},
-
- {"fnmpy.s0", f, OpXaSfF2 (0xc, 0, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fnmpy", f, OpXaSfF2 (0xc, 0, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fnmpy.s1", f, OpXaSfF2 (0xc, 0, 1, 0), {F1, F3, F4}, PSEUDO},
- {"fnmpy.s2", f, OpXaSfF2 (0xc, 0, 2, 0), {F1, F3, F4}, PSEUDO},
- {"fnmpy.s3", f, OpXaSfF2 (0xc, 0, 3, 0), {F1, F3, F4}, PSEUDO},
- {"fnmpy.s.s0", f, OpXaSfF2 (0xc, 1, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fnmpy.s", f, OpXaSfF2 (0xc, 1, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fnmpy.s.s1", f, OpXaSfF2 (0xc, 1, 1, 0), {F1, F3, F4}, PSEUDO},
- {"fnmpy.s.s2", f, OpXaSfF2 (0xc, 1, 2, 0), {F1, F3, F4}, PSEUDO},
- {"fnmpy.s.s3", f, OpXaSfF2 (0xc, 1, 3, 0), {F1, F3, F4}, PSEUDO},
- {"fnma.s0", f, OpXaSf (0xc, 0, 0), {F1, F3, F4, F2}},
- {"fnma", f, OpXaSf (0xc, 0, 0), {F1, F3, F4, F2}, PSEUDO},
- {"fnma.s1", f, OpXaSf (0xc, 0, 1), {F1, F3, F4, F2}},
- {"fnma.s2", f, OpXaSf (0xc, 0, 2), {F1, F3, F4, F2}},
- {"fnma.s3", f, OpXaSf (0xc, 0, 3), {F1, F3, F4, F2}},
- {"fnma.s.s0", f, OpXaSf (0xc, 1, 0), {F1, F3, F4, F2}},
- {"fnma.s", f, OpXaSf (0xc, 1, 0), {F1, F3, F4, F2}, PSEUDO},
- {"fnma.s.s1", f, OpXaSf (0xc, 1, 1), {F1, F3, F4, F2}},
- {"fnma.s.s2", f, OpXaSf (0xc, 1, 2), {F1, F3, F4, F2}},
- {"fnma.s.s3", f, OpXaSf (0xc, 1, 3), {F1, F3, F4, F2}},
- {"fnmpy.d.s0", f, OpXaSfF2 (0xd, 0, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fnmpy.d", f, OpXaSfF2 (0xd, 0, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fnmpy.d.s1", f, OpXaSfF2 (0xd, 0, 1, 0), {F1, F3, F4}, PSEUDO},
- {"fnmpy.d.s2", f, OpXaSfF2 (0xd, 0, 2, 0), {F1, F3, F4}, PSEUDO},
- {"fnmpy.d.s3", f, OpXaSfF2 (0xd, 0, 3, 0), {F1, F3, F4}, PSEUDO},
- {"fnma.d.s0", f, OpXaSf (0xd, 0, 0), {F1, F3, F4, F2}},
- {"fnma.d", f, OpXaSf (0xd, 0, 0), {F1, F3, F4, F2}, PSEUDO},
- {"fnma.d.s1", f, OpXaSf (0xd, 0, 1), {F1, F3, F4, F2}},
- {"fnma.d.s2", f, OpXaSf (0xd, 0, 2), {F1, F3, F4, F2}},
- {"fnma.d.s3", f, OpXaSf (0xd, 0, 3), {F1, F3, F4, F2}},
-
- {"fpnmpy.s0", f, OpXaSfF2 (0xd, 1, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fpnmpy", f, OpXaSfF2 (0xd, 1, 0, 0), {F1, F3, F4}, PSEUDO},
- {"fpnmpy.s1", f, OpXaSfF2 (0xd, 1, 1, 0), {F1, F3, F4}, PSEUDO},
- {"fpnmpy.s2", f, OpXaSfF2 (0xd, 1, 2, 0), {F1, F3, F4}, PSEUDO},
- {"fpnmpy.s3", f, OpXaSfF2 (0xd, 1, 3, 0), {F1, F3, F4}, PSEUDO},
- {"fpnma.s0", f, OpXaSf (0xd, 1, 0), {F1, F3, F4, F2}},
- {"fpnma", f, OpXaSf (0xd, 1, 0), {F1, F3, F4, F2}, PSEUDO},
- {"fpnma.s1", f, OpXaSf (0xd, 1, 1), {F1, F3, F4, F2}},
- {"fpnma.s2", f, OpXaSf (0xd, 1, 2), {F1, F3, F4, F2}},
- {"fpnma.s3", f, OpXaSf (0xd, 1, 3), {F1, F3, F4, F2}},
-
- {"xmpy.l", f, OpXaX2F2 (0xe, 1, 0, 0), {F1, F3, F4}, PSEUDO},
- {"xmpy.lu", f, OpXaX2F2 (0xe, 1, 0, 0), {F1, F3, F4}, PSEUDO},
- {"xmpy.h", f, OpXaX2F2 (0xe, 1, 3, 0), {F1, F3, F4}, PSEUDO},
- {"xmpy.hu", f, OpXaX2F2 (0xe, 1, 2, 0), {F1, F3, F4}, PSEUDO},
- {"xma.l", f, OpXaX2 (0xe, 1, 0), {F1, F3, F4, F2}},
- {"xma.lu", f, OpXaX2 (0xe, 1, 0), {F1, F3, F4, F2}, PSEUDO},
- {"xma.h", f, OpXaX2 (0xe, 1, 3), {F1, F3, F4, F2}},
- {"xma.hu", f, OpXaX2 (0xe, 1, 2), {F1, F3, F4, F2}},
-
- {"fselect", f, OpXa (0xe, 0), {F1, F3, F4, F2}},
-
- {0}
+ {"fnorm.s0", f, OpXaSfF2F4 (0x8, 0, 0, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fnorm", f, OpXaSfF2F4 (0x8, 0, 0, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fnorm.s1", f, OpXaSfF2F4 (0x8, 0, 1, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fnorm.s2", f, OpXaSfF2F4 (0x8, 0, 2, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fnorm.s3", f, OpXaSfF2F4 (0x8, 0, 3, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fnorm.s.s0", f, OpXaSfF2F4 (0x8, 1, 0, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fnorm.s", f, OpXaSfF2F4 (0x8, 1, 0, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fnorm.s.s1", f, OpXaSfF2F4 (0x8, 1, 1, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fnorm.s.s2", f, OpXaSfF2F4 (0x8, 1, 2, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fnorm.s.s3", f, OpXaSfF2F4 (0x8, 1, 3, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.s0", f, OpXaSfF2F4 (0x8, 0, 0, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf", f, OpXaSfF2F4 (0x8, 0, 0, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.s1", f, OpXaSfF2F4 (0x8, 0, 1, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.s2", f, OpXaSfF2F4 (0x8, 0, 2, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.s3", f, OpXaSfF2F4 (0x8, 0, 3, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.s.s0", f, OpXaSfF2F4 (0x8, 1, 0, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.s", f, OpXaSfF2F4 (0x8, 1, 0, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.s.s1", f, OpXaSfF2F4 (0x8, 1, 1, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.s.s2", f, OpXaSfF2F4 (0x8, 1, 2, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.s.s3", f, OpXaSfF2F4 (0x8, 1, 3, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fadd.s0", f, OpXaSfF4 (0x8, 0, 0, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fadd", f, OpXaSfF4 (0x8, 0, 0, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fadd.s1", f, OpXaSfF4 (0x8, 0, 1, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fadd.s2", f, OpXaSfF4 (0x8, 0, 2, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fadd.s3", f, OpXaSfF4 (0x8, 0, 3, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fadd.s.s0", f, OpXaSfF4 (0x8, 1, 0, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fadd.s", f, OpXaSfF4 (0x8, 1, 0, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fadd.s.s1", f, OpXaSfF4 (0x8, 1, 1, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fadd.s.s2", f, OpXaSfF4 (0x8, 1, 2, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fadd.s.s3", f, OpXaSfF4 (0x8, 1, 3, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fmpy.s0", f, OpXaSfF2 (0x8, 0, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fmpy", f, OpXaSfF2 (0x8, 0, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fmpy.s1", f, OpXaSfF2 (0x8, 0, 1, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fmpy.s2", f, OpXaSfF2 (0x8, 0, 2, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fmpy.s3", f, OpXaSfF2 (0x8, 0, 3, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fmpy.s.s0", f, OpXaSfF2 (0x8, 1, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fmpy.s", f, OpXaSfF2 (0x8, 1, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fmpy.s.s1", f, OpXaSfF2 (0x8, 1, 1, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fmpy.s.s2", f, OpXaSfF2 (0x8, 1, 2, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fmpy.s.s3", f, OpXaSfF2 (0x8, 1, 3, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fma.s0", f, OpXaSf (0x8, 0, 0), {F1, F3, F4, F2}, EMPTY},
+ {"fma", f, OpXaSf (0x8, 0, 0), {F1, F3, F4, F2}, PSEUDO, 0, NULL},
+ {"fma.s1", f, OpXaSf (0x8, 0, 1), {F1, F3, F4, F2}, EMPTY},
+ {"fma.s2", f, OpXaSf (0x8, 0, 2), {F1, F3, F4, F2}, EMPTY},
+ {"fma.s3", f, OpXaSf (0x8, 0, 3), {F1, F3, F4, F2}, EMPTY},
+ {"fma.s.s0", f, OpXaSf (0x8, 1, 0), {F1, F3, F4, F2}, EMPTY},
+ {"fma.s", f, OpXaSf (0x8, 1, 0), {F1, F3, F4, F2}, PSEUDO, 0, NULL},
+ {"fma.s.s1", f, OpXaSf (0x8, 1, 1), {F1, F3, F4, F2}, EMPTY},
+ {"fma.s.s2", f, OpXaSf (0x8, 1, 2), {F1, F3, F4, F2}, EMPTY},
+ {"fma.s.s3", f, OpXaSf (0x8, 1, 3), {F1, F3, F4, F2}, EMPTY},
+
+ {"fnorm.d.s0", f, OpXaSfF2F4 (0x9, 0, 0, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fnorm.d", f, OpXaSfF2F4 (0x9, 0, 0, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fnorm.d.s1", f, OpXaSfF2F4 (0x9, 0, 1, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fnorm.d.s2", f, OpXaSfF2F4 (0x9, 0, 2, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fnorm.d.s3", f, OpXaSfF2F4 (0x9, 0, 3, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.d.s0", f, OpXaSfF2F4 (0x9, 0, 0, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.d", f, OpXaSfF2F4 (0x9, 0, 0, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.d.s1", f, OpXaSfF2F4 (0x9, 0, 1, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.d.s2", f, OpXaSfF2F4 (0x9, 0, 2, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fcvt.xuf.d.s3", f, OpXaSfF2F4 (0x9, 0, 3, 0, 1), {F1, F3}, PSEUDO, 0, NULL},
+ {"fadd.d.s0", f, OpXaSfF4 (0x9, 0, 0, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fadd.d", f, OpXaSfF4 (0x9, 0, 0, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fadd.d.s1", f, OpXaSfF4 (0x9, 0, 1, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fadd.d.s2", f, OpXaSfF4 (0x9, 0, 2, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fadd.d.s3", f, OpXaSfF4 (0x9, 0, 3, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fmpy.d.s0", f, OpXaSfF2 (0x9, 0, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fmpy.d", f, OpXaSfF2 (0x9, 0, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fmpy.d.s1", f, OpXaSfF2 (0x9, 0, 1, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fmpy.d.s2", f, OpXaSfF2 (0x9, 0, 2, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fmpy.d.s3", f, OpXaSfF2 (0x9, 0, 3, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fma.d.s0", f, OpXaSf (0x9, 0, 0), {F1, F3, F4, F2}, EMPTY},
+ {"fma.d", f, OpXaSf (0x9, 0, 0), {F1, F3, F4, F2}, PSEUDO, 0, NULL},
+ {"fma.d.s1", f, OpXaSf (0x9, 0, 1), {F1, F3, F4, F2}, EMPTY},
+ {"fma.d.s2", f, OpXaSf (0x9, 0, 2), {F1, F3, F4, F2}, EMPTY},
+ {"fma.d.s3", f, OpXaSf (0x9, 0, 3), {F1, F3, F4, F2}, EMPTY},
+
+ {"fpmpy.s0", f, OpXaSfF2 (0x9, 1, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fpmpy", f, OpXaSfF2 (0x9, 1, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fpmpy.s1", f, OpXaSfF2 (0x9, 1, 1, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fpmpy.s2", f, OpXaSfF2 (0x9, 1, 2, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fpmpy.s3", f, OpXaSfF2 (0x9, 1, 3, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fpma.s0", f, OpXaSf (0x9, 1, 0), {F1, F3, F4, F2}, EMPTY},
+ {"fpma", f, OpXaSf (0x9, 1, 0), {F1, F3, F4, F2}, PSEUDO, 0, NULL},
+ {"fpma.s1", f, OpXaSf (0x9, 1, 1), {F1, F3, F4, F2}, EMPTY},
+ {"fpma.s2", f, OpXaSf (0x9, 1, 2), {F1, F3, F4, F2}, EMPTY},
+ {"fpma.s3", f, OpXaSf (0x9, 1, 3), {F1, F3, F4, F2}, EMPTY},
+
+ {"fsub.s0", f, OpXaSfF4 (0xa, 0, 0, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fsub", f, OpXaSfF4 (0xa, 0, 0, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fsub.s1", f, OpXaSfF4 (0xa, 0, 1, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fsub.s2", f, OpXaSfF4 (0xa, 0, 2, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fsub.s3", f, OpXaSfF4 (0xa, 0, 3, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fsub.s.s0", f, OpXaSfF4 (0xa, 1, 0, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fsub.s", f, OpXaSfF4 (0xa, 1, 0, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fsub.s.s1", f, OpXaSfF4 (0xa, 1, 1, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fsub.s.s2", f, OpXaSfF4 (0xa, 1, 2, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fsub.s.s3", f, OpXaSfF4 (0xa, 1, 3, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fms.s0", f, OpXaSf (0xa, 0, 0), {F1, F3, F4, F2}, EMPTY},
+ {"fms", f, OpXaSf (0xa, 0, 0), {F1, F3, F4, F2}, PSEUDO, 0, NULL},
+ {"fms.s1", f, OpXaSf (0xa, 0, 1), {F1, F3, F4, F2}, EMPTY},
+ {"fms.s2", f, OpXaSf (0xa, 0, 2), {F1, F3, F4, F2}, EMPTY},
+ {"fms.s3", f, OpXaSf (0xa, 0, 3), {F1, F3, F4, F2}, EMPTY},
+ {"fms.s.s0", f, OpXaSf (0xa, 1, 0), {F1, F3, F4, F2}, EMPTY},
+ {"fms.s", f, OpXaSf (0xa, 1, 0), {F1, F3, F4, F2}, PSEUDO, 0, NULL},
+ {"fms.s.s1", f, OpXaSf (0xa, 1, 1), {F1, F3, F4, F2}, EMPTY},
+ {"fms.s.s2", f, OpXaSf (0xa, 1, 2), {F1, F3, F4, F2}, EMPTY},
+ {"fms.s.s3", f, OpXaSf (0xa, 1, 3), {F1, F3, F4, F2}, EMPTY},
+ {"fsub.d.s0", f, OpXaSfF4 (0xb, 0, 0, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fsub.d", f, OpXaSfF4 (0xb, 0, 0, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fsub.d.s1", f, OpXaSfF4 (0xb, 0, 1, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fsub.d.s2", f, OpXaSfF4 (0xb, 0, 2, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fsub.d.s3", f, OpXaSfF4 (0xb, 0, 3, 1), {F1, F3, F2}, PSEUDO, 0, NULL},
+ {"fms.d.s0", f, OpXaSf (0xb, 0, 0), {F1, F3, F4, F2}, EMPTY},
+ {"fms.d", f, OpXaSf (0xb, 0, 0), {F1, F3, F4, F2}, PSEUDO, 0, NULL},
+ {"fms.d.s1", f, OpXaSf (0xb, 0, 1), {F1, F3, F4, F2}, EMPTY},
+ {"fms.d.s2", f, OpXaSf (0xb, 0, 2), {F1, F3, F4, F2}, EMPTY},
+ {"fms.d.s3", f, OpXaSf (0xb, 0, 3), {F1, F3, F4, F2}, EMPTY},
+
+ {"fpms.s0", f, OpXaSf (0xb, 1, 0), {F1, F3, F4, F2}, EMPTY},
+ {"fpms", f, OpXaSf (0xb, 1, 0), {F1, F3, F4, F2}, PSEUDO, 0, NULL},
+ {"fpms.s1", f, OpXaSf (0xb, 1, 1), {F1, F3, F4, F2}, EMPTY},
+ {"fpms.s2", f, OpXaSf (0xb, 1, 2), {F1, F3, F4, F2}, EMPTY},
+ {"fpms.s3", f, OpXaSf (0xb, 1, 3), {F1, F3, F4, F2}, EMPTY},
+
+ {"fnmpy.s0", f, OpXaSfF2 (0xc, 0, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnmpy", f, OpXaSfF2 (0xc, 0, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnmpy.s1", f, OpXaSfF2 (0xc, 0, 1, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnmpy.s2", f, OpXaSfF2 (0xc, 0, 2, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnmpy.s3", f, OpXaSfF2 (0xc, 0, 3, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnmpy.s.s0", f, OpXaSfF2 (0xc, 1, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnmpy.s", f, OpXaSfF2 (0xc, 1, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnmpy.s.s1", f, OpXaSfF2 (0xc, 1, 1, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnmpy.s.s2", f, OpXaSfF2 (0xc, 1, 2, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnmpy.s.s3", f, OpXaSfF2 (0xc, 1, 3, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnma.s0", f, OpXaSf (0xc, 0, 0), {F1, F3, F4, F2}, EMPTY},
+ {"fnma", f, OpXaSf (0xc, 0, 0), {F1, F3, F4, F2}, PSEUDO, 0, NULL},
+ {"fnma.s1", f, OpXaSf (0xc, 0, 1), {F1, F3, F4, F2}, EMPTY},
+ {"fnma.s2", f, OpXaSf (0xc, 0, 2), {F1, F3, F4, F2}, EMPTY},
+ {"fnma.s3", f, OpXaSf (0xc, 0, 3), {F1, F3, F4, F2}, EMPTY},
+ {"fnma.s.s0", f, OpXaSf (0xc, 1, 0), {F1, F3, F4, F2}, EMPTY},
+ {"fnma.s", f, OpXaSf (0xc, 1, 0), {F1, F3, F4, F2}, PSEUDO, 0, NULL},
+ {"fnma.s.s1", f, OpXaSf (0xc, 1, 1), {F1, F3, F4, F2}, EMPTY},
+ {"fnma.s.s2", f, OpXaSf (0xc, 1, 2), {F1, F3, F4, F2}, EMPTY},
+ {"fnma.s.s3", f, OpXaSf (0xc, 1, 3), {F1, F3, F4, F2}, EMPTY},
+ {"fnmpy.d.s0", f, OpXaSfF2 (0xd, 0, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnmpy.d", f, OpXaSfF2 (0xd, 0, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnmpy.d.s1", f, OpXaSfF2 (0xd, 0, 1, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnmpy.d.s2", f, OpXaSfF2 (0xd, 0, 2, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnmpy.d.s3", f, OpXaSfF2 (0xd, 0, 3, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fnma.d.s0", f, OpXaSf (0xd, 0, 0), {F1, F3, F4, F2}, EMPTY},
+ {"fnma.d", f, OpXaSf (0xd, 0, 0), {F1, F3, F4, F2}, PSEUDO, 0, NULL},
+ {"fnma.d.s1", f, OpXaSf (0xd, 0, 1), {F1, F3, F4, F2}, EMPTY},
+ {"fnma.d.s2", f, OpXaSf (0xd, 0, 2), {F1, F3, F4, F2}, EMPTY},
+ {"fnma.d.s3", f, OpXaSf (0xd, 0, 3), {F1, F3, F4, F2}, EMPTY},
+
+ {"fpnmpy.s0", f, OpXaSfF2 (0xd, 1, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fpnmpy", f, OpXaSfF2 (0xd, 1, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fpnmpy.s1", f, OpXaSfF2 (0xd, 1, 1, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fpnmpy.s2", f, OpXaSfF2 (0xd, 1, 2, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fpnmpy.s3", f, OpXaSfF2 (0xd, 1, 3, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"fpnma.s0", f, OpXaSf (0xd, 1, 0), {F1, F3, F4, F2}, EMPTY},
+ {"fpnma", f, OpXaSf (0xd, 1, 0), {F1, F3, F4, F2}, PSEUDO, 0, NULL},
+ {"fpnma.s1", f, OpXaSf (0xd, 1, 1), {F1, F3, F4, F2}, EMPTY},
+ {"fpnma.s2", f, OpXaSf (0xd, 1, 2), {F1, F3, F4, F2}, EMPTY},
+ {"fpnma.s3", f, OpXaSf (0xd, 1, 3), {F1, F3, F4, F2}, EMPTY},
+
+ {"xmpy.l", f, OpXaX2F2 (0xe, 1, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"xmpy.lu", f, OpXaX2F2 (0xe, 1, 0, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"xmpy.h", f, OpXaX2F2 (0xe, 1, 3, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"xmpy.hu", f, OpXaX2F2 (0xe, 1, 2, 0), {F1, F3, F4}, PSEUDO, 0, NULL},
+ {"xma.l", f, OpXaX2 (0xe, 1, 0), {F1, F3, F4, F2}, EMPTY},
+ {"xma.lu", f, OpXaX2 (0xe, 1, 0), {F1, F3, F4, F2}, PSEUDO, 0, NULL},
+ {"xma.h", f, OpXaX2 (0xe, 1, 3), {F1, F3, F4, F2}, EMPTY},
+ {"xma.hu", f, OpXaX2 (0xe, 1, 2), {F1, F3, F4, F2}, EMPTY},
+
+ {"fselect", f, OpXa (0xe, 0), {F1, F3, F4, F2}, EMPTY},
+
+ {NULL, 0, 0, 0, 0, {0}, 0, 0, NULL}
};
#undef f0
@@ -644,3 +648,4 @@ struct ia64_opcode ia64_opcodes_f[] =
#undef OpXbX6
#undef OpXbX6F2
#undef OpXbX6Sf
+#undef EMPTY
diff --git a/opcodes/ia64-opc-i.c b/opcodes/ia64-opc-i.c
index 899e65181ce..8de169611ef 100644
--- a/opcodes/ia64-opc-i.c
+++ b/opcodes/ia64-opc-i.c
@@ -1,5 +1,5 @@
/* ia64-opc-i.c -- IA-64 `I' opcode table.
- Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of GDB, GAS, and the GNU binutils.
@@ -93,17 +93,21 @@
(bOp (a) | bX3 (b) | bXb (c) | bIh (d) | bWh (e) | bTag13 (f)), \
(mOp | mX3 | mXb | mIh | mWh | mTag13)
+/* Used to initialise unused fields in ia64_opcode struct,
+ in order to stop gcc from complaining. */
+#define EMPTY 0,0,NULL
+
struct ia64_opcode ia64_opcodes_i[] =
{
- /* I-type instruction encodings (sorted according to major opcode) */
+ /* I-type instruction encodings (sorted according to major opcode). */
- {"break.i", I0, OpX3X6 (0, 0, 0x00), {IMMU21}, X_IN_MLX},
- {"nop.i", I0, OpX3X6 (0, 0, 0x01), {IMMU21}, X_IN_MLX},
- {"chk.s.i", I0, OpX3 (0, 1), {R2, TGT25b}},
+ {"break.i", I0, OpX3X6 (0, 0, 0x00), {IMMU21}, X_IN_MLX, 0, NULL},
+ {"nop.i", I0, OpX3X6 (0, 0, 0x01), {IMMU21}, X_IN_MLX, 0, NULL},
+ {"chk.s.i", I0, OpX3 (0, 1), {R2, TGT25b}, EMPTY},
- {"mov", I, OpX3XbIhWhTag13 (0, 7, 0, 0, 1, 0), {B1, R2}, PSEUDO},
+ {"mov", I, OpX3XbIhWhTag13 (0, 7, 0, 0, 1, 0), {B1, R2}, PSEUDO, 0, NULL},
#define MOV(a,b,c,d) \
- I, OpX3XbIhWh (0, a, b, c, d), {B1, R2, TAG13b}
+ I, OpX3XbIhWh (0, a, b, c, d), {B1, R2, TAG13b}, EMPTY
{"mov.sptk", MOV (7, 0, 0, 0)},
{"mov.sptk.imp", MOV (7, 0, 1, 0)},
{"mov", MOV (7, 0, 0, 1)},
@@ -117,46 +121,46 @@ struct ia64_opcode ia64_opcodes_i[] =
{"mov.ret.dptk", MOV (7, 1, 0, 2)},
{"mov.ret.dptk.imp", MOV (7, 1, 1, 2)},
#undef MOV
- {"mov", I, OpX3X6 (0, 0, 0x31), {R1, B2}},
- {"mov", I, OpX3 (0, 3), {PR, R2, IMM17}},
- {"mov", I, OpX3 (0, 2), {PR_ROT, IMM44}},
- {"mov", I, OpX3X6 (0, 0, 0x30), {R1, IP}},
- {"mov", I, OpX3X6 (0, 0, 0x33), {R1, PR}},
- {"mov.i", I, OpX3X6 (0, 0, 0x2a), {AR3, R2}},
- {"mov.i", I, OpX3X6 (0, 0, 0x0a), {AR3, IMM8}},
- {"mov.i", I, OpX3X6 (0, 0, 0x32), {R1, AR3}},
- {"zxt1", I, OpX3X6 (0, 0, 0x10), {R1, R3}},
- {"zxt2", I, OpX3X6 (0, 0, 0x11), {R1, R3}},
- {"zxt4", I, OpX3X6 (0, 0, 0x12), {R1, R3}},
- {"sxt1", I, OpX3X6 (0, 0, 0x14), {R1, R3}},
- {"sxt2", I, OpX3X6 (0, 0, 0x15), {R1, R3}},
- {"sxt4", I, OpX3X6 (0, 0, 0x16), {R1, R3}},
- {"czx1.l", I, OpX3X6 (0, 0, 0x18), {R1, R3}},
- {"czx2.l", I, OpX3X6 (0, 0, 0x19), {R1, R3}},
- {"czx1.r", I, OpX3X6 (0, 0, 0x1c), {R1, R3}},
- {"czx2.r", I, OpX3X6 (0, 0, 0x1d), {R1, R3}},
+ {"mov", I, OpX3X6 (0, 0, 0x31), {R1, B2}, EMPTY},
+ {"mov", I, OpX3 (0, 3), {PR, R2, IMM17}, EMPTY},
+ {"mov", I, OpX3 (0, 2), {PR_ROT, IMM44}, EMPTY},
+ {"mov", I, OpX3X6 (0, 0, 0x30), {R1, IP}, EMPTY},
+ {"mov", I, OpX3X6 (0, 0, 0x33), {R1, PR}, EMPTY},
+ {"mov.i", I, OpX3X6 (0, 0, 0x2a), {AR3, R2}, EMPTY},
+ {"mov.i", I, OpX3X6 (0, 0, 0x0a), {AR3, IMM8}, EMPTY},
+ {"mov.i", I, OpX3X6 (0, 0, 0x32), {R1, AR3}, EMPTY},
+ {"zxt1", I, OpX3X6 (0, 0, 0x10), {R1, R3}, EMPTY},
+ {"zxt2", I, OpX3X6 (0, 0, 0x11), {R1, R3}, EMPTY},
+ {"zxt4", I, OpX3X6 (0, 0, 0x12), {R1, R3}, EMPTY},
+ {"sxt1", I, OpX3X6 (0, 0, 0x14), {R1, R3}, EMPTY},
+ {"sxt2", I, OpX3X6 (0, 0, 0x15), {R1, R3}, EMPTY},
+ {"sxt4", I, OpX3X6 (0, 0, 0x16), {R1, R3}, EMPTY},
+ {"czx1.l", I, OpX3X6 (0, 0, 0x18), {R1, R3}, EMPTY},
+ {"czx2.l", I, OpX3X6 (0, 0, 0x19), {R1, R3}, EMPTY},
+ {"czx1.r", I, OpX3X6 (0, 0, 0x1c), {R1, R3}, EMPTY},
+ {"czx2.r", I, OpX3X6 (0, 0, 0x1d), {R1, R3}, EMPTY},
- {"dep", I, Op (4), {R1, R2, R3, CPOS6c, LEN4}},
+ {"dep", I, Op (4), {R1, R2, R3, CPOS6c, LEN4}, EMPTY},
- {"shrp", I, OpX2X (5, 3, 0), {R1, R2, R3, CNT6}},
+ {"shrp", I, OpX2X (5, 3, 0), {R1, R2, R3, CNT6}, EMPTY},
{"shr.u", I, OpX2XYa (5, 1, 0, 0), {R1, R3, POS6},
- PSEUDO | LEN_EQ_64MCNT},
- {"extr.u", I, OpX2XYa (5, 1, 0, 0), {R1, R3, POS6, LEN6}},
+ PSEUDO | LEN_EQ_64MCNT, 0, NULL},
+ {"extr.u", I, OpX2XYa (5, 1, 0, 0), {R1, R3, POS6, LEN6}, EMPTY},
{"shr", I, OpX2XYa (5, 1, 0, 1), {R1, R3, POS6},
- PSEUDO | LEN_EQ_64MCNT},
- {"extr", I, OpX2XYa (5, 1, 0, 1), {R1, R3, POS6, LEN6}},
+ PSEUDO | LEN_EQ_64MCNT, 0, NULL},
+ {"extr", I, OpX2XYa (5, 1, 0, 1), {R1, R3, POS6, LEN6}, EMPTY},
{"shl", I, OpX2XYb (5, 1, 1, 0), {R1, R2, CPOS6a},
- PSEUDO | LEN_EQ_64MCNT},
- {"dep.z", I, OpX2XYb (5, 1, 1, 0), {R1, R2, CPOS6a, LEN6}},
- {"dep.z", I, OpX2XYb (5, 1, 1, 1), {R1, IMM8, CPOS6a, LEN6}},
- {"dep", I, OpX2X (5, 3, 1), {R1, IMM1, R3, CPOS6b, LEN6}},
+ PSEUDO | LEN_EQ_64MCNT, 0, NULL},
+ {"dep.z", I, OpX2XYb (5, 1, 1, 0), {R1, R2, CPOS6a, LEN6}, EMPTY},
+ {"dep.z", I, OpX2XYb (5, 1, 1, 1), {R1, IMM8, CPOS6a, LEN6}, EMPTY},
+ {"dep", I, OpX2X (5, 3, 1), {R1, IMM1, R3, CPOS6b, LEN6}, EMPTY},
#define TBIT(a,b,c,d) \
- I2, OpX2TaTbYaC (5, 0, a, b, c, d), {P1, P2, R3, POS6}
+ I2, OpX2TaTbYaC (5, 0, a, b, c, d), {P1, P2, R3, POS6}, EMPTY
#define TBITCM(a,b,c,d) \
- I2, OpX2TaTbYaC (5, 0, a, b, c, d), {P2, P1, R3, POS6}, PSEUDO
+ I2, OpX2TaTbYaC (5, 0, a, b, c, d), {P2, P1, R3, POS6}, PSEUDO, 0, NULL
{"tbit.z", TBIT (0, 0, 0, 0)},
{"tbit.nz", TBITCM (0, 0, 0, 0)},
{"tbit.z.unc", TBIT (0, 0, 0, 1)},
@@ -175,9 +179,9 @@ struct ia64_opcode ia64_opcodes_i[] =
{"tbit.z.and.orcm", TBITCM (1, 1, 0, 1)},
#undef TBIT
#define TNAT(a,b,c,d) \
- I2, OpX2TaTbYaC (5, 0, a, b, c, d), {P1, P2, R3}
+ I2, OpX2TaTbYaC (5, 0, a, b, c, d), {P1, P2, R3}, EMPTY
#define TNATCM(a,b,c,d) \
- I2, OpX2TaTbYaC (5, 0, a, b, c, d), {P2, P1, R3}, PSEUDO
+ I2, OpX2TaTbYaC (5, 0, a, b, c, d), {P2, P1, R3}, PSEUDO, 0, NULL
{"tnat.z", TNAT (0, 0, 1, 0)},
{"tnat.nz", TNATCM (0, 0, 1, 0)},
{"tnat.z.unc", TNAT (0, 0, 1, 1)},
@@ -196,50 +200,50 @@ struct ia64_opcode ia64_opcodes_i[] =
{"tnat.z.and.orcm", TNATCM (1, 1, 1, 1)},
#undef TNAT
- {"pmpyshr2", I, OpZaZbVeX2aX2b (7, 0, 1, 0, 0, 3), {R1, R2, R3, CNT2c}},
- {"pmpyshr2.u", I, OpZaZbVeX2aX2b (7, 0, 1, 0, 0, 1), {R1, R2, R3, CNT2c}},
- {"pmpy2.r", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 1, 3), {R1, R2, R3}},
- {"pmpy2.l", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 3, 3), {R1, R2, R3}},
- {"mix1.r", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 0, 2), {R1, R2, R3}},
- {"mix2.r", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 0, 2), {R1, R2, R3}},
- {"mix4.r", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 0, 2), {R1, R2, R3}},
- {"mix1.l", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 2, 2), {R1, R2, R3}},
- {"mix2.l", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 2, 2), {R1, R2, R3}},
- {"mix4.l", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 2, 2), {R1, R2, R3}},
- {"pack2.uss", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 0, 0), {R1, R2, R3}},
- {"pack2.sss", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 2, 0), {R1, R2, R3}},
- {"pack4.sss", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 2, 0), {R1, R2, R3}},
- {"unpack1.h", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 0, 1), {R1, R2, R3}},
- {"unpack2.h", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 0, 1), {R1, R2, R3}},
- {"unpack4.h", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 0, 1), {R1, R2, R3}},
- {"unpack1.l", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 2, 1), {R1, R2, R3}},
- {"unpack2.l", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 2, 1), {R1, R2, R3}},
- {"unpack4.l", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 2, 1), {R1, R2, R3}},
- {"pmin1.u", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 1, 0), {R1, R2, R3}},
- {"pmax1.u", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 1, 1), {R1, R2, R3}},
- {"pmin2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 3, 0), {R1, R2, R3}},
- {"pmax2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 3, 1), {R1, R2, R3}},
- {"psad1", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 3, 2), {R1, R2, R3}},
- {"mux1", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 3, 2, 2), {R1, R2, MBTYPE4}},
- {"mux2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 3, 2, 2), {R1, R2, MHTYPE8}},
- {"pshr2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 0, 2, 0), {R1, R3, R2}},
- {"pshr4", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 0, 2, 0), {R1, R3, R2}},
- {"shr", I, OpZaZbVeX2aX2bX2c (7, 1, 1, 0, 0, 2, 0), {R1, R3, R2}},
- {"pshr2.u", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 0, 0, 0), {R1, R3, R2}},
- {"pshr4.u", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 0, 0, 0), {R1, R3, R2}},
- {"shr.u", I, OpZaZbVeX2aX2bX2c (7, 1, 1, 0, 0, 0, 0), {R1, R3, R2}},
- {"pshr2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 1, 3, 0), {R1, R3, CNT5}},
- {"pshr4", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 1, 3, 0), {R1, R3, CNT5}},
- {"pshr2.u", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 1, 1, 0), {R1, R3, CNT5}},
- {"pshr4.u", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 1, 1, 0), {R1, R3, CNT5}},
- {"pshl2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 0, 0, 1), {R1, R2, R3}},
- {"pshl4", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 0, 0, 1), {R1, R2, R3}},
- {"shl", I, OpZaZbVeX2aX2bX2c (7, 1, 1, 0, 0, 0, 1), {R1, R2, R3}},
- {"pshl2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 3, 1, 1), {R1, R2, CCNT5}},
- {"pshl4", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 3, 1, 1), {R1, R2, CCNT5}},
- {"popcnt", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 1, 1, 2), {R1, R3}},
+ {"pmpyshr2", I, OpZaZbVeX2aX2b (7, 0, 1, 0, 0, 3), {R1, R2, R3, CNT2c}, EMPTY},
+ {"pmpyshr2.u", I, OpZaZbVeX2aX2b (7, 0, 1, 0, 0, 1), {R1, R2, R3, CNT2c}, EMPTY},
+ {"pmpy2.r", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 1, 3), {R1, R2, R3}, EMPTY},
+ {"pmpy2.l", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 3, 3), {R1, R2, R3}, EMPTY},
+ {"mix1.r", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 0, 2), {R1, R2, R3}, EMPTY},
+ {"mix2.r", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 0, 2), {R1, R2, R3}, EMPTY},
+ {"mix4.r", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 0, 2), {R1, R2, R3}, EMPTY},
+ {"mix1.l", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 2, 2), {R1, R2, R3}, EMPTY},
+ {"mix2.l", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 2, 2), {R1, R2, R3}, EMPTY},
+ {"mix4.l", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 2, 2), {R1, R2, R3}, EMPTY},
+ {"pack2.uss", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 0, 0), {R1, R2, R3}, EMPTY},
+ {"pack2.sss", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 2, 0), {R1, R2, R3}, EMPTY},
+ {"pack4.sss", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 2, 0), {R1, R2, R3}, EMPTY},
+ {"unpack1.h", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 0, 1), {R1, R2, R3}, EMPTY},
+ {"unpack2.h", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 0, 1), {R1, R2, R3}, EMPTY},
+ {"unpack4.h", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 0, 1), {R1, R2, R3}, EMPTY},
+ {"unpack1.l", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 2, 1), {R1, R2, R3}, EMPTY},
+ {"unpack2.l", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 2, 1), {R1, R2, R3}, EMPTY},
+ {"unpack4.l", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 2, 1), {R1, R2, R3}, EMPTY},
+ {"pmin1.u", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 1, 0), {R1, R2, R3}, EMPTY},
+ {"pmax1.u", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 1, 1), {R1, R2, R3}, EMPTY},
+ {"pmin2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 3, 0), {R1, R2, R3}, EMPTY},
+ {"pmax2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 3, 1), {R1, R2, R3}, EMPTY},
+ {"psad1", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 3, 2), {R1, R2, R3}, EMPTY},
+ {"mux1", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 3, 2, 2), {R1, R2, MBTYPE4}, EMPTY},
+ {"mux2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 3, 2, 2), {R1, R2, MHTYPE8}, EMPTY},
+ {"pshr2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 0, 2, 0), {R1, R3, R2}, EMPTY},
+ {"pshr4", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 0, 2, 0), {R1, R3, R2}, EMPTY},
+ {"shr", I, OpZaZbVeX2aX2bX2c (7, 1, 1, 0, 0, 2, 0), {R1, R3, R2}, EMPTY},
+ {"pshr2.u", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 0, 0, 0), {R1, R3, R2}, EMPTY},
+ {"pshr4.u", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 0, 0, 0), {R1, R3, R2}, EMPTY},
+ {"shr.u", I, OpZaZbVeX2aX2bX2c (7, 1, 1, 0, 0, 0, 0), {R1, R3, R2}, EMPTY},
+ {"pshr2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 1, 3, 0), {R1, R3, CNT5}, EMPTY},
+ {"pshr4", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 1, 3, 0), {R1, R3, CNT5}, EMPTY},
+ {"pshr2.u", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 1, 1, 0), {R1, R3, CNT5}, EMPTY},
+ {"pshr4.u", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 1, 1, 0), {R1, R3, CNT5}, EMPTY},
+ {"pshl2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 0, 0, 1), {R1, R2, R3}, EMPTY},
+ {"pshl4", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 0, 0, 1), {R1, R2, R3}, EMPTY},
+ {"shl", I, OpZaZbVeX2aX2bX2c (7, 1, 1, 0, 0, 0, 1), {R1, R2, R3}, EMPTY},
+ {"pshl2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 3, 1, 1), {R1, R2, CCNT5}, EMPTY},
+ {"pshl4", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 3, 1, 1), {R1, R2, CCNT5}, EMPTY},
+ {"popcnt", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 1, 1, 2), {R1, R3}, EMPTY},
- {0}
+ {NULL, 0, 0, 0, 0, {0}, 0, 0, NULL}
};
#undef I0
@@ -294,3 +298,4 @@ struct ia64_opcode ia64_opcodes_i[] =
#undef OpX3X6
#undef OpX3XbIhWh
#undef OpX3XbIhWhTag13
+#undef EMPTY
diff --git a/opcodes/ia64-opc-m.c b/opcodes/ia64-opc-m.c
index bc098160a4b..ba59d1dc4d2 100644
--- a/opcodes/ia64-opc-m.c
+++ b/opcodes/ia64-opc-m.c
@@ -1,5 +1,5 @@
/* ia64-opc-m.c -- IA-64 `M' opcode table.
- Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of GDB, GAS, and the GNU binutils.
@@ -61,208 +61,212 @@
(bOp (a) | bM (b) | bX (c) | bX6a (d) | bHint (e)), \
(mOp | mM | mX | mX6a | mHint)
+/* Used to initialise unused fields in ia64_opcode struct,
+ in order to stop gcc from complaining. */
+#define EMPTY 0,0,NULL
+
struct ia64_opcode ia64_opcodes_m[] =
{
- /* M-type instruction encodings (sorted according to major opcode) */
+ /* M-type instruction encodings (sorted according to major opcode). */
- {"chk.a.nc", M0, OpX3 (0, 4), {R1, TGT25c}},
- {"chk.a.clr", M0, OpX3 (0, 5), {R1, TGT25c}},
- {"chk.a.nc", M0, OpX3 (0, 6), {F1, TGT25c}},
- {"chk.a.clr", M0, OpX3 (0, 7), {F1, TGT25c}},
+ {"chk.a.nc", M0, OpX3 (0, 4), {R1, TGT25c}, EMPTY},
+ {"chk.a.clr", M0, OpX3 (0, 5), {R1, TGT25c}, EMPTY},
+ {"chk.a.nc", M0, OpX3 (0, 6), {F1, TGT25c}, EMPTY},
+ {"chk.a.clr", M0, OpX3 (0, 7), {F1, TGT25c}, EMPTY},
- {"invala", M0, OpX3X4X2 (0, 0, 0, 1)},
- {"fwb", M0, OpX3X4X2 (0, 0, 0, 2)},
- {"mf", M0, OpX3X4X2 (0, 0, 2, 2)},
- {"mf.a", M0, OpX3X4X2 (0, 0, 3, 2)},
- {"srlz.d", M0, OpX3X4X2 (0, 0, 0, 3)},
- {"srlz.i", M0, OpX3X4X2 (0, 0, 1, 3)},
- {"sync.i", M0, OpX3X4X2 (0, 0, 3, 3)},
- {"flushrs", M0, OpX3X4X2 (0, 0, 0xc, 0), {0, }, FIRST | NO_PRED},
- {"loadrs", M0, OpX3X4X2 (0, 0, 0xa, 0), {0, }, FIRST | NO_PRED},
- {"invala.e", M0, OpX3X4X2 (0, 0, 2, 1), {R1}},
- {"invala.e", M0, OpX3X4X2 (0, 0, 3, 1), {F1}},
- {"mov.m", M, OpX3X4X2 (0, 0, 8, 2), {AR3, IMM8}},
+ {"invala", M0, OpX3X4X2 (0, 0, 0, 1), {}, EMPTY},
+ {"fwb", M0, OpX3X4X2 (0, 0, 0, 2), {}, EMPTY},
+ {"mf", M0, OpX3X4X2 (0, 0, 2, 2), {}, EMPTY},
+ {"mf.a", M0, OpX3X4X2 (0, 0, 3, 2), {}, EMPTY},
+ {"srlz.d", M0, OpX3X4X2 (0, 0, 0, 3), {}, EMPTY},
+ {"srlz.i", M0, OpX3X4X2 (0, 0, 1, 3), {}, EMPTY},
+ {"sync.i", M0, OpX3X4X2 (0, 0, 3, 3), {}, EMPTY},
+ {"flushrs", M0, OpX3X4X2 (0, 0, 0xc, 0), {}, FIRST | NO_PRED, 0, NULL},
+ {"loadrs", M0, OpX3X4X2 (0, 0, 0xa, 0), {}, FIRST | NO_PRED, 0, NULL},
+ {"invala.e", M0, OpX3X4X2 (0, 0, 2, 1), {R1}, EMPTY},
+ {"invala.e", M0, OpX3X4X2 (0, 0, 3, 1), {F1}, EMPTY},
+ {"mov.m", M, OpX3X4X2 (0, 0, 8, 2), {AR3, IMM8}, EMPTY},
- {"break.m", M0, OpX3X4X2 (0, 0, 0, 0), {IMMU21}},
- {"nop.m", M0, OpX3X4X2 (0, 0, 1, 0), {IMMU21}},
+ {"break.m", M0, OpX3X4X2 (0, 0, 0, 0), {IMMU21}, EMPTY},
+ {"nop.m", M0, OpX3X4X2 (0, 0, 1, 0), {IMMU21}, EMPTY},
- {"sum", M0, OpX3X4 (0, 0, 4), {IMMU24}},
- {"rum", M0, OpX3X4 (0, 0, 5), {IMMU24}},
- {"ssm", M0, OpX3X4 (0, 0, 6), {IMMU24}, PRIV},
- {"rsm", M0, OpX3X4 (0, 0, 7), {IMMU24}, PRIV},
+ {"sum", M0, OpX3X4 (0, 0, 4), {IMMU24}, EMPTY},
+ {"rum", M0, OpX3X4 (0, 0, 5), {IMMU24}, EMPTY},
+ {"ssm", M0, OpX3X4 (0, 0, 6), {IMMU24}, PRIV, 0, NULL},
+ {"rsm", M0, OpX3X4 (0, 0, 7), {IMMU24}, PRIV, 0, NULL},
- {"mov.m", M, OpX3X6b (1, 0, 0x2a), {AR3, R2}},
- {"mov.m", M, OpX3X6b (1, 0, 0x22), {R1, AR3}},
- {"mov", M, OpX3X6b (1, 0, 0x2c), {CR3, R2}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x24), {R1, CR3}, PRIV},
+ {"mov.m", M, OpX3X6b (1, 0, 0x2a), {AR3, R2}, EMPTY},
+ {"mov.m", M, OpX3X6b (1, 0, 0x22), {R1, AR3}, EMPTY},
+ {"mov", M, OpX3X6b (1, 0, 0x2c), {CR3, R2}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x24), {R1, CR3}, PRIV, 0, NULL},
- {"alloc", M, OpX3 (1, 6), {R1, AR_PFS, SOF, SOL, SOR}, FIRST|NO_PRED|MOD_RRBS},
+ {"alloc", M, OpX3 (1, 6), {R1, AR_PFS, SOF, SOL, SOR}, FIRST|NO_PRED|MOD_RRBS, 0, NULL},
- {"mov", M, OpX3X6b (1, 0, 0x2d), {PSR_L, R2}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x29), {PSR_UM, R2}},
- {"mov", M, OpX3X6b (1, 0, 0x25), {R1, PSR}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x21), {R1, PSR_UM}},
- {"probe.r", M, OpX3X6b (1, 0, 0x38), {R1, R3, R2}},
- {"probe.w", M, OpX3X6b (1, 0, 0x39), {R1, R3, R2}},
- {"probe.r", M, OpX3X6b (1, 0, 0x18), {R1, R3, IMMU2}},
- {"probe.w", M, OpX3X6b (1, 0, 0x19), {R1, R3, IMMU2}},
- {"probe.rw.fault", M0, OpX3X6b (1, 0, 0x31), {R3, IMMU2}},
- {"probe.r.fault", M0, OpX3X6b (1, 0, 0x32), {R3, IMMU2}},
- {"probe.w.fault", M0, OpX3X6b (1, 0, 0x33), {R3, IMMU2}},
- {"itc.d", M0, OpX3X6b (1, 0, 0x2e), {R2}, LAST | PRIV},
- {"itc.i", M0, OpX3X6b (1, 0, 0x2f), {R2}, LAST | PRIV},
+ {"mov", M, OpX3X6b (1, 0, 0x2d), {PSR_L, R2}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x29), {PSR_UM, R2}, EMPTY},
+ {"mov", M, OpX3X6b (1, 0, 0x25), {R1, PSR}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x21), {R1, PSR_UM}, EMPTY},
+ {"probe.r", M, OpX3X6b (1, 0, 0x38), {R1, R3, R2}, EMPTY},
+ {"probe.w", M, OpX3X6b (1, 0, 0x39), {R1, R3, R2}, EMPTY},
+ {"probe.r", M, OpX3X6b (1, 0, 0x18), {R1, R3, IMMU2}, EMPTY},
+ {"probe.w", M, OpX3X6b (1, 0, 0x19), {R1, R3, IMMU2}, EMPTY},
+ {"probe.rw.fault", M0, OpX3X6b (1, 0, 0x31), {R3, IMMU2}, EMPTY},
+ {"probe.r.fault", M0, OpX3X6b (1, 0, 0x32), {R3, IMMU2}, EMPTY},
+ {"probe.w.fault", M0, OpX3X6b (1, 0, 0x33), {R3, IMMU2}, EMPTY},
+ {"itc.d", M0, OpX3X6b (1, 0, 0x2e), {R2}, LAST | PRIV, 0, NULL},
+ {"itc.i", M0, OpX3X6b (1, 0, 0x2f), {R2}, LAST | PRIV, 0, NULL},
- {"mov", M, OpX3X6b (1, 0, 0x00), {RR_R3, R2}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x01), {DBR_R3, R2}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x02), {IBR_R3, R2}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x03), {PKR_R3, R2}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x04), {PMC_R3, R2}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x05), {PMD_R3, R2}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x06), {MSR_R3, R2}, PRIV},
- {"itr.d", M, OpX3X6b (1, 0, 0x0e), {DTR_R3, R2}, PRIV},
- {"itr.i", M, OpX3X6b (1, 0, 0x0f), {ITR_R3, R2}, PRIV},
+ {"mov", M, OpX3X6b (1, 0, 0x00), {RR_R3, R2}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x01), {DBR_R3, R2}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x02), {IBR_R3, R2}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x03), {PKR_R3, R2}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x04), {PMC_R3, R2}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x05), {PMD_R3, R2}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x06), {MSR_R3, R2}, PRIV, 0, NULL},
+ {"itr.d", M, OpX3X6b (1, 0, 0x0e), {DTR_R3, R2}, PRIV, 0, NULL},
+ {"itr.i", M, OpX3X6b (1, 0, 0x0f), {ITR_R3, R2}, PRIV, 0, NULL},
- {"mov", M, OpX3X6b (1, 0, 0x10), {R1, RR_R3}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x11), {R1, DBR_R3}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x12), {R1, IBR_R3}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x13), {R1, PKR_R3}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x14), {R1, PMC_R3}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x15), {R1, PMD_R3}},
- {"mov", M, OpX3X6b (1, 0, 0x16), {R1, MSR_R3}, PRIV},
- {"mov", M, OpX3X6b (1, 0, 0x17), {R1, CPUID_R3}},
+ {"mov", M, OpX3X6b (1, 0, 0x10), {R1, RR_R3}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x11), {R1, DBR_R3}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x12), {R1, IBR_R3}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x13), {R1, PKR_R3}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x14), {R1, PMC_R3}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x15), {R1, PMD_R3}, EMPTY},
+ {"mov", M, OpX3X6b (1, 0, 0x16), {R1, MSR_R3}, PRIV, 0, NULL},
+ {"mov", M, OpX3X6b (1, 0, 0x17), {R1, CPUID_R3}, EMPTY},
- {"ptc.l", M0, OpX3X6b (1, 0, 0x09), {R3, R2}, PRIV},
- {"ptc.g", M0, OpX3X6b (1, 0, 0x0a), {R3, R2}, LAST | PRIV},
- {"ptc.ga", M0, OpX3X6b (1, 0, 0x0b), {R3, R2}, LAST | PRIV},
- {"ptr.d", M0, OpX3X6b (1, 0, 0x0c), {R3, R2}, PRIV},
- {"ptr.i", M0, OpX3X6b (1, 0, 0x0d), {R3, R2}, PRIV},
+ {"ptc.l", M0, OpX3X6b (1, 0, 0x09), {R3, R2}, PRIV, 0, NULL},
+ {"ptc.g", M0, OpX3X6b (1, 0, 0x0a), {R3, R2}, LAST | PRIV, 0, NULL},
+ {"ptc.ga", M0, OpX3X6b (1, 0, 0x0b), {R3, R2}, LAST | PRIV, 0, NULL},
+ {"ptr.d", M0, OpX3X6b (1, 0, 0x0c), {R3, R2}, PRIV, 0, NULL},
+ {"ptr.i", M0, OpX3X6b (1, 0, 0x0d), {R3, R2}, PRIV, 0, NULL},
- {"thash", M, OpX3X6b (1, 0, 0x1a), {R1, R3}},
- {"ttag", M, OpX3X6b (1, 0, 0x1b), {R1, R3}},
- {"tpa", M, OpX3X6b (1, 0, 0x1e), {R1, R3}, PRIV},
- {"tak", M, OpX3X6b (1, 0, 0x1f), {R1, R3}, PRIV},
+ {"thash", M, OpX3X6b (1, 0, 0x1a), {R1, R3}, EMPTY},
+ {"ttag", M, OpX3X6b (1, 0, 0x1b), {R1, R3}, EMPTY},
+ {"tpa", M, OpX3X6b (1, 0, 0x1e), {R1, R3}, PRIV, 0, NULL},
+ {"tak", M, OpX3X6b (1, 0, 0x1f), {R1, R3}, PRIV, 0, NULL},
- {"chk.s.m", M0, OpX3 (1, 1), {R2, TGT25b}},
- {"chk.s", M0, OpX3 (1, 3), {F2, TGT25b}},
+ {"chk.s.m", M0, OpX3 (1, 1), {R2, TGT25b}, EMPTY},
+ {"chk.s", M0, OpX3 (1, 3), {F2, TGT25b}, EMPTY},
- {"fc", M0, OpX3X6b (1, 0, 0x30), {R3}},
- {"ptc.e", M0, OpX3X6b (1, 0, 0x34), {R3}, PRIV},
+ {"fc", M0, OpX3X6b (1, 0, 0x30), {R3}, EMPTY},
+ {"ptc.e", M0, OpX3X6b (1, 0, 0x34), {R3}, PRIV, 0, NULL},
/* integer load */
- {"ld1", M, OpMXX6aHint (4, 0, 0, 0x00, 0), {R1, MR3}},
- {"ld1.nt1", M, OpMXX6aHint (4, 0, 0, 0x00, 1), {R1, MR3}},
- {"ld1.nta", M, OpMXX6aHint (4, 0, 0, 0x00, 3), {R1, MR3}},
- {"ld2", M, OpMXX6aHint (4, 0, 0, 0x01, 0), {R1, MR3}},
- {"ld2.nt1", M, OpMXX6aHint (4, 0, 0, 0x01, 1), {R1, MR3}},
- {"ld2.nta", M, OpMXX6aHint (4, 0, 0, 0x01, 3), {R1, MR3}},
- {"ld4", M, OpMXX6aHint (4, 0, 0, 0x02, 0), {R1, MR3}},
- {"ld4.nt1", M, OpMXX6aHint (4, 0, 0, 0x02, 1), {R1, MR3}},
- {"ld4.nta", M, OpMXX6aHint (4, 0, 0, 0x02, 3), {R1, MR3}},
- {"ld8", M, OpMXX6aHint (4, 0, 0, 0x03, 0), {R1, MR3}},
- {"ld8.nt1", M, OpMXX6aHint (4, 0, 0, 0x03, 1), {R1, MR3}},
- {"ld8.nta", M, OpMXX6aHint (4, 0, 0, 0x03, 3), {R1, MR3}},
- {"ld1.s", M, OpMXX6aHint (4, 0, 0, 0x04, 0), {R1, MR3}},
- {"ld1.s.nt1", M, OpMXX6aHint (4, 0, 0, 0x04, 1), {R1, MR3}},
- {"ld1.s.nta", M, OpMXX6aHint (4, 0, 0, 0x04, 3), {R1, MR3}},
- {"ld2.s", M, OpMXX6aHint (4, 0, 0, 0x05, 0), {R1, MR3}},
- {"ld2.s.nt1", M, OpMXX6aHint (4, 0, 0, 0x05, 1), {R1, MR3}},
- {"ld2.s.nta", M, OpMXX6aHint (4, 0, 0, 0x05, 3), {R1, MR3}},
- {"ld4.s", M, OpMXX6aHint (4, 0, 0, 0x06, 0), {R1, MR3}},
- {"ld4.s.nt1", M, OpMXX6aHint (4, 0, 0, 0x06, 1), {R1, MR3}},
- {"ld4.s.nta", M, OpMXX6aHint (4, 0, 0, 0x06, 3), {R1, MR3}},
- {"ld8.s", M, OpMXX6aHint (4, 0, 0, 0x07, 0), {R1, MR3}},
- {"ld8.s.nt1", M, OpMXX6aHint (4, 0, 0, 0x07, 1), {R1, MR3}},
- {"ld8.s.nta", M, OpMXX6aHint (4, 0, 0, 0x07, 3), {R1, MR3}},
- {"ld1.a", M, OpMXX6aHint (4, 0, 0, 0x08, 0), {R1, MR3}},
- {"ld1.a.nt1", M, OpMXX6aHint (4, 0, 0, 0x08, 1), {R1, MR3}},
- {"ld1.a.nta", M, OpMXX6aHint (4, 0, 0, 0x08, 3), {R1, MR3}},
- {"ld2.a", M, OpMXX6aHint (4, 0, 0, 0x09, 0), {R1, MR3}},
- {"ld2.a.nt1", M, OpMXX6aHint (4, 0, 0, 0x09, 1), {R1, MR3}},
- {"ld2.a.nta", M, OpMXX6aHint (4, 0, 0, 0x09, 3), {R1, MR3}},
- {"ld4.a", M, OpMXX6aHint (4, 0, 0, 0x0a, 0), {R1, MR3}},
- {"ld4.a.nt1", M, OpMXX6aHint (4, 0, 0, 0x0a, 1), {R1, MR3}},
- {"ld4.a.nta", M, OpMXX6aHint (4, 0, 0, 0x0a, 3), {R1, MR3}},
- {"ld8.a", M, OpMXX6aHint (4, 0, 0, 0x0b, 0), {R1, MR3}},
- {"ld8.a.nt1", M, OpMXX6aHint (4, 0, 0, 0x0b, 1), {R1, MR3}},
- {"ld8.a.nta", M, OpMXX6aHint (4, 0, 0, 0x0b, 3), {R1, MR3}},
- {"ld1.sa", M, OpMXX6aHint (4, 0, 0, 0x0c, 0), {R1, MR3}},
- {"ld1.sa.nt1", M, OpMXX6aHint (4, 0, 0, 0x0c, 1), {R1, MR3}},
- {"ld1.sa.nta", M, OpMXX6aHint (4, 0, 0, 0x0c, 3), {R1, MR3}},
- {"ld2.sa", M, OpMXX6aHint (4, 0, 0, 0x0d, 0), {R1, MR3}},
- {"ld2.sa.nt1", M, OpMXX6aHint (4, 0, 0, 0x0d, 1), {R1, MR3}},
- {"ld2.sa.nta", M, OpMXX6aHint (4, 0, 0, 0x0d, 3), {R1, MR3}},
- {"ld4.sa", M, OpMXX6aHint (4, 0, 0, 0x0e, 0), {R1, MR3}},
- {"ld4.sa.nt1", M, OpMXX6aHint (4, 0, 0, 0x0e, 1), {R1, MR3}},
- {"ld4.sa.nta", M, OpMXX6aHint (4, 0, 0, 0x0e, 3), {R1, MR3}},
- {"ld8.sa", M, OpMXX6aHint (4, 0, 0, 0x0f, 0), {R1, MR3}},
- {"ld8.sa.nt1", M, OpMXX6aHint (4, 0, 0, 0x0f, 1), {R1, MR3}},
- {"ld8.sa.nta", M, OpMXX6aHint (4, 0, 0, 0x0f, 3), {R1, MR3}},
- {"ld1.bias", M, OpMXX6aHint (4, 0, 0, 0x10, 0), {R1, MR3}},
- {"ld1.bias.nt1", M, OpMXX6aHint (4, 0, 0, 0x10, 1), {R1, MR3}},
- {"ld1.bias.nta", M, OpMXX6aHint (4, 0, 0, 0x10, 3), {R1, MR3}},
- {"ld2.bias", M, OpMXX6aHint (4, 0, 0, 0x11, 0), {R1, MR3}},
- {"ld2.bias.nt1", M, OpMXX6aHint (4, 0, 0, 0x11, 1), {R1, MR3}},
- {"ld2.bias.nta", M, OpMXX6aHint (4, 0, 0, 0x11, 3), {R1, MR3}},
- {"ld4.bias", M, OpMXX6aHint (4, 0, 0, 0x12, 0), {R1, MR3}},
- {"ld4.bias.nt1", M, OpMXX6aHint (4, 0, 0, 0x12, 1), {R1, MR3}},
- {"ld4.bias.nta", M, OpMXX6aHint (4, 0, 0, 0x12, 3), {R1, MR3}},
- {"ld8.bias", M, OpMXX6aHint (4, 0, 0, 0x13, 0), {R1, MR3}},
- {"ld8.bias.nt1", M, OpMXX6aHint (4, 0, 0, 0x13, 1), {R1, MR3}},
- {"ld8.bias.nta", M, OpMXX6aHint (4, 0, 0, 0x13, 3), {R1, MR3}},
- {"ld1.acq", M, OpMXX6aHint (4, 0, 0, 0x14, 0), {R1, MR3}},
- {"ld1.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x14, 1), {R1, MR3}},
- {"ld1.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x14, 3), {R1, MR3}},
- {"ld2.acq", M, OpMXX6aHint (4, 0, 0, 0x15, 0), {R1, MR3}},
- {"ld2.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x15, 1), {R1, MR3}},
- {"ld2.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x15, 3), {R1, MR3}},
- {"ld4.acq", M, OpMXX6aHint (4, 0, 0, 0x16, 0), {R1, MR3}},
- {"ld4.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x16, 1), {R1, MR3}},
- {"ld4.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x16, 3), {R1, MR3}},
- {"ld8.acq", M, OpMXX6aHint (4, 0, 0, 0x17, 0), {R1, MR3}},
- {"ld8.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x17, 1), {R1, MR3}},
- {"ld8.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x17, 3), {R1, MR3}},
- {"ld8.fill", M, OpMXX6aHint (4, 0, 0, 0x1b, 0), {R1, MR3}},
- {"ld8.fill.nt1", M, OpMXX6aHint (4, 0, 0, 0x1b, 1), {R1, MR3}},
- {"ld8.fill.nta", M, OpMXX6aHint (4, 0, 0, 0x1b, 3), {R1, MR3}},
- {"ld1.c.clr", M, OpMXX6aHint (4, 0, 0, 0x20, 0), {R1, MR3}},
- {"ld1.c.clr.nt1", M, OpMXX6aHint (4, 0, 0, 0x20, 1), {R1, MR3}},
- {"ld1.c.clr.nta", M, OpMXX6aHint (4, 0, 0, 0x20, 3), {R1, MR3}},
- {"ld2.c.clr", M, OpMXX6aHint (4, 0, 0, 0x21, 0), {R1, MR3}},
- {"ld2.c.clr.nt1", M, OpMXX6aHint (4, 0, 0, 0x21, 1), {R1, MR3}},
- {"ld2.c.clr.nta", M, OpMXX6aHint (4, 0, 0, 0x21, 3), {R1, MR3}},
- {"ld4.c.clr", M, OpMXX6aHint (4, 0, 0, 0x22, 0), {R1, MR3}},
- {"ld4.c.clr.nt1", M, OpMXX6aHint (4, 0, 0, 0x22, 1), {R1, MR3}},
- {"ld4.c.clr.nta", M, OpMXX6aHint (4, 0, 0, 0x22, 3), {R1, MR3}},
- {"ld8.c.clr", M, OpMXX6aHint (4, 0, 0, 0x23, 0), {R1, MR3}},
- {"ld8.c.clr.nt1", M, OpMXX6aHint (4, 0, 0, 0x23, 1), {R1, MR3}},
- {"ld8.c.clr.nta", M, OpMXX6aHint (4, 0, 0, 0x23, 3), {R1, MR3}},
- {"ld1.c.nc", M, OpMXX6aHint (4, 0, 0, 0x24, 0), {R1, MR3}},
- {"ld1.c.nc.nt1", M, OpMXX6aHint (4, 0, 0, 0x24, 1), {R1, MR3}},
- {"ld1.c.nc.nta", M, OpMXX6aHint (4, 0, 0, 0x24, 3), {R1, MR3}},
- {"ld2.c.nc", M, OpMXX6aHint (4, 0, 0, 0x25, 0), {R1, MR3}},
- {"ld2.c.nc.nt1", M, OpMXX6aHint (4, 0, 0, 0x25, 1), {R1, MR3}},
- {"ld2.c.nc.nta", M, OpMXX6aHint (4, 0, 0, 0x25, 3), {R1, MR3}},
- {"ld4.c.nc", M, OpMXX6aHint (4, 0, 0, 0x26, 0), {R1, MR3}},
- {"ld4.c.nc.nt1", M, OpMXX6aHint (4, 0, 0, 0x26, 1), {R1, MR3}},
- {"ld4.c.nc.nta", M, OpMXX6aHint (4, 0, 0, 0x26, 3), {R1, MR3}},
- {"ld8.c.nc", M, OpMXX6aHint (4, 0, 0, 0x27, 0), {R1, MR3}},
- {"ld8.c.nc.nt1", M, OpMXX6aHint (4, 0, 0, 0x27, 1), {R1, MR3}},
- {"ld8.c.nc.nta", M, OpMXX6aHint (4, 0, 0, 0x27, 3), {R1, MR3}},
- {"ld1.c.clr.acq", M, OpMXX6aHint (4, 0, 0, 0x28, 0), {R1, MR3}},
- {"ld1.c.clr.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x28, 1), {R1, MR3}},
- {"ld1.c.clr.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x28, 3), {R1, MR3}},
- {"ld2.c.clr.acq", M, OpMXX6aHint (4, 0, 0, 0x29, 0), {R1, MR3}},
- {"ld2.c.clr.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x29, 1), {R1, MR3}},
- {"ld2.c.clr.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x29, 3), {R1, MR3}},
- {"ld4.c.clr.acq", M, OpMXX6aHint (4, 0, 0, 0x2a, 0), {R1, MR3}},
- {"ld4.c.clr.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x2a, 1), {R1, MR3}},
- {"ld4.c.clr.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x2a, 3), {R1, MR3}},
- {"ld8.c.clr.acq", M, OpMXX6aHint (4, 0, 0, 0x2b, 0), {R1, MR3}},
- {"ld8.c.clr.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x2b, 1), {R1, MR3}},
- {"ld8.c.clr.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x2b, 3), {R1, MR3}},
+ {"ld1", M, OpMXX6aHint (4, 0, 0, 0x00, 0), {R1, MR3}, EMPTY},
+ {"ld1.nt1", M, OpMXX6aHint (4, 0, 0, 0x00, 1), {R1, MR3}, EMPTY},
+ {"ld1.nta", M, OpMXX6aHint (4, 0, 0, 0x00, 3), {R1, MR3}, EMPTY},
+ {"ld2", M, OpMXX6aHint (4, 0, 0, 0x01, 0), {R1, MR3}, EMPTY},
+ {"ld2.nt1", M, OpMXX6aHint (4, 0, 0, 0x01, 1), {R1, MR3}, EMPTY},
+ {"ld2.nta", M, OpMXX6aHint (4, 0, 0, 0x01, 3), {R1, MR3}, EMPTY},
+ {"ld4", M, OpMXX6aHint (4, 0, 0, 0x02, 0), {R1, MR3}, EMPTY},
+ {"ld4.nt1", M, OpMXX6aHint (4, 0, 0, 0x02, 1), {R1, MR3}, EMPTY},
+ {"ld4.nta", M, OpMXX6aHint (4, 0, 0, 0x02, 3), {R1, MR3}, EMPTY},
+ {"ld8", M, OpMXX6aHint (4, 0, 0, 0x03, 0), {R1, MR3}, EMPTY},
+ {"ld8.nt1", M, OpMXX6aHint (4, 0, 0, 0x03, 1), {R1, MR3}, EMPTY},
+ {"ld8.nta", M, OpMXX6aHint (4, 0, 0, 0x03, 3), {R1, MR3}, EMPTY},
+ {"ld1.s", M, OpMXX6aHint (4, 0, 0, 0x04, 0), {R1, MR3}, EMPTY},
+ {"ld1.s.nt1", M, OpMXX6aHint (4, 0, 0, 0x04, 1), {R1, MR3}, EMPTY},
+ {"ld1.s.nta", M, OpMXX6aHint (4, 0, 0, 0x04, 3), {R1, MR3}, EMPTY},
+ {"ld2.s", M, OpMXX6aHint (4, 0, 0, 0x05, 0), {R1, MR3}, EMPTY},
+ {"ld2.s.nt1", M, OpMXX6aHint (4, 0, 0, 0x05, 1), {R1, MR3}, EMPTY},
+ {"ld2.s.nta", M, OpMXX6aHint (4, 0, 0, 0x05, 3), {R1, MR3}, EMPTY},
+ {"ld4.s", M, OpMXX6aHint (4, 0, 0, 0x06, 0), {R1, MR3}, EMPTY},
+ {"ld4.s.nt1", M, OpMXX6aHint (4, 0, 0, 0x06, 1), {R1, MR3}, EMPTY},
+ {"ld4.s.nta", M, OpMXX6aHint (4, 0, 0, 0x06, 3), {R1, MR3}, EMPTY},
+ {"ld8.s", M, OpMXX6aHint (4, 0, 0, 0x07, 0), {R1, MR3}, EMPTY},
+ {"ld8.s.nt1", M, OpMXX6aHint (4, 0, 0, 0x07, 1), {R1, MR3}, EMPTY},
+ {"ld8.s.nta", M, OpMXX6aHint (4, 0, 0, 0x07, 3), {R1, MR3}, EMPTY},
+ {"ld1.a", M, OpMXX6aHint (4, 0, 0, 0x08, 0), {R1, MR3}, EMPTY},
+ {"ld1.a.nt1", M, OpMXX6aHint (4, 0, 0, 0x08, 1), {R1, MR3}, EMPTY},
+ {"ld1.a.nta", M, OpMXX6aHint (4, 0, 0, 0x08, 3), {R1, MR3}, EMPTY},
+ {"ld2.a", M, OpMXX6aHint (4, 0, 0, 0x09, 0), {R1, MR3}, EMPTY},
+ {"ld2.a.nt1", M, OpMXX6aHint (4, 0, 0, 0x09, 1), {R1, MR3}, EMPTY},
+ {"ld2.a.nta", M, OpMXX6aHint (4, 0, 0, 0x09, 3), {R1, MR3}, EMPTY},
+ {"ld4.a", M, OpMXX6aHint (4, 0, 0, 0x0a, 0), {R1, MR3}, EMPTY},
+ {"ld4.a.nt1", M, OpMXX6aHint (4, 0, 0, 0x0a, 1), {R1, MR3}, EMPTY},
+ {"ld4.a.nta", M, OpMXX6aHint (4, 0, 0, 0x0a, 3), {R1, MR3}, EMPTY},
+ {"ld8.a", M, OpMXX6aHint (4, 0, 0, 0x0b, 0), {R1, MR3}, EMPTY},
+ {"ld8.a.nt1", M, OpMXX6aHint (4, 0, 0, 0x0b, 1), {R1, MR3}, EMPTY},
+ {"ld8.a.nta", M, OpMXX6aHint (4, 0, 0, 0x0b, 3), {R1, MR3}, EMPTY},
+ {"ld1.sa", M, OpMXX6aHint (4, 0, 0, 0x0c, 0), {R1, MR3}, EMPTY},
+ {"ld1.sa.nt1", M, OpMXX6aHint (4, 0, 0, 0x0c, 1), {R1, MR3}, EMPTY},
+ {"ld1.sa.nta", M, OpMXX6aHint (4, 0, 0, 0x0c, 3), {R1, MR3}, EMPTY},
+ {"ld2.sa", M, OpMXX6aHint (4, 0, 0, 0x0d, 0), {R1, MR3}, EMPTY},
+ {"ld2.sa.nt1", M, OpMXX6aHint (4, 0, 0, 0x0d, 1), {R1, MR3}, EMPTY},
+ {"ld2.sa.nta", M, OpMXX6aHint (4, 0, 0, 0x0d, 3), {R1, MR3}, EMPTY},
+ {"ld4.sa", M, OpMXX6aHint (4, 0, 0, 0x0e, 0), {R1, MR3}, EMPTY},
+ {"ld4.sa.nt1", M, OpMXX6aHint (4, 0, 0, 0x0e, 1), {R1, MR3}, EMPTY},
+ {"ld4.sa.nta", M, OpMXX6aHint (4, 0, 0, 0x0e, 3), {R1, MR3}, EMPTY},
+ {"ld8.sa", M, OpMXX6aHint (4, 0, 0, 0x0f, 0), {R1, MR3}, EMPTY},
+ {"ld8.sa.nt1", M, OpMXX6aHint (4, 0, 0, 0x0f, 1), {R1, MR3}, EMPTY},
+ {"ld8.sa.nta", M, OpMXX6aHint (4, 0, 0, 0x0f, 3), {R1, MR3}, EMPTY},
+ {"ld1.bias", M, OpMXX6aHint (4, 0, 0, 0x10, 0), {R1, MR3}, EMPTY},
+ {"ld1.bias.nt1", M, OpMXX6aHint (4, 0, 0, 0x10, 1), {R1, MR3}, EMPTY},
+ {"ld1.bias.nta", M, OpMXX6aHint (4, 0, 0, 0x10, 3), {R1, MR3}, EMPTY},
+ {"ld2.bias", M, OpMXX6aHint (4, 0, 0, 0x11, 0), {R1, MR3}, EMPTY},
+ {"ld2.bias.nt1", M, OpMXX6aHint (4, 0, 0, 0x11, 1), {R1, MR3}, EMPTY},
+ {"ld2.bias.nta", M, OpMXX6aHint (4, 0, 0, 0x11, 3), {R1, MR3}, EMPTY},
+ {"ld4.bias", M, OpMXX6aHint (4, 0, 0, 0x12, 0), {R1, MR3}, EMPTY},
+ {"ld4.bias.nt1", M, OpMXX6aHint (4, 0, 0, 0x12, 1), {R1, MR3}, EMPTY},
+ {"ld4.bias.nta", M, OpMXX6aHint (4, 0, 0, 0x12, 3), {R1, MR3}, EMPTY},
+ {"ld8.bias", M, OpMXX6aHint (4, 0, 0, 0x13, 0), {R1, MR3}, EMPTY},
+ {"ld8.bias.nt1", M, OpMXX6aHint (4, 0, 0, 0x13, 1), {R1, MR3}, EMPTY},
+ {"ld8.bias.nta", M, OpMXX6aHint (4, 0, 0, 0x13, 3), {R1, MR3}, EMPTY},
+ {"ld1.acq", M, OpMXX6aHint (4, 0, 0, 0x14, 0), {R1, MR3}, EMPTY},
+ {"ld1.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x14, 1), {R1, MR3}, EMPTY},
+ {"ld1.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x14, 3), {R1, MR3}, EMPTY},
+ {"ld2.acq", M, OpMXX6aHint (4, 0, 0, 0x15, 0), {R1, MR3}, EMPTY},
+ {"ld2.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x15, 1), {R1, MR3}, EMPTY},
+ {"ld2.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x15, 3), {R1, MR3}, EMPTY},
+ {"ld4.acq", M, OpMXX6aHint (4, 0, 0, 0x16, 0), {R1, MR3}, EMPTY},
+ {"ld4.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x16, 1), {R1, MR3}, EMPTY},
+ {"ld4.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x16, 3), {R1, MR3}, EMPTY},
+ {"ld8.acq", M, OpMXX6aHint (4, 0, 0, 0x17, 0), {R1, MR3}, EMPTY},
+ {"ld8.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x17, 1), {R1, MR3}, EMPTY},
+ {"ld8.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x17, 3), {R1, MR3}, EMPTY},
+ {"ld8.fill", M, OpMXX6aHint (4, 0, 0, 0x1b, 0), {R1, MR3}, EMPTY},
+ {"ld8.fill.nt1", M, OpMXX6aHint (4, 0, 0, 0x1b, 1), {R1, MR3}, EMPTY},
+ {"ld8.fill.nta", M, OpMXX6aHint (4, 0, 0, 0x1b, 3), {R1, MR3}, EMPTY},
+ {"ld1.c.clr", M, OpMXX6aHint (4, 0, 0, 0x20, 0), {R1, MR3}, EMPTY},
+ {"ld1.c.clr.nt1", M, OpMXX6aHint (4, 0, 0, 0x20, 1), {R1, MR3}, EMPTY},
+ {"ld1.c.clr.nta", M, OpMXX6aHint (4, 0, 0, 0x20, 3), {R1, MR3}, EMPTY},
+ {"ld2.c.clr", M, OpMXX6aHint (4, 0, 0, 0x21, 0), {R1, MR3}, EMPTY},
+ {"ld2.c.clr.nt1", M, OpMXX6aHint (4, 0, 0, 0x21, 1), {R1, MR3}, EMPTY},
+ {"ld2.c.clr.nta", M, OpMXX6aHint (4, 0, 0, 0x21, 3), {R1, MR3}, EMPTY},
+ {"ld4.c.clr", M, OpMXX6aHint (4, 0, 0, 0x22, 0), {R1, MR3}, EMPTY},
+ {"ld4.c.clr.nt1", M, OpMXX6aHint (4, 0, 0, 0x22, 1), {R1, MR3}, EMPTY},
+ {"ld4.c.clr.nta", M, OpMXX6aHint (4, 0, 0, 0x22, 3), {R1, MR3}, EMPTY},
+ {"ld8.c.clr", M, OpMXX6aHint (4, 0, 0, 0x23, 0), {R1, MR3}, EMPTY},
+ {"ld8.c.clr.nt1", M, OpMXX6aHint (4, 0, 0, 0x23, 1), {R1, MR3}, EMPTY},
+ {"ld8.c.clr.nta", M, OpMXX6aHint (4, 0, 0, 0x23, 3), {R1, MR3}, EMPTY},
+ {"ld1.c.nc", M, OpMXX6aHint (4, 0, 0, 0x24, 0), {R1, MR3}, EMPTY},
+ {"ld1.c.nc.nt1", M, OpMXX6aHint (4, 0, 0, 0x24, 1), {R1, MR3}, EMPTY},
+ {"ld1.c.nc.nta", M, OpMXX6aHint (4, 0, 0, 0x24, 3), {R1, MR3}, EMPTY},
+ {"ld2.c.nc", M, OpMXX6aHint (4, 0, 0, 0x25, 0), {R1, MR3}, EMPTY},
+ {"ld2.c.nc.nt1", M, OpMXX6aHint (4, 0, 0, 0x25, 1), {R1, MR3}, EMPTY},
+ {"ld2.c.nc.nta", M, OpMXX6aHint (4, 0, 0, 0x25, 3), {R1, MR3}, EMPTY},
+ {"ld4.c.nc", M, OpMXX6aHint (4, 0, 0, 0x26, 0), {R1, MR3}, EMPTY},
+ {"ld4.c.nc.nt1", M, OpMXX6aHint (4, 0, 0, 0x26, 1), {R1, MR3}, EMPTY},
+ {"ld4.c.nc.nta", M, OpMXX6aHint (4, 0, 0, 0x26, 3), {R1, MR3}, EMPTY},
+ {"ld8.c.nc", M, OpMXX6aHint (4, 0, 0, 0x27, 0), {R1, MR3}, EMPTY},
+ {"ld8.c.nc.nt1", M, OpMXX6aHint (4, 0, 0, 0x27, 1), {R1, MR3}, EMPTY},
+ {"ld8.c.nc.nta", M, OpMXX6aHint (4, 0, 0, 0x27, 3), {R1, MR3}, EMPTY},
+ {"ld1.c.clr.acq", M, OpMXX6aHint (4, 0, 0, 0x28, 0), {R1, MR3}, EMPTY},
+ {"ld1.c.clr.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x28, 1), {R1, MR3}, EMPTY},
+ {"ld1.c.clr.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x28, 3), {R1, MR3}, EMPTY},
+ {"ld2.c.clr.acq", M, OpMXX6aHint (4, 0, 0, 0x29, 0), {R1, MR3}, EMPTY},
+ {"ld2.c.clr.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x29, 1), {R1, MR3}, EMPTY},
+ {"ld2.c.clr.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x29, 3), {R1, MR3}, EMPTY},
+ {"ld4.c.clr.acq", M, OpMXX6aHint (4, 0, 0, 0x2a, 0), {R1, MR3}, EMPTY},
+ {"ld4.c.clr.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x2a, 1), {R1, MR3}, EMPTY},
+ {"ld4.c.clr.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x2a, 3), {R1, MR3}, EMPTY},
+ {"ld8.c.clr.acq", M, OpMXX6aHint (4, 0, 0, 0x2b, 0), {R1, MR3}, EMPTY},
+ {"ld8.c.clr.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x2b, 1), {R1, MR3}, EMPTY},
+ {"ld8.c.clr.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x2b, 3), {R1, MR3}, EMPTY},
- /* integer load w/increment by register */
-#define LDINCREG(c,h) M, OpMXX6aHint (4, 1, 0, c, h), {R1, MR3, R2}, POSTINC,
+ /* Integer load w/increment by register. */
+#define LDINCREG(c,h) M, OpMXX6aHint (4, 1, 0, c, h), {R1, MR3, R2}, POSTINC, 0, NULL
{"ld1", LDINCREG (0x00, 0)},
{"ld1.nt1", LDINCREG (0x00, 1)},
{"ld1.nta", LDINCREG (0x00, 3)},
@@ -376,26 +380,26 @@ struct ia64_opcode ia64_opcodes_m[] =
{"ld8.c.clr.acq.nta", LDINCREG (0x2b, 3)},
#undef LDINCREG
- {"st1", M, OpMXX6aHint (4, 0, 0, 0x30, 0), {MR3, R2}},
- {"st1.nta", M, OpMXX6aHint (4, 0, 0, 0x30, 3), {MR3, R2}},
- {"st2", M, OpMXX6aHint (4, 0, 0, 0x31, 0), {MR3, R2}},
- {"st2.nta", M, OpMXX6aHint (4, 0, 0, 0x31, 3), {MR3, R2}},
- {"st4", M, OpMXX6aHint (4, 0, 0, 0x32, 0), {MR3, R2}},
- {"st4.nta", M, OpMXX6aHint (4, 0, 0, 0x32, 3), {MR3, R2}},
- {"st8", M, OpMXX6aHint (4, 0, 0, 0x33, 0), {MR3, R2}},
- {"st8.nta", M, OpMXX6aHint (4, 0, 0, 0x33, 3), {MR3, R2}},
- {"st1.rel", M, OpMXX6aHint (4, 0, 0, 0x34, 0), {MR3, R2}},
- {"st1.rel.nta", M, OpMXX6aHint (4, 0, 0, 0x34, 3), {MR3, R2}},
- {"st2.rel", M, OpMXX6aHint (4, 0, 0, 0x35, 0), {MR3, R2}},
- {"st2.rel.nta", M, OpMXX6aHint (4, 0, 0, 0x35, 3), {MR3, R2}},
- {"st4.rel", M, OpMXX6aHint (4, 0, 0, 0x36, 0), {MR3, R2}},
- {"st4.rel.nta", M, OpMXX6aHint (4, 0, 0, 0x36, 3), {MR3, R2}},
- {"st8.rel", M, OpMXX6aHint (4, 0, 0, 0x37, 0), {MR3, R2}},
- {"st8.rel.nta", M, OpMXX6aHint (4, 0, 0, 0x37, 3), {MR3, R2}},
- {"st8.spill", M, OpMXX6aHint (4, 0, 0, 0x3b, 0), {MR3, R2}},
- {"st8.spill.nta", M, OpMXX6aHint (4, 0, 0, 0x3b, 3), {MR3, R2}},
+ {"st1", M, OpMXX6aHint (4, 0, 0, 0x30, 0), {MR3, R2}, EMPTY},
+ {"st1.nta", M, OpMXX6aHint (4, 0, 0, 0x30, 3), {MR3, R2}, EMPTY},
+ {"st2", M, OpMXX6aHint (4, 0, 0, 0x31, 0), {MR3, R2}, EMPTY},
+ {"st2.nta", M, OpMXX6aHint (4, 0, 0, 0x31, 3), {MR3, R2}, EMPTY},
+ {"st4", M, OpMXX6aHint (4, 0, 0, 0x32, 0), {MR3, R2}, EMPTY},
+ {"st4.nta", M, OpMXX6aHint (4, 0, 0, 0x32, 3), {MR3, R2}, EMPTY},
+ {"st8", M, OpMXX6aHint (4, 0, 0, 0x33, 0), {MR3, R2}, EMPTY},
+ {"st8.nta", M, OpMXX6aHint (4, 0, 0, 0x33, 3), {MR3, R2}, EMPTY},
+ {"st1.rel", M, OpMXX6aHint (4, 0, 0, 0x34, 0), {MR3, R2}, EMPTY},
+ {"st1.rel.nta", M, OpMXX6aHint (4, 0, 0, 0x34, 3), {MR3, R2}, EMPTY},
+ {"st2.rel", M, OpMXX6aHint (4, 0, 0, 0x35, 0), {MR3, R2}, EMPTY},
+ {"st2.rel.nta", M, OpMXX6aHint (4, 0, 0, 0x35, 3), {MR3, R2}, EMPTY},
+ {"st4.rel", M, OpMXX6aHint (4, 0, 0, 0x36, 0), {MR3, R2}, EMPTY},
+ {"st4.rel.nta", M, OpMXX6aHint (4, 0, 0, 0x36, 3), {MR3, R2}, EMPTY},
+ {"st8.rel", M, OpMXX6aHint (4, 0, 0, 0x37, 0), {MR3, R2}, EMPTY},
+ {"st8.rel.nta", M, OpMXX6aHint (4, 0, 0, 0x37, 3), {MR3, R2}, EMPTY},
+ {"st8.spill", M, OpMXX6aHint (4, 0, 0, 0x3b, 0), {MR3, R2}, EMPTY},
+ {"st8.spill.nta", M, OpMXX6aHint (4, 0, 0, 0x3b, 3), {MR3, R2}, EMPTY},
-#define CMPXCHG(c,h) M, OpMXX6aHint (4, 0, 1, c, h), {R1, MR3, R2, AR_CCV}
+#define CMPXCHG(c,h) M, OpMXX6aHint (4, 0, 1, c, h), {R1, MR3, R2, AR_CCV}, EMPTY
{"cmpxchg1.acq", CMPXCHG (0x00, 0)},
{"cmpxchg1.acq.nt1", CMPXCHG (0x00, 1)},
{"cmpxchg1.acq.nta", CMPXCHG (0x00, 3)},
@@ -421,39 +425,39 @@ struct ia64_opcode ia64_opcodes_m[] =
{"cmpxchg8.rel.nt1", CMPXCHG (0x07, 1)},
{"cmpxchg8.rel.nta", CMPXCHG (0x07, 3)},
#undef CMPXCHG
- {"xchg1", M, OpMXX6aHint (4, 0, 1, 0x08, 0), {R1, MR3, R2}},
- {"xchg1.nt1", M, OpMXX6aHint (4, 0, 1, 0x08, 1), {R1, MR3, R2}},
- {"xchg1.nta", M, OpMXX6aHint (4, 0, 1, 0x08, 3), {R1, MR3, R2}},
- {"xchg2", M, OpMXX6aHint (4, 0, 1, 0x09, 0), {R1, MR3, R2}},
- {"xchg2.nt1", M, OpMXX6aHint (4, 0, 1, 0x09, 1), {R1, MR3, R2}},
- {"xchg2.nta", M, OpMXX6aHint (4, 0, 1, 0x09, 3), {R1, MR3, R2}},
- {"xchg4", M, OpMXX6aHint (4, 0, 1, 0x0a, 0), {R1, MR3, R2}},
- {"xchg4.nt1", M, OpMXX6aHint (4, 0, 1, 0x0a, 1), {R1, MR3, R2}},
- {"xchg4.nta", M, OpMXX6aHint (4, 0, 1, 0x0a, 3), {R1, MR3, R2}},
- {"xchg8", M, OpMXX6aHint (4, 0, 1, 0x0b, 0), {R1, MR3, R2}},
- {"xchg8.nt1", M, OpMXX6aHint (4, 0, 1, 0x0b, 1), {R1, MR3, R2}},
- {"xchg8.nta", M, OpMXX6aHint (4, 0, 1, 0x0b, 3), {R1, MR3, R2}},
+ {"xchg1", M, OpMXX6aHint (4, 0, 1, 0x08, 0), {R1, MR3, R2}, EMPTY},
+ {"xchg1.nt1", M, OpMXX6aHint (4, 0, 1, 0x08, 1), {R1, MR3, R2}, EMPTY},
+ {"xchg1.nta", M, OpMXX6aHint (4, 0, 1, 0x08, 3), {R1, MR3, R2}, EMPTY},
+ {"xchg2", M, OpMXX6aHint (4, 0, 1, 0x09, 0), {R1, MR3, R2}, EMPTY},
+ {"xchg2.nt1", M, OpMXX6aHint (4, 0, 1, 0x09, 1), {R1, MR3, R2}, EMPTY},
+ {"xchg2.nta", M, OpMXX6aHint (4, 0, 1, 0x09, 3), {R1, MR3, R2}, EMPTY},
+ {"xchg4", M, OpMXX6aHint (4, 0, 1, 0x0a, 0), {R1, MR3, R2}, EMPTY},
+ {"xchg4.nt1", M, OpMXX6aHint (4, 0, 1, 0x0a, 1), {R1, MR3, R2}, EMPTY},
+ {"xchg4.nta", M, OpMXX6aHint (4, 0, 1, 0x0a, 3), {R1, MR3, R2}, EMPTY},
+ {"xchg8", M, OpMXX6aHint (4, 0, 1, 0x0b, 0), {R1, MR3, R2}, EMPTY},
+ {"xchg8.nt1", M, OpMXX6aHint (4, 0, 1, 0x0b, 1), {R1, MR3, R2}, EMPTY},
+ {"xchg8.nta", M, OpMXX6aHint (4, 0, 1, 0x0b, 3), {R1, MR3, R2}, EMPTY},
- {"fetchadd4.acq", M, OpMXX6aHint (4, 0, 1, 0x12, 0), {R1, MR3, INC3}},
- {"fetchadd4.acq.nt1", M, OpMXX6aHint (4, 0, 1, 0x12, 1), {R1, MR3, INC3}},
- {"fetchadd4.acq.nta", M, OpMXX6aHint (4, 0, 1, 0x12, 3), {R1, MR3, INC3}},
- {"fetchadd8.acq", M, OpMXX6aHint (4, 0, 1, 0x13, 0), {R1, MR3, INC3}},
- {"fetchadd8.acq.nt1", M, OpMXX6aHint (4, 0, 1, 0x13, 1), {R1, MR3, INC3}},
- {"fetchadd8.acq.nta", M, OpMXX6aHint (4, 0, 1, 0x13, 3), {R1, MR3, INC3}},
- {"fetchadd4.rel", M, OpMXX6aHint (4, 0, 1, 0x16, 0), {R1, MR3, INC3}},
- {"fetchadd4.rel.nt1", M, OpMXX6aHint (4, 0, 1, 0x16, 1), {R1, MR3, INC3}},
- {"fetchadd4.rel.nta", M, OpMXX6aHint (4, 0, 1, 0x16, 3), {R1, MR3, INC3}},
- {"fetchadd8.rel", M, OpMXX6aHint (4, 0, 1, 0x17, 0), {R1, MR3, INC3}},
- {"fetchadd8.rel.nt1", M, OpMXX6aHint (4, 0, 1, 0x17, 1), {R1, MR3, INC3}},
- {"fetchadd8.rel.nta", M, OpMXX6aHint (4, 0, 1, 0x17, 3), {R1, MR3, INC3}},
+ {"fetchadd4.acq", M, OpMXX6aHint (4, 0, 1, 0x12, 0), {R1, MR3, INC3}, EMPTY},
+ {"fetchadd4.acq.nt1", M, OpMXX6aHint (4, 0, 1, 0x12, 1), {R1, MR3, INC3}, EMPTY},
+ {"fetchadd4.acq.nta", M, OpMXX6aHint (4, 0, 1, 0x12, 3), {R1, MR3, INC3}, EMPTY},
+ {"fetchadd8.acq", M, OpMXX6aHint (4, 0, 1, 0x13, 0), {R1, MR3, INC3}, EMPTY},
+ {"fetchadd8.acq.nt1", M, OpMXX6aHint (4, 0, 1, 0x13, 1), {R1, MR3, INC3}, EMPTY},
+ {"fetchadd8.acq.nta", M, OpMXX6aHint (4, 0, 1, 0x13, 3), {R1, MR3, INC3}, EMPTY},
+ {"fetchadd4.rel", M, OpMXX6aHint (4, 0, 1, 0x16, 0), {R1, MR3, INC3}, EMPTY},
+ {"fetchadd4.rel.nt1", M, OpMXX6aHint (4, 0, 1, 0x16, 1), {R1, MR3, INC3}, EMPTY},
+ {"fetchadd4.rel.nta", M, OpMXX6aHint (4, 0, 1, 0x16, 3), {R1, MR3, INC3}, EMPTY},
+ {"fetchadd8.rel", M, OpMXX6aHint (4, 0, 1, 0x17, 0), {R1, MR3, INC3}, EMPTY},
+ {"fetchadd8.rel.nt1", M, OpMXX6aHint (4, 0, 1, 0x17, 1), {R1, MR3, INC3}, EMPTY},
+ {"fetchadd8.rel.nta", M, OpMXX6aHint (4, 0, 1, 0x17, 3), {R1, MR3, INC3}, EMPTY},
- {"getf.sig", M, OpMXX6a (4, 0, 1, 0x1c), {R1, F2}},
- {"getf.exp", M, OpMXX6a (4, 0, 1, 0x1d), {R1, F2}},
- {"getf.s", M, OpMXX6a (4, 0, 1, 0x1e), {R1, F2}},
- {"getf.d", M, OpMXX6a (4, 0, 1, 0x1f), {R1, F2}},
+ {"getf.sig", M, OpMXX6a (4, 0, 1, 0x1c), {R1, F2}, EMPTY},
+ {"getf.exp", M, OpMXX6a (4, 0, 1, 0x1d), {R1, F2}, EMPTY},
+ {"getf.s", M, OpMXX6a (4, 0, 1, 0x1e), {R1, F2}, EMPTY},
+ {"getf.d", M, OpMXX6a (4, 0, 1, 0x1f), {R1, F2}, EMPTY},
- /* integer load w/increment by immediate */
-#define LDINCIMMED(c,h) M, OpX6aHint (5, c, h), {R1, MR3, IMM9b}, POSTINC
+ /* Integer load w/increment by immediate. */
+#define LDINCIMMED(c,h) M, OpX6aHint (5, c, h), {R1, MR3, IMM9b}, POSTINC, 0, NULL
{"ld1", LDINCIMMED (0x00, 0)},
{"ld1.nt1", LDINCIMMED (0x00, 1)},
{"ld1.nta", LDINCIMMED (0x00, 3)},
@@ -567,8 +571,8 @@ struct ia64_opcode ia64_opcodes_m[] =
{"ld8.c.clr.acq.nta", LDINCIMMED (0x2b, 3)},
#undef LDINCIMMED
- /* store w/increment by immediate */
-#define STINCIMMED(c,h) M, OpX6aHint (5, c, h), {MR3, R2, IMM9a}, POSTINC
+ /* Store w/increment by immediate. */
+#define STINCIMMED(c,h) M, OpX6aHint (5, c, h), {MR3, R2, IMM9a}, POSTINC, 0, NULL
{"st1", STINCIMMED (0x30, 0)},
{"st1.nta", STINCIMMED (0x30, 3)},
{"st2", STINCIMMED (0x31, 0)},
@@ -589,85 +593,85 @@ struct ia64_opcode ia64_opcodes_m[] =
{"st8.spill.nta", STINCIMMED (0x3b, 3)},
#undef STINCIMMED
- /* floating-point load */
- {"ldfs", M, OpMXX6aHint (6, 0, 0, 0x02, 0), {F1, MR3}},
- {"ldfs.nt1", M, OpMXX6aHint (6, 0, 0, 0x02, 1), {F1, MR3}},
- {"ldfs.nta", M, OpMXX6aHint (6, 0, 0, 0x02, 3), {F1, MR3}},
- {"ldfd", M, OpMXX6aHint (6, 0, 0, 0x03, 0), {F1, MR3}},
- {"ldfd.nt1", M, OpMXX6aHint (6, 0, 0, 0x03, 1), {F1, MR3}},
- {"ldfd.nta", M, OpMXX6aHint (6, 0, 0, 0x03, 3), {F1, MR3}},
- {"ldf8", M, OpMXX6aHint (6, 0, 0, 0x01, 0), {F1, MR3}},
- {"ldf8.nt1", M, OpMXX6aHint (6, 0, 0, 0x01, 1), {F1, MR3}},
- {"ldf8.nta", M, OpMXX6aHint (6, 0, 0, 0x01, 3), {F1, MR3}},
- {"ldfe", M, OpMXX6aHint (6, 0, 0, 0x00, 0), {F1, MR3}},
- {"ldfe.nt1", M, OpMXX6aHint (6, 0, 0, 0x00, 1), {F1, MR3}},
- {"ldfe.nta", M, OpMXX6aHint (6, 0, 0, 0x00, 3), {F1, MR3}},
- {"ldfs.s", M, OpMXX6aHint (6, 0, 0, 0x06, 0), {F1, MR3}},
- {"ldfs.s.nt1", M, OpMXX6aHint (6, 0, 0, 0x06, 1), {F1, MR3}},
- {"ldfs.s.nta", M, OpMXX6aHint (6, 0, 0, 0x06, 3), {F1, MR3}},
- {"ldfd.s", M, OpMXX6aHint (6, 0, 0, 0x07, 0), {F1, MR3}},
- {"ldfd.s.nt1", M, OpMXX6aHint (6, 0, 0, 0x07, 1), {F1, MR3}},
- {"ldfd.s.nta", M, OpMXX6aHint (6, 0, 0, 0x07, 3), {F1, MR3}},
- {"ldf8.s", M, OpMXX6aHint (6, 0, 0, 0x05, 0), {F1, MR3}},
- {"ldf8.s.nt1", M, OpMXX6aHint (6, 0, 0, 0x05, 1), {F1, MR3}},
- {"ldf8.s.nta", M, OpMXX6aHint (6, 0, 0, 0x05, 3), {F1, MR3}},
- {"ldfe.s", M, OpMXX6aHint (6, 0, 0, 0x04, 0), {F1, MR3}},
- {"ldfe.s.nt1", M, OpMXX6aHint (6, 0, 0, 0x04, 1), {F1, MR3}},
- {"ldfe.s.nta", M, OpMXX6aHint (6, 0, 0, 0x04, 3), {F1, MR3}},
- {"ldfs.a", M, OpMXX6aHint (6, 0, 0, 0x0a, 0), {F1, MR3}},
- {"ldfs.a.nt1", M, OpMXX6aHint (6, 0, 0, 0x0a, 1), {F1, MR3}},
- {"ldfs.a.nta", M, OpMXX6aHint (6, 0, 0, 0x0a, 3), {F1, MR3}},
- {"ldfd.a", M, OpMXX6aHint (6, 0, 0, 0x0b, 0), {F1, MR3}},
- {"ldfd.a.nt1", M, OpMXX6aHint (6, 0, 0, 0x0b, 1), {F1, MR3}},
- {"ldfd.a.nta", M, OpMXX6aHint (6, 0, 0, 0x0b, 3), {F1, MR3}},
- {"ldf8.a", M, OpMXX6aHint (6, 0, 0, 0x09, 0), {F1, MR3}},
- {"ldf8.a.nt1", M, OpMXX6aHint (6, 0, 0, 0x09, 1), {F1, MR3}},
- {"ldf8.a.nta", M, OpMXX6aHint (6, 0, 0, 0x09, 3), {F1, MR3}},
- {"ldfe.a", M, OpMXX6aHint (6, 0, 0, 0x08, 0), {F1, MR3}},
- {"ldfe.a.nt1", M, OpMXX6aHint (6, 0, 0, 0x08, 1), {F1, MR3}},
- {"ldfe.a.nta", M, OpMXX6aHint (6, 0, 0, 0x08, 3), {F1, MR3}},
- {"ldfs.sa", M, OpMXX6aHint (6, 0, 0, 0x0e, 0), {F1, MR3}},
- {"ldfs.sa.nt1", M, OpMXX6aHint (6, 0, 0, 0x0e, 1), {F1, MR3}},
- {"ldfs.sa.nta", M, OpMXX6aHint (6, 0, 0, 0x0e, 3), {F1, MR3}},
- {"ldfd.sa", M, OpMXX6aHint (6, 0, 0, 0x0f, 0), {F1, MR3}},
- {"ldfd.sa.nt1", M, OpMXX6aHint (6, 0, 0, 0x0f, 1), {F1, MR3}},
- {"ldfd.sa.nta", M, OpMXX6aHint (6, 0, 0, 0x0f, 3), {F1, MR3}},
- {"ldf8.sa", M, OpMXX6aHint (6, 0, 0, 0x0d, 0), {F1, MR3}},
- {"ldf8.sa.nt1", M, OpMXX6aHint (6, 0, 0, 0x0d, 1), {F1, MR3}},
- {"ldf8.sa.nta", M, OpMXX6aHint (6, 0, 0, 0x0d, 3), {F1, MR3}},
- {"ldfe.sa", M, OpMXX6aHint (6, 0, 0, 0x0c, 0), {F1, MR3}},
- {"ldfe.sa.nt1", M, OpMXX6aHint (6, 0, 0, 0x0c, 1), {F1, MR3}},
- {"ldfe.sa.nta", M, OpMXX6aHint (6, 0, 0, 0x0c, 3), {F1, MR3}},
- {"ldf.fill", M, OpMXX6aHint (6, 0, 0, 0x1b, 0), {F1, MR3}},
- {"ldf.fill.nt1", M, OpMXX6aHint (6, 0, 0, 0x1b, 1), {F1, MR3}},
- {"ldf.fill.nta", M, OpMXX6aHint (6, 0, 0, 0x1b, 3), {F1, MR3}},
- {"ldfs.c.clr", M, OpMXX6aHint (6, 0, 0, 0x22, 0), {F1, MR3}},
- {"ldfs.c.clr.nt1", M, OpMXX6aHint (6, 0, 0, 0x22, 1), {F1, MR3}},
- {"ldfs.c.clr.nta", M, OpMXX6aHint (6, 0, 0, 0x22, 3), {F1, MR3}},
- {"ldfd.c.clr", M, OpMXX6aHint (6, 0, 0, 0x23, 0), {F1, MR3}},
- {"ldfd.c.clr.nt1", M, OpMXX6aHint (6, 0, 0, 0x23, 1), {F1, MR3}},
- {"ldfd.c.clr.nta", M, OpMXX6aHint (6, 0, 0, 0x23, 3), {F1, MR3}},
- {"ldf8.c.clr", M, OpMXX6aHint (6, 0, 0, 0x21, 0), {F1, MR3}},
- {"ldf8.c.clr.nt1", M, OpMXX6aHint (6, 0, 0, 0x21, 1), {F1, MR3}},
- {"ldf8.c.clr.nta", M, OpMXX6aHint (6, 0, 0, 0x21, 3), {F1, MR3}},
- {"ldfe.c.clr", M, OpMXX6aHint (6, 0, 0, 0x20, 0), {F1, MR3}},
- {"ldfe.c.clr.nt1", M, OpMXX6aHint (6, 0, 0, 0x20, 1), {F1, MR3}},
- {"ldfe.c.clr.nta", M, OpMXX6aHint (6, 0, 0, 0x20, 3), {F1, MR3}},
- {"ldfs.c.nc", M, OpMXX6aHint (6, 0, 0, 0x26, 0), {F1, MR3}},
- {"ldfs.c.nc.nt1", M, OpMXX6aHint (6, 0, 0, 0x26, 1), {F1, MR3}},
- {"ldfs.c.nc.nta", M, OpMXX6aHint (6, 0, 0, 0x26, 3), {F1, MR3}},
- {"ldfd.c.nc", M, OpMXX6aHint (6, 0, 0, 0x27, 0), {F1, MR3}},
- {"ldfd.c.nc.nt1", M, OpMXX6aHint (6, 0, 0, 0x27, 1), {F1, MR3}},
- {"ldfd.c.nc.nta", M, OpMXX6aHint (6, 0, 0, 0x27, 3), {F1, MR3}},
- {"ldf8.c.nc", M, OpMXX6aHint (6, 0, 0, 0x25, 0), {F1, MR3}},
- {"ldf8.c.nc.nt1", M, OpMXX6aHint (6, 0, 0, 0x25, 1), {F1, MR3}},
- {"ldf8.c.nc.nta", M, OpMXX6aHint (6, 0, 0, 0x25, 3), {F1, MR3}},
- {"ldfe.c.nc", M, OpMXX6aHint (6, 0, 0, 0x24, 0), {F1, MR3}},
- {"ldfe.c.nc.nt1", M, OpMXX6aHint (6, 0, 0, 0x24, 1), {F1, MR3}},
- {"ldfe.c.nc.nta", M, OpMXX6aHint (6, 0, 0, 0x24, 3), {F1, MR3}},
+ /* Floating-point load. */
+ {"ldfs", M, OpMXX6aHint (6, 0, 0, 0x02, 0), {F1, MR3}, EMPTY},
+ {"ldfs.nt1", M, OpMXX6aHint (6, 0, 0, 0x02, 1), {F1, MR3}, EMPTY},
+ {"ldfs.nta", M, OpMXX6aHint (6, 0, 0, 0x02, 3), {F1, MR3}, EMPTY},
+ {"ldfd", M, OpMXX6aHint (6, 0, 0, 0x03, 0), {F1, MR3}, EMPTY},
+ {"ldfd.nt1", M, OpMXX6aHint (6, 0, 0, 0x03, 1), {F1, MR3}, EMPTY},
+ {"ldfd.nta", M, OpMXX6aHint (6, 0, 0, 0x03, 3), {F1, MR3}, EMPTY},
+ {"ldf8", M, OpMXX6aHint (6, 0, 0, 0x01, 0), {F1, MR3}, EMPTY},
+ {"ldf8.nt1", M, OpMXX6aHint (6, 0, 0, 0x01, 1), {F1, MR3}, EMPTY},
+ {"ldf8.nta", M, OpMXX6aHint (6, 0, 0, 0x01, 3), {F1, MR3}, EMPTY},
+ {"ldfe", M, OpMXX6aHint (6, 0, 0, 0x00, 0), {F1, MR3}, EMPTY},
+ {"ldfe.nt1", M, OpMXX6aHint (6, 0, 0, 0x00, 1), {F1, MR3}, EMPTY},
+ {"ldfe.nta", M, OpMXX6aHint (6, 0, 0, 0x00, 3), {F1, MR3}, EMPTY},
+ {"ldfs.s", M, OpMXX6aHint (6, 0, 0, 0x06, 0), {F1, MR3}, EMPTY},
+ {"ldfs.s.nt1", M, OpMXX6aHint (6, 0, 0, 0x06, 1), {F1, MR3}, EMPTY},
+ {"ldfs.s.nta", M, OpMXX6aHint (6, 0, 0, 0x06, 3), {F1, MR3}, EMPTY},
+ {"ldfd.s", M, OpMXX6aHint (6, 0, 0, 0x07, 0), {F1, MR3}, EMPTY},
+ {"ldfd.s.nt1", M, OpMXX6aHint (6, 0, 0, 0x07, 1), {F1, MR3}, EMPTY},
+ {"ldfd.s.nta", M, OpMXX6aHint (6, 0, 0, 0x07, 3), {F1, MR3}, EMPTY},
+ {"ldf8.s", M, OpMXX6aHint (6, 0, 0, 0x05, 0), {F1, MR3}, EMPTY},
+ {"ldf8.s.nt1", M, OpMXX6aHint (6, 0, 0, 0x05, 1), {F1, MR3}, EMPTY},
+ {"ldf8.s.nta", M, OpMXX6aHint (6, 0, 0, 0x05, 3), {F1, MR3}, EMPTY},
+ {"ldfe.s", M, OpMXX6aHint (6, 0, 0, 0x04, 0), {F1, MR3}, EMPTY},
+ {"ldfe.s.nt1", M, OpMXX6aHint (6, 0, 0, 0x04, 1), {F1, MR3}, EMPTY},
+ {"ldfe.s.nta", M, OpMXX6aHint (6, 0, 0, 0x04, 3), {F1, MR3}, EMPTY},
+ {"ldfs.a", M, OpMXX6aHint (6, 0, 0, 0x0a, 0), {F1, MR3}, EMPTY},
+ {"ldfs.a.nt1", M, OpMXX6aHint (6, 0, 0, 0x0a, 1), {F1, MR3}, EMPTY},
+ {"ldfs.a.nta", M, OpMXX6aHint (6, 0, 0, 0x0a, 3), {F1, MR3}, EMPTY},
+ {"ldfd.a", M, OpMXX6aHint (6, 0, 0, 0x0b, 0), {F1, MR3}, EMPTY},
+ {"ldfd.a.nt1", M, OpMXX6aHint (6, 0, 0, 0x0b, 1), {F1, MR3}, EMPTY},
+ {"ldfd.a.nta", M, OpMXX6aHint (6, 0, 0, 0x0b, 3), {F1, MR3}, EMPTY},
+ {"ldf8.a", M, OpMXX6aHint (6, 0, 0, 0x09, 0), {F1, MR3}, EMPTY},
+ {"ldf8.a.nt1", M, OpMXX6aHint (6, 0, 0, 0x09, 1), {F1, MR3}, EMPTY},
+ {"ldf8.a.nta", M, OpMXX6aHint (6, 0, 0, 0x09, 3), {F1, MR3}, EMPTY},
+ {"ldfe.a", M, OpMXX6aHint (6, 0, 0, 0x08, 0), {F1, MR3}, EMPTY},
+ {"ldfe.a.nt1", M, OpMXX6aHint (6, 0, 0, 0x08, 1), {F1, MR3}, EMPTY},
+ {"ldfe.a.nta", M, OpMXX6aHint (6, 0, 0, 0x08, 3), {F1, MR3}, EMPTY},
+ {"ldfs.sa", M, OpMXX6aHint (6, 0, 0, 0x0e, 0), {F1, MR3}, EMPTY},
+ {"ldfs.sa.nt1", M, OpMXX6aHint (6, 0, 0, 0x0e, 1), {F1, MR3}, EMPTY},
+ {"ldfs.sa.nta", M, OpMXX6aHint (6, 0, 0, 0x0e, 3), {F1, MR3}, EMPTY},
+ {"ldfd.sa", M, OpMXX6aHint (6, 0, 0, 0x0f, 0), {F1, MR3}, EMPTY},
+ {"ldfd.sa.nt1", M, OpMXX6aHint (6, 0, 0, 0x0f, 1), {F1, MR3}, EMPTY},
+ {"ldfd.sa.nta", M, OpMXX6aHint (6, 0, 0, 0x0f, 3), {F1, MR3}, EMPTY},
+ {"ldf8.sa", M, OpMXX6aHint (6, 0, 0, 0x0d, 0), {F1, MR3}, EMPTY},
+ {"ldf8.sa.nt1", M, OpMXX6aHint (6, 0, 0, 0x0d, 1), {F1, MR3}, EMPTY},
+ {"ldf8.sa.nta", M, OpMXX6aHint (6, 0, 0, 0x0d, 3), {F1, MR3}, EMPTY},
+ {"ldfe.sa", M, OpMXX6aHint (6, 0, 0, 0x0c, 0), {F1, MR3}, EMPTY},
+ {"ldfe.sa.nt1", M, OpMXX6aHint (6, 0, 0, 0x0c, 1), {F1, MR3}, EMPTY},
+ {"ldfe.sa.nta", M, OpMXX6aHint (6, 0, 0, 0x0c, 3), {F1, MR3}, EMPTY},
+ {"ldf.fill", M, OpMXX6aHint (6, 0, 0, 0x1b, 0), {F1, MR3}, EMPTY},
+ {"ldf.fill.nt1", M, OpMXX6aHint (6, 0, 0, 0x1b, 1), {F1, MR3}, EMPTY},
+ {"ldf.fill.nta", M, OpMXX6aHint (6, 0, 0, 0x1b, 3), {F1, MR3}, EMPTY},
+ {"ldfs.c.clr", M, OpMXX6aHint (6, 0, 0, 0x22, 0), {F1, MR3}, EMPTY},
+ {"ldfs.c.clr.nt1", M, OpMXX6aHint (6, 0, 0, 0x22, 1), {F1, MR3}, EMPTY},
+ {"ldfs.c.clr.nta", M, OpMXX6aHint (6, 0, 0, 0x22, 3), {F1, MR3}, EMPTY},
+ {"ldfd.c.clr", M, OpMXX6aHint (6, 0, 0, 0x23, 0), {F1, MR3}, EMPTY},
+ {"ldfd.c.clr.nt1", M, OpMXX6aHint (6, 0, 0, 0x23, 1), {F1, MR3}, EMPTY},
+ {"ldfd.c.clr.nta", M, OpMXX6aHint (6, 0, 0, 0x23, 3), {F1, MR3}, EMPTY},
+ {"ldf8.c.clr", M, OpMXX6aHint (6, 0, 0, 0x21, 0), {F1, MR3}, EMPTY},
+ {"ldf8.c.clr.nt1", M, OpMXX6aHint (6, 0, 0, 0x21, 1), {F1, MR3}, EMPTY},
+ {"ldf8.c.clr.nta", M, OpMXX6aHint (6, 0, 0, 0x21, 3), {F1, MR3}, EMPTY},
+ {"ldfe.c.clr", M, OpMXX6aHint (6, 0, 0, 0x20, 0), {F1, MR3}, EMPTY},
+ {"ldfe.c.clr.nt1", M, OpMXX6aHint (6, 0, 0, 0x20, 1), {F1, MR3}, EMPTY},
+ {"ldfe.c.clr.nta", M, OpMXX6aHint (6, 0, 0, 0x20, 3), {F1, MR3}, EMPTY},
+ {"ldfs.c.nc", M, OpMXX6aHint (6, 0, 0, 0x26, 0), {F1, MR3}, EMPTY},
+ {"ldfs.c.nc.nt1", M, OpMXX6aHint (6, 0, 0, 0x26, 1), {F1, MR3}, EMPTY},
+ {"ldfs.c.nc.nta", M, OpMXX6aHint (6, 0, 0, 0x26, 3), {F1, MR3}, EMPTY},
+ {"ldfd.c.nc", M, OpMXX6aHint (6, 0, 0, 0x27, 0), {F1, MR3}, EMPTY},
+ {"ldfd.c.nc.nt1", M, OpMXX6aHint (6, 0, 0, 0x27, 1), {F1, MR3}, EMPTY},
+ {"ldfd.c.nc.nta", M, OpMXX6aHint (6, 0, 0, 0x27, 3), {F1, MR3}, EMPTY},
+ {"ldf8.c.nc", M, OpMXX6aHint (6, 0, 0, 0x25, 0), {F1, MR3}, EMPTY},
+ {"ldf8.c.nc.nt1", M, OpMXX6aHint (6, 0, 0, 0x25, 1), {F1, MR3}, EMPTY},
+ {"ldf8.c.nc.nta", M, OpMXX6aHint (6, 0, 0, 0x25, 3), {F1, MR3}, EMPTY},
+ {"ldfe.c.nc", M, OpMXX6aHint (6, 0, 0, 0x24, 0), {F1, MR3}, EMPTY},
+ {"ldfe.c.nc.nt1", M, OpMXX6aHint (6, 0, 0, 0x24, 1), {F1, MR3}, EMPTY},
+ {"ldfe.c.nc.nta", M, OpMXX6aHint (6, 0, 0, 0x24, 3), {F1, MR3}, EMPTY},
- /* floating-point load w/increment by register */
-#define FLDINCREG(c,h) M, OpMXX6aHint (6, 1, 0, c, h), {F1, MR3, R2}, POSTINC
+ /* Floating-point load w/increment by register. */
+#define FLDINCREG(c,h) M, OpMXX6aHint (6, 1, 0, c, h), {F1, MR3, R2}, POSTINC, 0, NULL
{"ldfs", FLDINCREG (0x02, 0)},
{"ldfs.nt1", FLDINCREG (0x02, 1)},
{"ldfs.nta", FLDINCREG (0x02, 3)},
@@ -745,76 +749,76 @@ struct ia64_opcode ia64_opcodes_m[] =
{"ldfe.c.nc.nta", FLDINCREG (0x24, 3)},
#undef FLDINCREG
- /* floating-point store */
- {"stfs", M, OpMXX6aHint (6, 0, 0, 0x32, 0), {MR3, F2}},
- {"stfs.nta", M, OpMXX6aHint (6, 0, 0, 0x32, 3), {MR3, F2}},
- {"stfd", M, OpMXX6aHint (6, 0, 0, 0x33, 0), {MR3, F2}},
- {"stfd.nta", M, OpMXX6aHint (6, 0, 0, 0x33, 3), {MR3, F2}},
- {"stf8", M, OpMXX6aHint (6, 0, 0, 0x31, 0), {MR3, F2}},
- {"stf8.nta", M, OpMXX6aHint (6, 0, 0, 0x31, 3), {MR3, F2}},
- {"stfe", M, OpMXX6aHint (6, 0, 0, 0x30, 0), {MR3, F2}},
- {"stfe.nta", M, OpMXX6aHint (6, 0, 0, 0x30, 3), {MR3, F2}},
- {"stf.spill", M, OpMXX6aHint (6, 0, 0, 0x3b, 0), {MR3, F2}},
- {"stf.spill.nta", M, OpMXX6aHint (6, 0, 0, 0x3b, 3), {MR3, F2}},
+ /* Floating-point store. */
+ {"stfs", M, OpMXX6aHint (6, 0, 0, 0x32, 0), {MR3, F2}, EMPTY},
+ {"stfs.nta", M, OpMXX6aHint (6, 0, 0, 0x32, 3), {MR3, F2}, EMPTY},
+ {"stfd", M, OpMXX6aHint (6, 0, 0, 0x33, 0), {MR3, F2}, EMPTY},
+ {"stfd.nta", M, OpMXX6aHint (6, 0, 0, 0x33, 3), {MR3, F2}, EMPTY},
+ {"stf8", M, OpMXX6aHint (6, 0, 0, 0x31, 0), {MR3, F2}, EMPTY},
+ {"stf8.nta", M, OpMXX6aHint (6, 0, 0, 0x31, 3), {MR3, F2}, EMPTY},
+ {"stfe", M, OpMXX6aHint (6, 0, 0, 0x30, 0), {MR3, F2}, EMPTY},
+ {"stfe.nta", M, OpMXX6aHint (6, 0, 0, 0x30, 3), {MR3, F2}, EMPTY},
+ {"stf.spill", M, OpMXX6aHint (6, 0, 0, 0x3b, 0), {MR3, F2}, EMPTY},
+ {"stf.spill.nta", M, OpMXX6aHint (6, 0, 0, 0x3b, 3), {MR3, F2}, EMPTY},
- /* floating-point load pair */
- {"ldfps", M2, OpMXX6aHint (6, 0, 1, 0x02, 0), {F1, F2, MR3}},
- {"ldfps.nt1", M2, OpMXX6aHint (6, 0, 1, 0x02, 1), {F1, F2, MR3}},
- {"ldfps.nta", M2, OpMXX6aHint (6, 0, 1, 0x02, 3), {F1, F2, MR3}},
- {"ldfpd", M2, OpMXX6aHint (6, 0, 1, 0x03, 0), {F1, F2, MR3}},
- {"ldfpd.nt1", M2, OpMXX6aHint (6, 0, 1, 0x03, 1), {F1, F2, MR3}},
- {"ldfpd.nta", M2, OpMXX6aHint (6, 0, 1, 0x03, 3), {F1, F2, MR3}},
- {"ldfp8", M2, OpMXX6aHint (6, 0, 1, 0x01, 0), {F1, F2, MR3}},
- {"ldfp8.nt1", M2, OpMXX6aHint (6, 0, 1, 0x01, 1), {F1, F2, MR3}},
- {"ldfp8.nta", M2, OpMXX6aHint (6, 0, 1, 0x01, 3), {F1, F2, MR3}},
- {"ldfps.s", M2, OpMXX6aHint (6, 0, 1, 0x06, 0), {F1, F2, MR3}},
- {"ldfps.s.nt1", M2, OpMXX6aHint (6, 0, 1, 0x06, 1), {F1, F2, MR3}},
- {"ldfps.s.nta", M2, OpMXX6aHint (6, 0, 1, 0x06, 3), {F1, F2, MR3}},
- {"ldfpd.s", M2, OpMXX6aHint (6, 0, 1, 0x07, 0), {F1, F2, MR3}},
- {"ldfpd.s.nt1", M2, OpMXX6aHint (6, 0, 1, 0x07, 1), {F1, F2, MR3}},
- {"ldfpd.s.nta", M2, OpMXX6aHint (6, 0, 1, 0x07, 3), {F1, F2, MR3}},
- {"ldfp8.s", M2, OpMXX6aHint (6, 0, 1, 0x05, 0), {F1, F2, MR3}},
- {"ldfp8.s.nt1", M2, OpMXX6aHint (6, 0, 1, 0x05, 1), {F1, F2, MR3}},
- {"ldfp8.s.nta", M2, OpMXX6aHint (6, 0, 1, 0x05, 3), {F1, F2, MR3}},
- {"ldfps.a", M2, OpMXX6aHint (6, 0, 1, 0x0a, 0), {F1, F2, MR3}},
- {"ldfps.a.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0a, 1), {F1, F2, MR3}},
- {"ldfps.a.nta", M2, OpMXX6aHint (6, 0, 1, 0x0a, 3), {F1, F2, MR3}},
- {"ldfpd.a", M2, OpMXX6aHint (6, 0, 1, 0x0b, 0), {F1, F2, MR3}},
- {"ldfpd.a.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0b, 1), {F1, F2, MR3}},
- {"ldfpd.a.nta", M2, OpMXX6aHint (6, 0, 1, 0x0b, 3), {F1, F2, MR3}},
- {"ldfp8.a", M2, OpMXX6aHint (6, 0, 1, 0x09, 0), {F1, F2, MR3}},
- {"ldfp8.a.nt1", M2, OpMXX6aHint (6, 0, 1, 0x09, 1), {F1, F2, MR3}},
- {"ldfp8.a.nta", M2, OpMXX6aHint (6, 0, 1, 0x09, 3), {F1, F2, MR3}},
- {"ldfps.sa", M2, OpMXX6aHint (6, 0, 1, 0x0e, 0), {F1, F2, MR3}},
- {"ldfps.sa.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0e, 1), {F1, F2, MR3}},
- {"ldfps.sa.nta", M2, OpMXX6aHint (6, 0, 1, 0x0e, 3), {F1, F2, MR3}},
- {"ldfpd.sa", M2, OpMXX6aHint (6, 0, 1, 0x0f, 0), {F1, F2, MR3}},
- {"ldfpd.sa.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0f, 1), {F1, F2, MR3}},
- {"ldfpd.sa.nta", M2, OpMXX6aHint (6, 0, 1, 0x0f, 3), {F1, F2, MR3}},
- {"ldfp8.sa", M2, OpMXX6aHint (6, 0, 1, 0x0d, 0), {F1, F2, MR3}},
- {"ldfp8.sa.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0d, 1), {F1, F2, MR3}},
- {"ldfp8.sa.nta", M2, OpMXX6aHint (6, 0, 1, 0x0d, 3), {F1, F2, MR3}},
- {"ldfps.c.clr", M2, OpMXX6aHint (6, 0, 1, 0x22, 0), {F1, F2, MR3}},
- {"ldfps.c.clr.nt1", M2, OpMXX6aHint (6, 0, 1, 0x22, 1), {F1, F2, MR3}},
- {"ldfps.c.clr.nta", M2, OpMXX6aHint (6, 0, 1, 0x22, 3), {F1, F2, MR3}},
- {"ldfpd.c.clr", M2, OpMXX6aHint (6, 0, 1, 0x23, 0), {F1, F2, MR3}},
- {"ldfpd.c.clr.nt1", M2, OpMXX6aHint (6, 0, 1, 0x23, 1), {F1, F2, MR3}},
- {"ldfpd.c.clr.nta", M2, OpMXX6aHint (6, 0, 1, 0x23, 3), {F1, F2, MR3}},
- {"ldfp8.c.clr", M2, OpMXX6aHint (6, 0, 1, 0x21, 0), {F1, F2, MR3}},
- {"ldfp8.c.clr.nt1", M2, OpMXX6aHint (6, 0, 1, 0x21, 1), {F1, F2, MR3}},
- {"ldfp8.c.clr.nta", M2, OpMXX6aHint (6, 0, 1, 0x21, 3), {F1, F2, MR3}},
- {"ldfps.c.nc", M2, OpMXX6aHint (6, 0, 1, 0x26, 0), {F1, F2, MR3}},
- {"ldfps.c.nc.nt1", M2, OpMXX6aHint (6, 0, 1, 0x26, 1), {F1, F2, MR3}},
- {"ldfps.c.nc.nta", M2, OpMXX6aHint (6, 0, 1, 0x26, 3), {F1, F2, MR3}},
- {"ldfpd.c.nc", M2, OpMXX6aHint (6, 0, 1, 0x27, 0), {F1, F2, MR3}},
- {"ldfpd.c.nc.nt1", M2, OpMXX6aHint (6, 0, 1, 0x27, 1), {F1, F2, MR3}},
- {"ldfpd.c.nc.nta", M2, OpMXX6aHint (6, 0, 1, 0x27, 3), {F1, F2, MR3}},
- {"ldfp8.c.nc", M2, OpMXX6aHint (6, 0, 1, 0x25, 0), {F1, F2, MR3}},
- {"ldfp8.c.nc.nt1", M2, OpMXX6aHint (6, 0, 1, 0x25, 1), {F1, F2, MR3}},
- {"ldfp8.c.nc.nta", M2, OpMXX6aHint (6, 0, 1, 0x25, 3), {F1, F2, MR3}},
+ /* Floating-point load pair. */
+ {"ldfps", M2, OpMXX6aHint (6, 0, 1, 0x02, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfps.nt1", M2, OpMXX6aHint (6, 0, 1, 0x02, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfps.nta", M2, OpMXX6aHint (6, 0, 1, 0x02, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfpd", M2, OpMXX6aHint (6, 0, 1, 0x03, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.nt1", M2, OpMXX6aHint (6, 0, 1, 0x03, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.nta", M2, OpMXX6aHint (6, 0, 1, 0x03, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfp8", M2, OpMXX6aHint (6, 0, 1, 0x01, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.nt1", M2, OpMXX6aHint (6, 0, 1, 0x01, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.nta", M2, OpMXX6aHint (6, 0, 1, 0x01, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfps.s", M2, OpMXX6aHint (6, 0, 1, 0x06, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfps.s.nt1", M2, OpMXX6aHint (6, 0, 1, 0x06, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfps.s.nta", M2, OpMXX6aHint (6, 0, 1, 0x06, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.s", M2, OpMXX6aHint (6, 0, 1, 0x07, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.s.nt1", M2, OpMXX6aHint (6, 0, 1, 0x07, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.s.nta", M2, OpMXX6aHint (6, 0, 1, 0x07, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.s", M2, OpMXX6aHint (6, 0, 1, 0x05, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.s.nt1", M2, OpMXX6aHint (6, 0, 1, 0x05, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.s.nta", M2, OpMXX6aHint (6, 0, 1, 0x05, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfps.a", M2, OpMXX6aHint (6, 0, 1, 0x0a, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfps.a.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0a, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfps.a.nta", M2, OpMXX6aHint (6, 0, 1, 0x0a, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.a", M2, OpMXX6aHint (6, 0, 1, 0x0b, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.a.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0b, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.a.nta", M2, OpMXX6aHint (6, 0, 1, 0x0b, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.a", M2, OpMXX6aHint (6, 0, 1, 0x09, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.a.nt1", M2, OpMXX6aHint (6, 0, 1, 0x09, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.a.nta", M2, OpMXX6aHint (6, 0, 1, 0x09, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfps.sa", M2, OpMXX6aHint (6, 0, 1, 0x0e, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfps.sa.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0e, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfps.sa.nta", M2, OpMXX6aHint (6, 0, 1, 0x0e, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.sa", M2, OpMXX6aHint (6, 0, 1, 0x0f, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.sa.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0f, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.sa.nta", M2, OpMXX6aHint (6, 0, 1, 0x0f, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.sa", M2, OpMXX6aHint (6, 0, 1, 0x0d, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.sa.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0d, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.sa.nta", M2, OpMXX6aHint (6, 0, 1, 0x0d, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfps.c.clr", M2, OpMXX6aHint (6, 0, 1, 0x22, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfps.c.clr.nt1", M2, OpMXX6aHint (6, 0, 1, 0x22, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfps.c.clr.nta", M2, OpMXX6aHint (6, 0, 1, 0x22, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.c.clr", M2, OpMXX6aHint (6, 0, 1, 0x23, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.c.clr.nt1", M2, OpMXX6aHint (6, 0, 1, 0x23, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.c.clr.nta", M2, OpMXX6aHint (6, 0, 1, 0x23, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.c.clr", M2, OpMXX6aHint (6, 0, 1, 0x21, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.c.clr.nt1", M2, OpMXX6aHint (6, 0, 1, 0x21, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.c.clr.nta", M2, OpMXX6aHint (6, 0, 1, 0x21, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfps.c.nc", M2, OpMXX6aHint (6, 0, 1, 0x26, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfps.c.nc.nt1", M2, OpMXX6aHint (6, 0, 1, 0x26, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfps.c.nc.nta", M2, OpMXX6aHint (6, 0, 1, 0x26, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.c.nc", M2, OpMXX6aHint (6, 0, 1, 0x27, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.c.nc.nt1", M2, OpMXX6aHint (6, 0, 1, 0x27, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfpd.c.nc.nta", M2, OpMXX6aHint (6, 0, 1, 0x27, 3), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.c.nc", M2, OpMXX6aHint (6, 0, 1, 0x25, 0), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.c.nc.nt1", M2, OpMXX6aHint (6, 0, 1, 0x25, 1), {F1, F2, MR3}, EMPTY},
+ {"ldfp8.c.nc.nta", M2, OpMXX6aHint (6, 0, 1, 0x25, 3), {F1, F2, MR3}, EMPTY},
- /* floating-point load pair w/increment by immediate */
-#define LD(a,b,c) M2, OpMXX6aHint (6, 1, 1, a, b), {F1, F2, MR3, c}, POSTINC
+ /* Floating-point load pair w/increment by immediate. */
+#define LD(a,b,c) M2, OpMXX6aHint (6, 1, 1, a, b), {F1, F2, MR3, c}, POSTINC, 0, NULL
{"ldfps", LD (0x02, 0, C8)},
{"ldfps.nt1", LD (0x02, 1, C8)},
{"ldfps.nta", LD (0x02, 3, C8)},
@@ -871,26 +875,26 @@ struct ia64_opcode ia64_opcodes_m[] =
{"ldfp8.c.nc.nta", LD (0x25, 3, C16)},
#undef LD
- /* line prefetch */
- {"lfetch", M0, OpMXX6aHint (6, 0, 0, 0x2c, 0), {MR3}},
- {"lfetch.nt1", M0, OpMXX6aHint (6, 0, 0, 0x2c, 1), {MR3}},
- {"lfetch.nt2", M0, OpMXX6aHint (6, 0, 0, 0x2c, 2), {MR3}},
- {"lfetch.nta", M0, OpMXX6aHint (6, 0, 0, 0x2c, 3), {MR3}},
- {"lfetch.excl", M0, OpMXX6aHint (6, 0, 0, 0x2d, 0), {MR3}},
- {"lfetch.excl.nt1", M0, OpMXX6aHint (6, 0, 0, 0x2d, 1), {MR3}},
- {"lfetch.excl.nt2", M0, OpMXX6aHint (6, 0, 0, 0x2d, 2), {MR3}},
- {"lfetch.excl.nta", M0, OpMXX6aHint (6, 0, 0, 0x2d, 3), {MR3}},
- {"lfetch.fault", M0, OpMXX6aHint (6, 0, 0, 0x2e, 0), {MR3}},
- {"lfetch.fault.nt1", M0, OpMXX6aHint (6, 0, 0, 0x2e, 1), {MR3}},
- {"lfetch.fault.nt2", M0, OpMXX6aHint (6, 0, 0, 0x2e, 2), {MR3}},
- {"lfetch.fault.nta", M0, OpMXX6aHint (6, 0, 0, 0x2e, 3), {MR3}},
- {"lfetch.fault.excl", M0, OpMXX6aHint (6, 0, 0, 0x2f, 0), {MR3}},
- {"lfetch.fault.excl.nt1", M0, OpMXX6aHint (6, 0, 0, 0x2f, 1), {MR3}},
- {"lfetch.fault.excl.nt2", M0, OpMXX6aHint (6, 0, 0, 0x2f, 2), {MR3}},
- {"lfetch.fault.excl.nta", M0, OpMXX6aHint (6, 0, 0, 0x2f, 3), {MR3}},
+ /* Line prefetch. */
+ {"lfetch", M0, OpMXX6aHint (6, 0, 0, 0x2c, 0), {MR3}, EMPTY},
+ {"lfetch.nt1", M0, OpMXX6aHint (6, 0, 0, 0x2c, 1), {MR3}, EMPTY},
+ {"lfetch.nt2", M0, OpMXX6aHint (6, 0, 0, 0x2c, 2), {MR3}, EMPTY},
+ {"lfetch.nta", M0, OpMXX6aHint (6, 0, 0, 0x2c, 3), {MR3}, EMPTY},
+ {"lfetch.excl", M0, OpMXX6aHint (6, 0, 0, 0x2d, 0), {MR3}, EMPTY},
+ {"lfetch.excl.nt1", M0, OpMXX6aHint (6, 0, 0, 0x2d, 1), {MR3}, EMPTY},
+ {"lfetch.excl.nt2", M0, OpMXX6aHint (6, 0, 0, 0x2d, 2), {MR3}, EMPTY},
+ {"lfetch.excl.nta", M0, OpMXX6aHint (6, 0, 0, 0x2d, 3), {MR3}, EMPTY},
+ {"lfetch.fault", M0, OpMXX6aHint (6, 0, 0, 0x2e, 0), {MR3}, EMPTY},
+ {"lfetch.fault.nt1", M0, OpMXX6aHint (6, 0, 0, 0x2e, 1), {MR3}, EMPTY},
+ {"lfetch.fault.nt2", M0, OpMXX6aHint (6, 0, 0, 0x2e, 2), {MR3}, EMPTY},
+ {"lfetch.fault.nta", M0, OpMXX6aHint (6, 0, 0, 0x2e, 3), {MR3}, EMPTY},
+ {"lfetch.fault.excl", M0, OpMXX6aHint (6, 0, 0, 0x2f, 0), {MR3}, EMPTY},
+ {"lfetch.fault.excl.nt1", M0, OpMXX6aHint (6, 0, 0, 0x2f, 1), {MR3}, EMPTY},
+ {"lfetch.fault.excl.nt2", M0, OpMXX6aHint (6, 0, 0, 0x2f, 2), {MR3}, EMPTY},
+ {"lfetch.fault.excl.nta", M0, OpMXX6aHint (6, 0, 0, 0x2f, 3), {MR3}, EMPTY},
- /* line prefetch w/increment by register */
-#define LFETCHINCREG(c,h) M0, OpMXX6aHint (6, 1, 0, c, h), {MR3, R2}, POSTINC
+ /* Line prefetch w/increment by register. */
+#define LFETCHINCREG(c,h) M0, OpMXX6aHint (6, 1, 0, c, h), {MR3, R2}, POSTINC, 0, NULL
{"lfetch", LFETCHINCREG (0x2c, 0)},
{"lfetch.nt1", LFETCHINCREG (0x2c, 1)},
{"lfetch.nt2", LFETCHINCREG (0x2c, 2)},
@@ -909,14 +913,14 @@ struct ia64_opcode ia64_opcodes_m[] =
{"lfetch.fault.excl.nta", LFETCHINCREG (0x2f, 3)},
#undef LFETCHINCREG
- /* semaphore operations */
- {"setf.sig", M, OpMXX6a (6, 0, 1, 0x1c), {F1, R2}},
- {"setf.exp", M, OpMXX6a (6, 0, 1, 0x1d), {F1, R2}},
- {"setf.s", M, OpMXX6a (6, 0, 1, 0x1e), {F1, R2}},
- {"setf.d", M, OpMXX6a (6, 0, 1, 0x1f), {F1, R2}},
+ /* Semaphore operations. */
+ {"setf.sig", M, OpMXX6a (6, 0, 1, 0x1c), {F1, R2}, EMPTY},
+ {"setf.exp", M, OpMXX6a (6, 0, 1, 0x1d), {F1, R2}, EMPTY},
+ {"setf.s", M, OpMXX6a (6, 0, 1, 0x1e), {F1, R2}, EMPTY},
+ {"setf.d", M, OpMXX6a (6, 0, 1, 0x1f), {F1, R2}, EMPTY},
- /* floating-point load w/increment by immediate */
-#define FLDINCIMMED(c,h) M, OpX6aHint (7, c, h), {F1, MR3, IMM9b}, POSTINC
+ /* Floating-point load w/increment by immediate. */
+#define FLDINCIMMED(c,h) M, OpX6aHint (7, c, h), {F1, MR3, IMM9b}, POSTINC, 0, NULL
{"ldfs", FLDINCIMMED (0x02, 0)},
{"ldfs.nt1", FLDINCIMMED (0x02, 1)},
{"ldfs.nta", FLDINCIMMED (0x02, 3)},
@@ -994,8 +998,8 @@ struct ia64_opcode ia64_opcodes_m[] =
{"ldfe.c.nc.nta", FLDINCIMMED (0x24, 3)},
#undef FLDINCIMMED
- /* floating-point store w/increment by immediate */
-#define FSTINCIMMED(c,h) M, OpX6aHint (7, c, h), {MR3, F2, IMM9a}, POSTINC
+ /* Floating-point store w/increment by immediate. */
+#define FSTINCIMMED(c,h) M, OpX6aHint (7, c, h), {MR3, F2, IMM9a}, POSTINC, 0, NULL
{"stfs", FSTINCIMMED (0x32, 0)},
{"stfs.nta", FSTINCIMMED (0x32, 3)},
{"stfd", FSTINCIMMED (0x33, 0)},
@@ -1008,8 +1012,8 @@ struct ia64_opcode ia64_opcodes_m[] =
{"stf.spill.nta", FSTINCIMMED (0x3b, 3)},
#undef FSTINCIMMED
- /* line prefetch w/increment by immediate */
-#define LFETCHINCIMMED(c,h) M0, OpX6aHint (7, c, h), {MR3, IMM9b}, POSTINC
+ /* Line prefetch w/increment by immediate. */
+#define LFETCHINCIMMED(c,h) M0, OpX6aHint (7, c, h), {MR3, IMM9b}, POSTINC, 0, NULL
{"lfetch", LFETCHINCIMMED (0x2c, 0)},
{"lfetch.nt1", LFETCHINCIMMED (0x2c, 1)},
{"lfetch.nt2", LFETCHINCIMMED (0x2c, 2)},
@@ -1028,7 +1032,7 @@ struct ia64_opcode ia64_opcodes_m[] =
{"lfetch.fault.excl.nta", LFETCHINCIMMED (0x2f, 3)},
#undef LFETCHINCIMMED
- {0}
+ {NULL, 0, 0, 0, 0, {0}, 0, 0, NULL}
};
#undef M0
@@ -1058,3 +1062,4 @@ struct ia64_opcode ia64_opcodes_m[] =
#undef OpXX6aHint
#undef OpMXX6a
#undef OpMXX6aHint
+#undef EMPTY
diff --git a/opcodes/ia64-opc-x.c b/opcodes/ia64-opc-x.c
index 5f382fd6dd5..9d9a6c109cc 100644
--- a/opcodes/ia64-opc-x.c
+++ b/opcodes/ia64-opc-x.c
@@ -1,5 +1,5 @@
/* ia64-opc-x.c -- IA-64 `X' opcode table.
- Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
Contributed by Timothy Wall <twall@cygnus.com>
This file is part of GDB, GAS, and the GNU binutils.
@@ -21,11 +21,11 @@
#include "ia64-opc.h"
-/* identify the specific X-unit type */
+/* Identify the specific X-unit type. */
#define X0 IA64_TYPE_X, 0
#define X IA64_TYPE_X, 1
-/* instruction bit fields: */
+/* Instruction bit fields: */
#define bBtype(x) (((ia64_insn) ((x) & 0x7)) << 6)
#define bD(x) (((ia64_insn) ((x) & 0x1)) << 35)
#define bPa(x) (((ia64_insn) ((x) & 0x1)) << 12)
@@ -58,36 +58,38 @@
struct ia64_opcode ia64_opcodes_x[] =
{
- {"break.x", X0, OpX3X6 (0, 0, 0x00), {IMMU62}},
- {"nop.x", X0, OpX3X6 (0, 0, 0x01), {IMMU62}},
- {"movl", X, OpVc (6, 0), {R1, IMMU64}},
+ {"break.x", X0, OpX3X6 (0, 0, 0x00), {IMMU62}, 0, 0, NULL},
+ {"nop.x", X0, OpX3X6 (0, 0, 0x01), {IMMU62}, 0, 0, NULL},
+ {"movl", X, OpVc (6, 0), {R1, IMMU64}, 0, 0, NULL},
#define BRL(a,b) \
- X0, OpBtypePaWhaDPr (0xC, 0, a, 0, b, 0), {TGT64}, 0
- {"brl.few", BRL (0, 0) | PSEUDO},
- {"brl", BRL (0, 0) | PSEUDO},
- {"brl.few.clr", BRL (0, 1) | PSEUDO},
- {"brl.clr", BRL (0, 1) | PSEUDO},
- {"brl.many", BRL (1, 0) | PSEUDO},
- {"brl.many.clr", BRL (1, 1) | PSEUDO},
+ X0, OpBtypePaWhaDPr (0xC, 0, a, 0, b, 0), {TGT64}, PSEUDO, 0, NULL
+ {"brl.few", BRL (0, 0)},
+ {"brl", BRL (0, 0)},
+ {"brl.few.clr", BRL (0, 1)},
+ {"brl.clr", BRL (0, 1)},
+ {"brl.many", BRL (1, 0)},
+ {"brl.many.clr", BRL (1, 1)},
#undef BRL
#define BRL(a,b,c) \
- X0, OpBtypePaWhaD (0xC, 0, a, b, c), {TGT64}, 0
+ X0, OpBtypePaWhaD (0xC, 0, a, b, c), {TGT64}, 0, 0, NULL
+#define BRLP(a,b,c) \
+ X0, OpBtypePaWhaD (0xC, 0, a, b, c), {TGT64}, PSEUDO, 0, NULL
{"brl.cond.sptk.few", BRL (0, 0, 0)},
- {"brl.cond.sptk", BRL (0, 0, 0) | PSEUDO},
+ {"brl.cond.sptk", BRLP (0, 0, 0)},
{"brl.cond.sptk.few.clr", BRL (0, 0, 1)},
- {"brl.cond.sptk.clr", BRL (0, 0, 1) | PSEUDO},
+ {"brl.cond.sptk.clr", BRLP (0, 0, 1)},
{"brl.cond.spnt.few", BRL (0, 1, 0)},
- {"brl.cond.spnt", BRL (0, 1, 0) | PSEUDO},
+ {"brl.cond.spnt", BRLP (0, 1, 0)},
{"brl.cond.spnt.few.clr", BRL (0, 1, 1)},
- {"brl.cond.spnt.clr", BRL (0, 1, 1) | PSEUDO},
+ {"brl.cond.spnt.clr", BRLP (0, 1, 1)},
{"brl.cond.dptk.few", BRL (0, 2, 0)},
- {"brl.cond.dptk", BRL (0, 2, 0) | PSEUDO},
+ {"brl.cond.dptk", BRLP (0, 2, 0)},
{"brl.cond.dptk.few.clr", BRL (0, 2, 1)},
- {"brl.cond.dptk.clr", BRL (0, 2, 1) | PSEUDO},
+ {"brl.cond.dptk.clr", BRLP (0, 2, 1)},
{"brl.cond.dpnt.few", BRL (0, 3, 0)},
- {"brl.cond.dpnt", BRL (0, 3, 0) | PSEUDO},
+ {"brl.cond.dpnt", BRLP (0, 3, 0)},
{"brl.cond.dpnt.few.clr", BRL (0, 3, 1)},
- {"brl.cond.dpnt.clr", BRL (0, 3, 1) | PSEUDO},
+ {"brl.cond.dpnt.clr", BRLP (0, 3, 1)},
{"brl.cond.sptk.many", BRL (1, 0, 0)},
{"brl.cond.sptk.many.clr", BRL (1, 0, 1)},
{"brl.cond.spnt.many", BRL (1, 1, 0)},
@@ -97,21 +99,21 @@ struct ia64_opcode ia64_opcodes_x[] =
{"brl.cond.dpnt.many", BRL (1, 3, 0)},
{"brl.cond.dpnt.many.clr", BRL (1, 3, 1)},
{"brl.sptk.few", BRL (0, 0, 0)},
- {"brl.sptk", BRL (0, 0, 0) | PSEUDO},
+ {"brl.sptk", BRLP (0, 0, 0)},
{"brl.sptk.few.clr", BRL (0, 0, 1)},
- {"brl.sptk.clr", BRL (0, 0, 1) | PSEUDO},
+ {"brl.sptk.clr", BRLP (0, 0, 1)},
{"brl.spnt.few", BRL (0, 1, 0)},
- {"brl.spnt", BRL (0, 1, 0) | PSEUDO},
+ {"brl.spnt", BRLP (0, 1, 0)},
{"brl.spnt.few.clr", BRL (0, 1, 1)},
- {"brl.spnt.clr", BRL (0, 1, 1) | PSEUDO},
+ {"brl.spnt.clr", BRLP (0, 1, 1)},
{"brl.dptk.few", BRL (0, 2, 0)},
- {"brl.dptk", BRL (0, 2, 0) | PSEUDO},
+ {"brl.dptk", BRLP (0, 2, 0)},
{"brl.dptk.few.clr", BRL (0, 2, 1)},
- {"brl.dptk.clr", BRL (0, 2, 1) | PSEUDO},
+ {"brl.dptk.clr", BRLP (0, 2, 1)},
{"brl.dpnt.few", BRL (0, 3, 0)},
- {"brl.dpnt", BRL (0, 3, 0) | PSEUDO},
+ {"brl.dpnt", BRLP (0, 3, 0)},
{"brl.dpnt.few.clr", BRL (0, 3, 1)},
- {"brl.dpnt.clr", BRL (0, 3, 1) | PSEUDO},
+ {"brl.dpnt.clr", BRLP (0, 3, 1)},
{"brl.sptk.many", BRL (1, 0, 0)},
{"brl.sptk.many.clr", BRL (1, 0, 1)},
{"brl.spnt.many", BRL (1, 1, 0)},
@@ -121,23 +123,25 @@ struct ia64_opcode ia64_opcodes_x[] =
{"brl.dpnt.many", BRL (1, 3, 0)},
{"brl.dpnt.many.clr", BRL (1, 3, 1)},
#undef BRL
-#define BRL(a,b,c) X, OpPaWhaD (0xD, a, b, c), {B1, TGT64}, 0
+#undef BRLP
+#define BRL(a,b,c) X, OpPaWhaD (0xD, a, b, c), {B1, TGT64}, 0, 0, NULL
+#define BRLP(a,b,c) X, OpPaWhaD (0xD, a, b, c), {B1, TGT64}, PSEUDO, 0, NULL
{"brl.call.sptk.few", BRL (0, 0, 0)},
- {"brl.call.sptk", BRL (0, 0, 0) | PSEUDO},
+ {"brl.call.sptk", BRLP (0, 0, 0)},
{"brl.call.sptk.few.clr", BRL (0, 0, 1)},
- {"brl.call.sptk.clr", BRL (0, 0, 1) | PSEUDO},
+ {"brl.call.sptk.clr", BRLP (0, 0, 1)},
{"brl.call.spnt.few", BRL (0, 1, 0)},
- {"brl.call.spnt", BRL (0, 1, 0) | PSEUDO},
+ {"brl.call.spnt", BRLP (0, 1, 0)},
{"brl.call.spnt.few.clr", BRL (0, 1, 1)},
- {"brl.call.spnt.clr", BRL (0, 1, 1) | PSEUDO},
+ {"brl.call.spnt.clr", BRLP (0, 1, 1)},
{"brl.call.dptk.few", BRL (0, 2, 0)},
- {"brl.call.dptk", BRL (0, 2, 0) | PSEUDO},
+ {"brl.call.dptk", BRLP (0, 2, 0)},
{"brl.call.dptk.few.clr", BRL (0, 2, 1)},
- {"brl.call.dptk.clr", BRL (0, 2, 1) | PSEUDO},
+ {"brl.call.dptk.clr", BRLP (0, 2, 1)},
{"brl.call.dpnt.few", BRL (0, 3, 0)},
- {"brl.call.dpnt", BRL (0, 3, 0) | PSEUDO},
+ {"brl.call.dpnt", BRLP (0, 3, 0)},
{"brl.call.dpnt.few.clr", BRL (0, 3, 1)},
- {"brl.call.dpnt.clr", BRL (0, 3, 1) | PSEUDO},
+ {"brl.call.dpnt.clr", BRLP (0, 3, 1)},
{"brl.call.sptk.many", BRL (1, 0, 0)},
{"brl.call.sptk.many.clr", BRL (1, 0, 1)},
{"brl.call.spnt.many", BRL (1, 1, 0)},
@@ -147,7 +151,8 @@ struct ia64_opcode ia64_opcodes_x[] =
{"brl.call.dpnt.many", BRL (1, 3, 0)},
{"brl.call.dpnt.many.clr", BRL (1, 3, 1)},
#undef BRL
- {0}
+#undef BRLP
+ {NULL, 0, 0, 0, 0, {0}, 0, 0, NULL}
};
#undef X0
diff --git a/opcodes/m68hc11-dis.c b/opcodes/m68hc11-dis.c
index c721d16e0c4..bcd3ee5103f 100644
--- a/opcodes/m68hc11-dis.c
+++ b/opcodes/m68hc11-dis.c
@@ -495,55 +495,6 @@ print_insn (memaddr, info, arch)
reg_dst_table[(buffer[0] & 7)]);
}
- /* M6811_OP_BITMASK and M6811_OP_JUMP_REL must be treated separately
- and in that order. The brset/brclr insn have a bitmask and then
- a relative branch offset. */
- if (format & M6811_OP_BITMASK)
- {
- status = read_memory (memaddr + pos, &buffer[0], 1, info);
- if (status != 0)
- {
- return status;
- }
- pos++;
- (*info->fprintf_func) (info->stream, " #$%02x%s",
- buffer[0] & 0x0FF,
- (format & M6811_OP_JUMP_REL ? " " : ""));
- format &= ~M6811_OP_BITMASK;
- }
- if (format & M6811_OP_JUMP_REL)
- {
- int val;
-
- status = read_memory (memaddr + pos, &buffer[0], 1, info);
- if (status != 0)
- {
- return status;
- }
-
- pos++;
- val = (buffer[0] & 0x80) ? buffer[0] | 0xFFFFFF00 : buffer[0];
- (*info->print_address_func) (memaddr + pos + val, info);
- format &= ~M6811_OP_JUMP_REL;
- }
- else if (format & M6812_OP_JUMP_REL16)
- {
- int val;
-
- status = read_memory (memaddr + pos, &buffer[0], 2, info);
- if (status != 0)
- {
- return status;
- }
-
- pos += 2;
- val = ((buffer[0] << 8) | (buffer[1] & 0x0FF));
- if (val & 0x8000)
- val |= 0xffff0000;
-
- (*info->print_address_func) (memaddr + pos + val, info);
- format &= ~M6812_OP_JUMP_REL16;
- }
if (format & (M6811_OP_IMM16 | M6811_OP_IND16))
{
int val;
@@ -641,6 +592,56 @@ print_insn (memaddr, info, arch)
(*info->print_address_func) (val, info);
}
+ /* M6811_OP_BITMASK and M6811_OP_JUMP_REL must be treated separately
+ and in that order. The brset/brclr insn have a bitmask and then
+ a relative branch offset. */
+ if (format & M6811_OP_BITMASK)
+ {
+ status = read_memory (memaddr + pos, &buffer[0], 1, info);
+ if (status != 0)
+ {
+ return status;
+ }
+ pos++;
+ (*info->fprintf_func) (info->stream, " #$%02x%s",
+ buffer[0] & 0x0FF,
+ (format & M6811_OP_JUMP_REL ? " " : ""));
+ format &= ~M6811_OP_BITMASK;
+ }
+ if (format & M6811_OP_JUMP_REL)
+ {
+ int val;
+
+ status = read_memory (memaddr + pos, &buffer[0], 1, info);
+ if (status != 0)
+ {
+ return status;
+ }
+
+ pos++;
+ val = (buffer[0] & 0x80) ? buffer[0] | 0xFFFFFF00 : buffer[0];
+ (*info->print_address_func) (memaddr + pos + val, info);
+ format &= ~M6811_OP_JUMP_REL;
+ }
+ else if (format & M6812_OP_JUMP_REL16)
+ {
+ int val;
+
+ status = read_memory (memaddr + pos, &buffer[0], 2, info);
+ if (status != 0)
+ {
+ return status;
+ }
+
+ pos += 2;
+ val = ((buffer[0] << 8) | (buffer[1] & 0x0FF));
+ if (val & 0x8000)
+ val |= 0xffff0000;
+
+ (*info->print_address_func) (memaddr + pos + val, info);
+ format &= ~M6812_OP_JUMP_REL16;
+ }
+
if (format & M6812_OP_PAGE)
{
int val;
diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c
index 0c4cfe474a8..3df7dc16b06 100644
--- a/opcodes/ppc-dis.c
+++ b/opcodes/ppc-dis.c
@@ -52,13 +52,13 @@ powerpc_dialect(info)
|| strcmp (info->disassembler_options, "booke32") == 0
|| strcmp (info->disassembler_options, "booke64") == 0))
dialect |= PPC_OPCODE_BOOKE | PPC_OPCODE_BOOKE64;
- else
+ else
if ((info->mach == bfd_mach_ppc_e500)
- || (info->disassembler_options
+ || (info->disassembler_options
&& ( strcmp (info->disassembler_options, "e500") == 0
|| strcmp (info->disassembler_options, "e500x2") == 0)))
{
- dialect |= PPC_OPCODE_BOOKE
+ dialect |= PPC_OPCODE_BOOKE
| PPC_OPCODE_SPE | PPC_OPCODE_ISEL
| PPC_OPCODE_EFS | PPC_OPCODE_BRLOCK
| PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK
@@ -66,7 +66,7 @@ powerpc_dialect(info)
/* efs* and AltiVec conflict. */
dialect &= ~PPC_OPCODE_ALTIVEC;
}
- else
+ else
if (info->disassembler_options
&& (strcmp (info->disassembler_options, "efs") == 0))
{
@@ -177,7 +177,7 @@ print_insn_powerpc (memaddr, info, bigendian, dialect)
continue;
if ((dialect & PPC_OPCODE_EFS) && (opcode->flags & PPC_OPCODE_ALTIVEC))
- continue;
+ continue;
/* Make two passes over the operands. First see if any of them
have extraction functions, and, if they do, make sure the
@@ -262,14 +262,9 @@ print_insn_powerpc (memaddr, info, bigendian, dialect)
cr = value >> 2;
if (cr != 0)
- (*info->fprintf_func) (info->stream, "4*cr%d", cr);
+ (*info->fprintf_func) (info->stream, "4*cr%d+", cr);
cc = value & 3;
- if (cc != 0)
- {
- if (cr != 0)
- (*info->fprintf_func) (info->stream, "+");
- (*info->fprintf_func) (info->stream, "%s", cbnames[cc]);
- }
+ (*info->fprintf_func) (info->stream, "%s", cbnames[cc]);
}
}
@@ -304,7 +299,7 @@ print_ppc_disassembler_options (FILE * stream)
fprintf (stream, "\n\
The following PPC specific disassembler options are supported for use with\n\
the -M switch:\n");
-
+
fprintf (stream, " booke|booke32|booke64 Disassemble the BookE instructions\n");
fprintf (stream, " e500|e500x2 Disassemble the e500 instructions\n");
fprintf (stream, " efs Disassemble the EFS instructions\n");
diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
index f6c9ce4df30..dc014d28a9f 100644
--- a/opcodes/ppc-opc.c
+++ b/opcodes/ppc-opc.c
@@ -544,15 +544,15 @@ const struct powerpc_operand powerpc_operands[] =
/* The other UIMM field in a half word EVX form instruction. */
#define EVUIMM_2 EVUIMM + 1
- { 5, 11, insert_ev2, extract_ev2, PPC_OPERAND_PARENS },
+ { 32, 11, insert_ev2, extract_ev2, PPC_OPERAND_PARENS },
/* The other UIMM field in a word EVX form instruction. */
#define EVUIMM_4 EVUIMM_2 + 1
- { 5, 11, insert_ev4, extract_ev4, PPC_OPERAND_PARENS },
+ { 32, 11, insert_ev4, extract_ev4, PPC_OPERAND_PARENS },
/* The other UIMM field in a double EVX form instruction. */
#define EVUIMM_8 EVUIMM_4 + 1
- { 8, 11, insert_ev8, extract_ev8, PPC_OPERAND_PARENS },
+ { 32, 11, insert_ev8, extract_ev8, PPC_OPERAND_PARENS },
/* The WS field. */
#define WS EVUIMM_8 + 1
@@ -2124,10 +2124,10 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "evsrwiu", VX(4, 546), VX_MASK, PPCSPE, { RD, RA, EVUIMM } },
{ "evsplati", VX(4, 553), VX_MASK, PPCSPE, { RD, SIMM } },
{ "evsplatfi", VX(4, 555), VX_MASK, PPCSPE, { RD, SIMM } },
-{ "evmergehi", VX(4, 556), VX_MASK, PPCSPE, { RD, RA, RB } },
-{ "evmergelo", VX(4, 557), VX_MASK, PPCSPE, { RD, RA, RB } },
-{ "evmergehilo",VX(4,558), VX_MASK, PPCSPE, { RD, RA, RB } },
-{ "evmergelohi",VX(4,559), VX_MASK, PPCSPE, { RD, RA, RB } },
+{ "evmergehi", VX(4, 556), VX_MASK, PPCSPE, { RS, RA, RB } },
+{ "evmergelo", VX(4, 557), VX_MASK, PPCSPE, { RS, RA, RB } },
+{ "evmergehilo",VX(4,558), VX_MASK, PPCSPE, { RS, RA, RB } },
+{ "evmergelohi",VX(4,559), VX_MASK, PPCSPE, { RS, RA, RB } },
{ "evcmpgts", VX(4, 561), VX_MASK, PPCSPE, { CRFD, RA, RB } },
{ "evcmpgtu", VX(4, 560), VX_MASK, PPCSPE, { CRFD, RA, RB } },
diff --git a/opcodes/sparc-opc.c b/opcodes/sparc-opc.c
index 5c06d01df14..00102323f2b 100644
--- a/opcodes/sparc-opc.c
+++ b/opcodes/sparc-opc.c
@@ -1440,25 +1440,25 @@ cond ("bz", "tz", CONDZ, F_CONDBR|F_ALIAS), /* for e */
FBRX(fop, F2(0, 5)|COND(mask), F2(~0, ~5)|COND(~(mask)), flags), /* v9 */ \
FBR(fop, F2(0, 6)|COND(mask), F2(~0, ~6)|COND(~(mask)), flags)
-CONDFC ("fb", "cb", 0x8, 0),
-CONDFCL ("fba", "cba", 0x8, F_ALIAS),
-CONDFC ("fbe", "cb0", 0x9, 0),
-CONDF ("fbz", 0x9, F_ALIAS),
-CONDFC ("fbg", "cb2", 0x6, 0),
-CONDFC ("fbge", "cb02", 0xb, 0),
-CONDFC ("fbl", "cb1", 0x4, 0),
-CONDFC ("fble", "cb01", 0xd, 0),
-CONDFC ("fblg", "cb12", 0x2, 0),
-CONDFCL ("fbn", "cbn", 0x0, 0),
-CONDFC ("fbne", "cb123", 0x1, 0),
-CONDF ("fbnz", 0x1, F_ALIAS),
-CONDFC ("fbo", "cb012", 0xf, 0),
-CONDFC ("fbu", "cb3", 0x7, 0),
-CONDFC ("fbue", "cb03", 0xa, 0),
-CONDFC ("fbug", "cb23", 0x5, 0),
-CONDFC ("fbuge", "cb023", 0xc, 0),
-CONDFC ("fbul", "cb13", 0x3, 0),
-CONDFC ("fbule", "cb013", 0xe, 0),
+CONDFC ("fb", "cb", 0x8, F_UNBR),
+CONDFCL ("fba", "cba", 0x8, F_UNBR|F_ALIAS),
+CONDFC ("fbe", "cb0", 0x9, F_CONDBR),
+CONDF ("fbz", 0x9, F_CONDBR|F_ALIAS),
+CONDFC ("fbg", "cb2", 0x6, F_CONDBR),
+CONDFC ("fbge", "cb02", 0xb, F_CONDBR),
+CONDFC ("fbl", "cb1", 0x4, F_CONDBR),
+CONDFC ("fble", "cb01", 0xd, F_CONDBR),
+CONDFC ("fblg", "cb12", 0x2, F_CONDBR),
+CONDFCL ("fbn", "cbn", 0x0, F_UNBR),
+CONDFC ("fbne", "cb123", 0x1, F_CONDBR),
+CONDF ("fbnz", 0x1, F_CONDBR|F_ALIAS),
+CONDFC ("fbo", "cb012", 0xf, F_CONDBR),
+CONDFC ("fbu", "cb3", 0x7, F_CONDBR),
+CONDFC ("fbue", "cb03", 0xa, F_CONDBR),
+CONDFC ("fbug", "cb23", 0x5, F_CONDBR),
+CONDFC ("fbuge", "cb023", 0xc, F_CONDBR),
+CONDFC ("fbul", "cb13", 0x3, F_CONDBR),
+CONDFC ("fbule", "cb013", 0xe, F_CONDBR),
#undef CONDFC
#undef CONDFCL
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index ae252fd2769..1e495767be6 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,16 @@
+2002-11-13 Andrew Cagney <cagney@redhat.com>
+
+ * run.c (main): Remove SIM_HAVE_ENVIRONMENT from #endif.
+
+2002-11-06 Richard Sandiford <rsandifo@redhat.com>
+
+ * Make-common.in (SIM_EXTRA_DISTCLEAN): New macro.
+ (distclean): Depend on it.
+
+2002-10-14 Alan Modra <amodra@bigpond.net.au>
+
+ * cgen-trace.h: Test __BFD_H_SEEN__ rather than BFD_VERSION.
+
2002-08-29 Dave Brolley <brolley@redhat.com>
* Make-common.in (CGEN_READ_SCM): Remove ../../cgen/stamp-cgen.
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 1f29f6a13f6..e3e12395c6e 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -134,6 +134,8 @@ SIM_EXTRA_ALL =
SIM_EXTRA_INSTALL =
# Dependency of `clean' to clean any extra files.
SIM_EXTRA_CLEAN =
+# Likewise `distclean'
+SIM_EXTRA_DISTCLEAN =
# Every time a new general purpose source file was added every target's
# Makefile.in needed to be updated to include the file in SIM_OBJS.
@@ -622,7 +624,7 @@ clean: $(SIM_EXTRA_CLEAN)
fi
rm -f tmp-mloop.hin tmp-mloop.h tmp-mloop.cin tmp-mloop.c
-distclean mostlyclean maintainer-clean realclean: clean
+distclean mostlyclean maintainer-clean realclean: clean $(SIM_EXTRA_DISTCLEAN)
rm -f TAGS
rm -f Makefile config.cache config.log config.status .gdbinit
rm -f tconfig.h config.h stamp-h
diff --git a/sim/common/cgen-trace.h b/sim/common/cgen-trace.h
index 5e796fbf061..be1dd1dff4e 100644
--- a/sim/common/cgen-trace.h
+++ b/sim/common/cgen-trace.h
@@ -78,7 +78,7 @@ typedef struct {
extern int sim_disasm_sprintf (SFILE *, const char *, ...);
/* For opcodes based disassemblers. */
-#ifdef BFD_VERSION
+#ifdef __BFD_H_SEEN__
struct disassemble_info;
extern int
sim_disasm_read_memory (bfd_vma memaddr_, bfd_byte *myaddr_, int length_,
diff --git a/sim/common/run.c b/sim/common/run.c
index d8c86cdd701..ca3194b5277 100644
--- a/sim/common/run.c
+++ b/sim/common/run.c
@@ -156,7 +156,7 @@ main (ac, av)
target. */
operating_p = 1;
break;
-#endif SIM_HAVE_ENVIRONMENT
+#endif
#ifdef SIM_HAVE_PROFILE
case 'p':
sim_set_profile (atoi (optarg));
diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog
index 320eb98b1c4..9c42d358561 100644
--- a/sim/d10v/ChangeLog
+++ b/sim/d10v/ChangeLog
@@ -1,3 +1,7 @@
+2002-11-13 Andrew Cagney <cagney@redhat.com>
+
+ * simops.c: Include <string.h>.
+
2002-06-17 Andrew Cagney <cagney@redhat.com>
* d10v_sim.h (SET_PSW_BIT): Add cast to avoid inverting an enum.
diff --git a/sim/d10v/simops.c b/sim/d10v/simops.c
index 1c0ecfe7479..fbffa4d5602 100644
--- a/sim/d10v/simops.c
+++ b/sim/d10v/simops.c
@@ -7,6 +7,9 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
#include "d10v_sim.h"
#include "simops.h"
diff --git a/sim/igen/ChangeLog b/sim/igen/ChangeLog
index 9484c2226ef..4e4b3a4a90d 100644
--- a/sim/igen/ChangeLog
+++ b/sim/igen/ChangeLog
@@ -1,3 +1,9 @@
+2002-11-06 Richard Sandiford <rsandifo@redhat.com>
+
+ * gen-engine.c (print_engine_issue_prefix_hook): Don't add the
+ global prefix to ENGINE_ISSUE_PREFIX_HOOK.
+ (print_engine_issue_postfix_hook): Likewise ENGINE_ISSUE_POSTFIX_HOOK.
+
2002-08-28 Dave Brolley <brolley@redhat.com>
* gen-support.c (gen_support_h): Generate
diff --git a/sim/igen/gen-engine.c b/sim/igen/gen-engine.c
index ee27e680317..1de477d8387 100644
--- a/sim/igen/gen-engine.c
+++ b/sim/igen/gen-engine.c
@@ -41,10 +41,8 @@ print_engine_issue_prefix_hook (lf *file)
{
lf_printf (file, "\n");
lf_indent_suppress (file);
- lf_printf (file, "#if defined (%sENGINE_ISSUE_PREFIX_HOOK)\n",
- options.module.global.prefix.l);
- lf_printf (file, "%sENGINE_ISSUE_PREFIX_HOOK();\n",
- options.module.global.prefix.l);
+ lf_printf (file, "#if defined (ENGINE_ISSUE_PREFIX_HOOK)\n");
+ lf_printf (file, "ENGINE_ISSUE_PREFIX_HOOK();\n");
lf_indent_suppress (file);
lf_printf (file, "#endif\n");
lf_printf (file, "\n");
@@ -55,10 +53,8 @@ print_engine_issue_postfix_hook (lf *file)
{
lf_printf (file, "\n");
lf_indent_suppress (file);
- lf_printf (file, "#if defined (%sENGINE_ISSUE_POSTFIX_HOOK)\n",
- options.module.global.prefix.l);
- lf_printf (file, "%sENGINE_ISSUE_POSTFIX_HOOK();\n",
- options.module.global.prefix.l);
+ lf_printf (file, "#if defined (ENGINE_ISSUE_POSTFIX_HOOK)\n");
+ lf_printf (file, "ENGINE_ISSUE_POSTFIX_HOOK();\n");
lf_indent_suppress (file);
lf_printf (file, "#endif\n");
lf_printf (file, "\n");
diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog
index ec587595082..60b41f7c552 100644
--- a/sim/sh/ChangeLog
+++ b/sim/sh/ChangeLog
@@ -1,3 +1,11 @@
+Fri Oct 11 16:22:28 2002 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * interp.c (trap): Return int. Take extra parameter for address
+ of the trap instruction. Changed all callers.
+ Add case 33 for profiling.
+ * gencode.c (trapa): Handle trap 33 using the trap function.
+ Add read of vector for generic traps.
+
Wed Jul 17 19:36:38 2002 J"orn Rennecke <joern.rennecke@superh.com>
* Makefile.in (interp.o): Depend on $(srcroot)/include/gdb/sim-sh.h.
diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c
index ba6ee4c1bc6..8e2445a7e11 100644
--- a/sim/sh/gencode.c
+++ b/sim/sh/gencode.c
@@ -577,7 +577,7 @@ op tab[] =
},
{ "", "nm", "mac.l @<REG_M>+,@<REG_N>+", "0000nnnnmmmm1111",
- "trap (255,R0,memory,maskl,maskw, endianw);",
+ "trap (255, R0, PC, memory, maskl, maskw, endianw);",
"/* FIXME: mac.l support */",
},
@@ -951,8 +951,7 @@ op tab[] =
},
{ "", "", "sleep", "0000000000011011",
- "nip = PC;",
- "trap (0xc3, R0, memory, maskl, maskw, endianw);",
+ "nip += trap (0xc3, R0, PC, memory, maskl, maskw, endianw);",
},
{ "n", "", "stc <CREG_M>,<REG_N>", "0000nnnnmmmm0010",
@@ -1029,37 +1028,25 @@ op tab[] =
},
{ "0", "", "trapa #<imm>", "11000011i8*1....",
-#if 0
- /* SH-[12] */
"long imm = 0xff & i;",
- "if (i==0xc3)",
- " PC-=2;",
- "if (i<20||i==34||i==0xc3)",
- " trap(i,R,memory,maskl,maskw,endianw);",
+ "if (i < 20 || i == 33 || i == 34 || i == 0xc3)",
+ " nip += trap (i, R, PC, memory, maskl, maskw,endianw);",
+#if 0
"else {",
+ /* SH-[12] */
" R[15]-=4;",
- " WLAT(R[15],GET_SR());",
+ " WLAT (R[15], GET_SR());",
" R[15]-=4;",
- " WLAT(R[15],PC+2);",
- " PC=RLAT(VBR+(imm<<2))-2;",
- "}",
+ " WLAT (R[15], PH2T (PC + 2));",
#else
- "if (i == 0xc3)",
- " {",
- " nip = PC;",
- " trap (i, R, memory, maskl, maskw,endianw);",
- " }",
- "else if (i < 20 || i==34 || i==0xc3)",
- " trap (i, R, memory, maskl, maskw,endianw);",
"else if (!SR_BL) {",
- " /* FIXME: TRA = (imm << 2); */",
" SSR = GET_SR();",
" SPC = PH2T (PC + 2);",
" SET_SR (GET_SR() | SR_MASK_MD | SR_MASK_BL | SR_MASK_RB);",
" /* FIXME: EXPEVT = 0x00000160; */",
- " SET_NIP (PT2H (VBR + 0x00000100));",
- "}",
#endif
+ " SET_NIP (PT2H (RLAT (VBR + (imm<<2))));",
+ "}",
},
{ "", "mn", "tst <REG_M>,<REG_N>", "0010nnnnmmmm1000",
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index 2f5d1d37d59..8c2f3598a5d 100644
--- a/sim/sh/interp.c
+++ b/sim/sh/interp.c
@@ -954,12 +954,14 @@ strnswap (str, len)
while (start < end);
}
-/* Simulate a monitor trap, put the result into r0 and errno into r1 */
+/* Simulate a monitor trap, put the result into r0 and errno into r1
+ return offset by which to adjust pc. */
-static void
-trap (i, regs, memory, maskl, maskw, endianw)
+static int
+trap (i, regs, insn_ptr, memory, maskl, maskw, endianw)
int i;
int *regs;
+ unsigned char *insn_ptr;
unsigned char *memory;
{
switch (i)
@@ -971,6 +973,13 @@ trap (i, regs, memory, maskl, maskw, endianw)
raise_exception (SIGQUIT);
break;
case 3: /* FIXME: for backwards compat, should be removed */
+ case 33:
+ {
+ unsigned int countp = * (unsigned int *) (insn_ptr + 4);
+
+ WLAT (countp, RLAT (countp) + 1);
+ return 6;
+ }
case 34:
{
extern int errno;
@@ -1154,9 +1163,11 @@ trap (i, regs, memory, maskl, maskw, endianw)
case 0xc3:
case 255:
raise_exception (SIGTRAP);
+ if (i == 0xc3)
+ return -2;
break;
}
-
+ return 0;
}
void