summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobody <>2003-05-09 16:41:43 +0000
committernobody <>2003-05-09 16:41:43 +0000
commitb41719d9f61907f1c810753438454c6f5656347b (patch)
treea9a2a8e140602339a92e5990e1238c48b6d14f34
parent291862d73dc6b445dae7638c7490d74473dea27c (diff)
downloadbinutils-gdb-b41719d9f61907f1c810753438454c6f5656347b.tar.gz
This commit was manufactured by cvs2svn to create branch 'jimb-jimb-ppc64-linux-20030509-branchpoint
ppc64-linux-20030509-branch'. Sprout from kettenis_i386newframe-20030419-branch 2003-04-19 14:43:51 UTC nobody 'This commit was manufactured by cvs2svn to create branch' Cherrypick from kettenis_i386newframe-20030419-branch 2003-05-04 03:57:40 UTC nobody 'This commit was manufactured by cvs2svn to create branch': bfd/elf32-m68hc1x.h gdb/infcall.h gdb/mi/mi-cmd-symbol.c gdb/testsuite/gdb.mi/mi1-symbol.exp Cherrypick from master 2003-05-09 16:41:42 UTC Martin Schwidefsky <schwidefsky@de.ibm.com> ' * elf32-s390.c (allocate_dynrelocs, elf_s390_relocate_section):': ChangeLog MAINTAINERS Makefile.in Makefile.tpl bfd/ChangeLog bfd/Makefile.am bfd/Makefile.in bfd/acinclude.m4 bfd/aclocal.m4 bfd/archures.c bfd/bfd-in.h bfd/bfd-in2.h bfd/coff-h8300.c bfd/coffcode.h bfd/configure bfd/configure.in bfd/cpu-arm.c bfd/cpu-h8300.c bfd/cpu-sh.c bfd/elf-bfd.h bfd/elf-m10200.c bfd/elf-m10300.c bfd/elf.c bfd/elf32-arm.h bfd/elf32-h8300.c bfd/elf32-hppa.c bfd/elf32-i386.c bfd/elf32-ip2k.c bfd/elf32-iq2000.c bfd/elf32-m32r.c bfd/elf32-m68hc11.c bfd/elf32-m68hc12.c bfd/elf32-m68hc1x.c bfd/elf32-m68k.c bfd/elf32-mips.c bfd/elf32-ppc.c bfd/elf32-s390.c bfd/elf32-sh.c bfd/elf32-sh64-com.c bfd/elf32-sh64.c bfd/elf32-v850.c bfd/elf32-xstormy16.c bfd/elf32-xtensa.c bfd/elf64-alpha.c bfd/elf64-hppa.c bfd/elf64-mips.c bfd/elf64-mmix.c bfd/elf64-ppc.c bfd/elf64-s390.c bfd/elf64-sh64.c bfd/elf64-sparc.c bfd/elf64-x86-64.c bfd/elfcode.h bfd/elflink.c bfd/elflink.h bfd/elfxx-ia64.c bfd/elfxx-mips.c bfd/reloc.c bfd/section.c bfd/version.h bfd/xtensa-isa.c bfd/xtensa-modules.c config-ml.in cpu/ChangeLog gdb/ChangeLog gdb/Makefile.in gdb/ada-lang.c gdb/ada-valprint.c gdb/alpha-nat.c gdb/alpha-tdep.c gdb/alpha-tdep.h gdb/alphabsd-nat.c gdb/alphafbsd-tdep.c gdb/alphanbsd-tdep.c gdb/arch-utils.c gdb/arch-utils.h gdb/arm-linux-tdep.c gdb/arm-tdep.c gdb/avr-tdep.c gdb/blockframe.c gdb/breakpoint.c gdb/breakpoint.h gdb/c-lang.c gdb/charset.c gdb/charset.h gdb/cli/cli-cmds.c gdb/cli/cli-cmds.h gdb/config/djgpp/fnchange.lst gdb/config/i386/nto.mt gdb/config/i386/tm-nto.h gdb/config/ia64/tm-ia64.h gdb/config/m68k/tm-vx68.h gdb/config/mips/tm-mips.h gdb/config/pa/nm-hppah.h gdb/config/pa/tm-hppa.h gdb/config/pa/tm-hppa64.h gdb/config/s390/tm-s390.h gdb/config/sparc/tm-sp64.h gdb/config/sparc/tm-sparc.h gdb/config/tm-nto.h gdb/config/vax/nm-vax.h gdb/configure.tgt gdb/corefile.c gdb/cp-support.c gdb/cris-tdep.c gdb/d10v-tdep.c gdb/defs.h gdb/disasm.c gdb/disasm.h gdb/doc/ChangeLog gdb/doc/gdb.texinfo gdb/doc/gdbint.texinfo gdb/dummy-frame.c gdb/dummy-frame.h gdb/dve3900-rom.c gdb/dwarf2cfi.c gdb/dwarf2loc.c gdb/dwarf2read.c gdb/eval.c gdb/findvar.c gdb/fork-child.c gdb/frame.c gdb/frame.h gdb/frv-tdep.c gdb/gcore.c gdb/gdbarch.c gdb/gdbarch.h gdb/gdbarch.sh gdb/gdbcmd.h gdb/gdbserver/ChangeLog gdb/gdbserver/low-nbsd.c gdb/gdbthread.h gdb/h8300-tdep.c gdb/hppa-tdep.c gdb/hppab-nat.c gdb/hppah-nat.c gdb/hpux-thread.c gdb/i386-linux-nat.c gdb/i386-nto-tdep.c gdb/i386-tdep.c gdb/i387-tdep.c gdb/ia64-tdep.c gdb/infcall.c gdb/infcmd.c gdb/inferior.h gdb/infptrace.c gdb/infrun.c gdb/irix4-nat.c gdb/linespec.c gdb/lynx-nat.c gdb/m68hc11-tdep.c gdb/m68k-tdep.c gdb/m68klinux-nat.c gdb/maint.c gdb/mcore-tdep.c gdb/mi/ChangeLog gdb/mi/mi-cmds.c gdb/mi/mi-cmds.h gdb/mi/mi-main.c gdb/mips-linux-tdep.c gdb/mips-nat.c gdb/mips-tdep.c gdb/mipsv4-nat.c gdb/mn10300-tdep.c gdb/monitor.c gdb/nlm/i386.c gdb/nlm/i386.h gdb/ns32k-tdep.c gdb/ns32knbsd-nat.c gdb/nto-tdep.c gdb/nto-tdep.h gdb/objc-lang.c gdb/objfiles.c gdb/ppc-linux-nat.c gdb/printcmd.c gdb/procfs.c gdb/regcache.c gdb/regcache.h gdb/remote-array.c gdb/remote-e7000.c gdb/remote-mips.c gdb/remote-rdp.c gdb/remote-sim.c gdb/remote.c gdb/rom68k-rom.c gdb/rs6000-nat.c gdb/rs6000-tdep.c gdb/s390-tdep.c gdb/scm-lang.c gdb/sentinel-frame.c gdb/sh-tdep.c gdb/sol-thread.c gdb/sparc-tdep.c gdb/stack.c gdb/std-regs.c gdb/symmisc.c gdb/symtab.c gdb/symtab.h gdb/target.c gdb/target.h gdb/testsuite/ChangeLog gdb/testsuite/Makefile.in gdb/testsuite/configure gdb/testsuite/configure.in gdb/testsuite/gdb.asm/asm-source.exp gdb/testsuite/gdb.asm/s390x.inc gdb/testsuite/gdb.base/charset.exp gdb/testsuite/gdb.base/maint.exp gdb/testsuite/gdb.base/signals.exp gdb/testsuite/gdb.base/watchpoint.exp gdb/testsuite/gdb.c++/maint.exp gdb/testsuite/gdb.mi/ChangeLog gdb/testsuite/gdb.objc/Makefile.in gdb/testsuite/gdb.objc/basicclass.exp gdb/testsuite/gdb.objc/basicclass.m gdb/testsuite/gdb.threads/schedlock.exp gdb/testsuite/lib/gdb.exp gdb/thread-db.c gdb/thread.c gdb/tracepoint.c gdb/tui/ChangeLog gdb/tui/tuiDisassem.c gdb/tui/tuiRegs.c gdb/v850-tdep.c gdb/valarith.c gdb/valops.c gdb/value.h gdb/vax-tdep.c gdb/version.in gdb/x86-64-tdep.c gdb/xstormy16-tdep.c include/ChangeLog include/bfdlink.h include/coff/ChangeLog include/coff/h8300.h include/elf/ChangeLog include/elf/common.h include/elf/h8.h include/gdb/ChangeLog include/gdb/sim-d10v.h include/hashtab.h include/xtensa-isa-internal.h libiberty/ChangeLog libiberty/aclocal.m4 libiberty/config.in libiberty/configure libiberty/configure.in libiberty/cp-demangle.c libiberty/hashtab.c libiberty/splay-tree.c libiberty/vsnprintf.c opcodes/ChangeLog opcodes/fr30-desc.c opcodes/fr30-desc.h opcodes/fr30-opc.c opcodes/fr30-opc.h opcodes/frv-desc.c opcodes/frv-desc.h opcodes/frv-opc.c opcodes/frv-opc.h opcodes/i386-dis.c opcodes/ip2k-desc.c opcodes/ip2k-desc.h opcodes/ip2k-opc.c opcodes/ip2k-opc.h opcodes/m32r-desc.c opcodes/m32r-desc.h opcodes/m32r-opc.c opcodes/m32r-opc.h opcodes/m32r-opinst.c opcodes/openrisc-desc.c opcodes/openrisc-desc.h opcodes/openrisc-opc.c opcodes/openrisc-opc.h opcodes/xstormy16-desc.c opcodes/xstormy16-desc.h opcodes/xstormy16-opc.c opcodes/xstormy16-opc.h opcodes/z8k-dis.c sim/d10v/ChangeLog sim/d10v/interp.c sim/igen/ChangeLog sim/igen/compare_igen_models sim/mips/ChangeLog sim/mips/cp1.c sim/mips/cp1.h sim/mips/mdmx.c sim/mips/mdmx.igen sim/mips/mips3d.igen sim/mips/sb1.igen src-release
-rw-r--r--ChangeLog19
-rw-r--r--MAINTAINERS2
-rw-r--r--Makefile.in5
-rw-r--r--Makefile.tpl5
-rw-r--r--bfd/ChangeLog491
-rw-r--r--bfd/Makefile.am10
-rw-r--r--bfd/Makefile.in10
-rw-r--r--bfd/acinclude.m42
-rw-r--r--bfd/aclocal.m418
-rw-r--r--bfd/archures.c12
-rw-r--r--bfd/bfd-in.h4
-rw-r--r--bfd/bfd-in2.h24
-rw-r--r--bfd/coff-h8300.c5
-rw-r--r--bfd/coffcode.h30
-rwxr-xr-xbfd/configure970
-rw-r--r--bfd/configure.in6
-rw-r--r--bfd/cpu-arm.c2
-rw-r--r--bfd/cpu-h8300.c83
-rw-r--r--bfd/cpu-sh.c2
-rw-r--r--bfd/elf-bfd.h96
-rw-r--r--bfd/elf-m10200.c6
-rw-r--r--bfd/elf-m10300.c10
-rw-r--r--bfd/elf.c28
-rw-r--r--bfd/elf32-arm.h4
-rw-r--r--bfd/elf32-h8300.c59
-rw-r--r--bfd/elf32-hppa.c6
-rw-r--r--bfd/elf32-i386.c51
-rw-r--r--bfd/elf32-ip2k.c12
-rw-r--r--bfd/elf32-iq2000.c18
-rw-r--r--bfd/elf32-m32r.c8
-rw-r--r--bfd/elf32-m68hc11.c552
-rw-r--r--bfd/elf32-m68hc12.c477
-rw-r--r--bfd/elf32-m68hc1x.c1508
-rw-r--r--bfd/elf32-m68hc1x.h205
-rw-r--r--bfd/elf32-m68k.c2
-rw-r--r--bfd/elf32-mips.c2
-rw-r--r--bfd/elf32-ppc.c85
-rw-r--r--bfd/elf32-s390.c94
-rw-r--r--bfd/elf32-sh.c275
-rw-r--r--bfd/elf32-sh64-com.c2
-rw-r--r--bfd/elf32-sh64.c2
-rw-r--r--bfd/elf32-v850.c4
-rw-r--r--bfd/elf32-xstormy16.c10
-rw-r--r--bfd/elf32-xtensa.c2
-rw-r--r--bfd/elf64-alpha.c10
-rw-r--r--bfd/elf64-hppa.c4
-rw-r--r--bfd/elf64-mips.c2
-rw-r--r--bfd/elf64-mmix.c12
-rw-r--r--bfd/elf64-ppc.c69
-rw-r--r--bfd/elf64-s390.c96
-rw-r--r--bfd/elf64-sh64.c4
-rw-r--r--bfd/elf64-sparc.c2
-rw-r--r--bfd/elf64-x86-64.c86
-rw-r--r--bfd/elfcode.h6
-rw-r--r--bfd/elflink.c2035
-rw-r--r--bfd/elflink.h2143
-rw-r--r--bfd/elfxx-ia64.c74
-rw-r--r--bfd/elfxx-mips.c38
-rw-r--r--bfd/reloc.c4
-rw-r--r--bfd/section.c8
-rw-r--r--bfd/version.h2
-rw-r--r--bfd/xtensa-isa.c2
-rw-r--r--bfd/xtensa-modules.c4
-rw-r--r--config-ml.in86
-rw-r--r--cpu/ChangeLog11
-rw-r--r--gdb/ChangeLog723
-rw-r--r--gdb/Makefile.in61
-rw-r--r--gdb/ada-lang.c1
-rw-r--r--gdb/ada-valprint.c1
-rw-r--r--gdb/alpha-nat.c2
-rw-r--r--gdb/alpha-tdep.c20
-rw-r--r--gdb/alpha-tdep.h12
-rw-r--r--gdb/alphabsd-nat.c2
-rw-r--r--gdb/alphafbsd-tdep.c2
-rw-r--r--gdb/alphanbsd-tdep.c2
-rw-r--r--gdb/arch-utils.c13
-rw-r--r--gdb/arch-utils.h3
-rw-r--r--gdb/arm-linux-tdep.c21
-rw-r--r--gdb/arm-tdep.c54
-rw-r--r--gdb/avr-tdep.c16
-rw-r--r--gdb/blockframe.c16
-rw-r--r--gdb/breakpoint.c570
-rw-r--r--gdb/breakpoint.h23
-rw-r--r--gdb/c-lang.c37
-rw-r--r--gdb/charset.c364
-rw-r--r--gdb/charset.h11
-rw-r--r--gdb/cli/cli-cmds.c5
-rw-r--r--gdb/cli/cli-cmds.h4
-rw-r--r--gdb/config/djgpp/fnchange.lst1
-rw-r--r--gdb/config/i386/nto.mt4
-rw-r--r--gdb/config/i386/tm-nto.h33
-rw-r--r--gdb/config/ia64/tm-ia64.h4
-rw-r--r--gdb/config/m68k/tm-vx68.h2
-rw-r--r--gdb/config/mips/tm-mips.h4
-rw-r--r--gdb/config/pa/nm-hppah.h7
-rw-r--r--gdb/config/pa/tm-hppa.h391
-rw-r--r--gdb/config/pa/tm-hppa64.h352
-rw-r--r--gdb/config/s390/tm-s390.h14
-rw-r--r--gdb/config/sparc/tm-sp64.h48
-rw-r--r--gdb/config/sparc/tm-sparc.h25
-rw-r--r--gdb/config/tm-nto.h61
-rw-r--r--gdb/config/vax/nm-vax.h2
-rw-r--r--gdb/configure.tgt4
-rw-r--r--gdb/corefile.c22
-rw-r--r--gdb/cp-support.c102
-rw-r--r--gdb/cris-tdep.c110
-rw-r--r--gdb/d10v-tdep.c271
-rw-r--r--gdb/defs.h27
-rw-r--r--gdb/disasm.c149
-rw-r--r--gdb/disasm.h6
-rw-r--r--gdb/doc/ChangeLog56
-rw-r--r--gdb/doc/gdb.texinfo212
-rw-r--r--gdb/doc/gdbint.texinfo97
-rw-r--r--gdb/dummy-frame.c55
-rw-r--r--gdb/dummy-frame.h11
-rw-r--r--gdb/dve3900-rom.c2
-rw-r--r--gdb/dwarf2cfi.c2
-rw-r--r--gdb/dwarf2loc.c5
-rw-r--r--gdb/dwarf2read.c10
-rw-r--r--gdb/eval.c285
-rw-r--r--gdb/findvar.c6
-rw-r--r--gdb/fork-child.c30
-rw-r--r--gdb/frame.c27
-rw-r--r--gdb/frame.h11
-rw-r--r--gdb/frv-tdep.c11
-rw-r--r--gdb/gcore.c1
-rw-r--r--gdb/gdbarch.c455
-rw-r--r--gdb/gdbarch.h304
-rwxr-xr-xgdb/gdbarch.sh105
-rw-r--r--gdb/gdbcmd.h4
-rw-r--r--gdb/gdbserver/ChangeLog5
-rw-r--r--gdb/gdbserver/low-nbsd.c4
-rw-r--r--gdb/gdbthread.h3
-rw-r--r--gdb/h8300-tdep.c10
-rw-r--r--gdb/hppa-tdep.c161
-rw-r--r--gdb/hppab-nat.c2
-rw-r--r--gdb/hppah-nat.c2
-rw-r--r--gdb/hpux-thread.c4
-rw-r--r--gdb/i386-linux-nat.c5
-rw-r--r--gdb/i386-nto-tdep.c298
-rw-r--r--gdb/i386-tdep.c20
-rw-r--r--gdb/i387-tdep.c35
-rw-r--r--gdb/ia64-tdep.c36
-rw-r--r--gdb/infcall.c1072
-rw-r--r--gdb/infcall.h43
-rw-r--r--gdb/infcmd.c112
-rw-r--r--gdb/inferior.h21
-rw-r--r--gdb/infptrace.c4
-rw-r--r--gdb/infrun.c95
-rw-r--r--gdb/irix4-nat.c8
-rw-r--r--gdb/linespec.c128
-rw-r--r--gdb/lynx-nat.c4
-rw-r--r--gdb/m68hc11-tdep.c10
-rw-r--r--gdb/m68k-tdep.c36
-rw-r--r--gdb/m68klinux-nat.c4
-rw-r--r--gdb/maint.c25
-rw-r--r--gdb/mcore-tdep.c50
-rw-r--r--gdb/mi/ChangeLog22
-rw-r--r--gdb/mi/mi-cmd-symbol.c67
-rw-r--r--gdb/mi/mi-cmds.c1
-rw-r--r--gdb/mi/mi-cmds.h1
-rw-r--r--gdb/mi/mi-main.c10
-rw-r--r--gdb/mips-linux-tdep.c18
-rw-r--r--gdb/mips-nat.c16
-rw-r--r--gdb/mips-tdep.c94
-rw-r--r--gdb/mipsv4-nat.c10
-rw-r--r--gdb/mn10300-tdep.c31
-rw-r--r--gdb/monitor.c8
-rw-r--r--gdb/nlm/i386.c2
-rw-r--r--gdb/nlm/i386.h2
-rw-r--r--gdb/ns32k-tdep.c22
-rw-r--r--gdb/ns32knbsd-nat.c10
-rw-r--r--gdb/nto-tdep.c342
-rw-r--r--gdb/nto-tdep.h156
-rw-r--r--gdb/objc-lang.c16
-rw-r--r--gdb/objfiles.c2
-rw-r--r--gdb/ppc-linux-nat.c4
-rw-r--r--gdb/printcmd.c26
-rw-r--r--gdb/procfs.c4
-rw-r--r--gdb/regcache.c137
-rw-r--r--gdb/regcache.h10
-rw-r--r--gdb/remote-array.c2
-rw-r--r--gdb/remote-e7000.c6
-rw-r--r--gdb/remote-mips.c14
-rw-r--r--gdb/remote-rdp.c2
-rw-r--r--gdb/remote-sim.c10
-rw-r--r--gdb/remote.c11
-rw-r--r--gdb/rom68k-rom.c2
-rw-r--r--gdb/rs6000-nat.c4
-rw-r--r--gdb/rs6000-tdep.c15
-rw-r--r--gdb/s390-tdep.c27
-rw-r--r--gdb/scm-lang.c1
-rw-r--r--gdb/sentinel-frame.c2
-rw-r--r--gdb/sh-tdep.c57
-rw-r--r--gdb/sol-thread.c6
-rw-r--r--gdb/sparc-tdep.c125
-rw-r--r--gdb/stack.c21
-rw-r--r--gdb/std-regs.c56
-rw-r--r--gdb/symmisc.c8
-rw-r--r--gdb/symtab.c24
-rw-r--r--gdb/symtab.h4
-rw-r--r--gdb/target.c4
-rw-r--r--gdb/target.h8
-rw-r--r--gdb/testsuite/ChangeLog53
-rw-r--r--gdb/testsuite/Makefile.in2
-rwxr-xr-xgdb/testsuite/configure69
-rw-r--r--gdb/testsuite/configure.in2
-rw-r--r--gdb/testsuite/gdb.asm/asm-source.exp138
-rw-r--r--gdb/testsuite/gdb.asm/s390x.inc68
-rw-r--r--gdb/testsuite/gdb.base/charset.exp174
-rw-r--r--gdb/testsuite/gdb.base/maint.exp7
-rw-r--r--gdb/testsuite/gdb.base/signals.exp6
-rw-r--r--gdb/testsuite/gdb.base/watchpoint.exp4
-rw-r--r--gdb/testsuite/gdb.c++/maint.exp12
-rw-r--r--gdb/testsuite/gdb.mi/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.mi/mi1-symbol.exp61
-rw-r--r--gdb/testsuite/gdb.objc/Makefile.in22
-rw-r--r--gdb/testsuite/gdb.objc/basicclass.exp199
-rw-r--r--gdb/testsuite/gdb.objc/basicclass.m81
-rw-r--r--gdb/testsuite/gdb.threads/schedlock.exp14
-rw-r--r--gdb/testsuite/lib/gdb.exp40
-rw-r--r--gdb/thread-db.c2
-rw-r--r--gdb/thread.c4
-rw-r--r--gdb/tracepoint.c2
-rw-r--r--gdb/tui/ChangeLog16
-rw-r--r--gdb/tui/tuiDisassem.c14
-rw-r--r--gdb/tui/tuiRegs.c6
-rw-r--r--gdb/v850-tdep.c27
-rw-r--r--gdb/valarith.c1
-rw-r--r--gdb/valops.c838
-rw-r--r--gdb/value.h3
-rw-r--r--gdb/vax-tdep.c27
-rw-r--r--gdb/version.in2
-rw-r--r--gdb/x86-64-tdep.c6
-rw-r--r--gdb/xstormy16-tdep.c10
-rw-r--r--include/ChangeLog18
-rw-r--r--include/bfdlink.h8
-rw-r--r--include/coff/ChangeLog5
-rw-r--r--include/coff/h8300.h12
-rw-r--r--include/elf/ChangeLog13
-rw-r--r--include/elf/common.h4
-rw-r--r--include/elf/h8.h4
-rw-r--r--include/gdb/ChangeLog6
-rw-r--r--include/gdb/sim-d10v.h11
-rw-r--r--include/hashtab.h5
-rw-r--r--include/xtensa-isa-internal.h2
-rw-r--r--libiberty/ChangeLog26
-rw-r--r--libiberty/aclocal.m42
-rw-r--r--libiberty/config.in10
-rwxr-xr-xlibiberty/configure756
-rw-r--r--libiberty/configure.in19
-rw-r--r--libiberty/cp-demangle.c2
-rw-r--r--libiberty/hashtab.c138
-rw-r--r--libiberty/splay-tree.c4
-rw-r--r--libiberty/vsnprintf.c26
-rw-r--r--opcodes/ChangeLog23
-rw-r--r--opcodes/fr30-desc.c2
-rw-r--r--opcodes/fr30-desc.h2
-rw-r--r--opcodes/fr30-opc.c2
-rw-r--r--opcodes/fr30-opc.h2
-rw-r--r--opcodes/frv-desc.c149
-rw-r--r--opcodes/frv-desc.h2
-rw-r--r--opcodes/frv-opc.c2
-rw-r--r--opcodes/frv-opc.h2
-rw-r--r--opcodes/i386-dis.c2
-rw-r--r--opcodes/ip2k-desc.c20
-rw-r--r--opcodes/ip2k-desc.h2
-rw-r--r--opcodes/ip2k-opc.c2
-rw-r--r--opcodes/ip2k-opc.h2
-rw-r--r--opcodes/m32r-desc.c48
-rw-r--r--opcodes/m32r-desc.h2
-rw-r--r--opcodes/m32r-opc.c2
-rw-r--r--opcodes/m32r-opc.h2
-rw-r--r--opcodes/m32r-opinst.c2
-rw-r--r--opcodes/openrisc-desc.c33
-rw-r--r--opcodes/openrisc-desc.h2
-rw-r--r--opcodes/openrisc-opc.c2
-rw-r--r--opcodes/openrisc-opc.h2
-rw-r--r--opcodes/xstormy16-desc.c60
-rw-r--r--opcodes/xstormy16-desc.h2
-rw-r--r--opcodes/xstormy16-opc.c8
-rw-r--r--opcodes/xstormy16-opc.h7
-rw-r--r--opcodes/z8k-dis.c30
-rw-r--r--sim/d10v/ChangeLog12
-rw-r--r--sim/d10v/interp.c42
-rw-r--r--sim/igen/ChangeLog4
-rwxr-xr-xsim/igen/compare_igen_models2
-rw-r--r--sim/mips/ChangeLog9
-rw-r--r--sim/mips/cp1.c7
-rw-r--r--sim/mips/cp1.h3
-rw-r--r--sim/mips/mdmx.c3
-rw-r--r--sim/mips/mdmx.igen3
-rw-r--r--sim/mips/mips3d.igen3
-rw-r--r--sim/mips/sb1.igen3
-rw-r--r--src-release3
295 files changed, 13891 insertions, 8430 deletions
diff --git a/ChangeLog b/ChangeLog
index 3008cc64edb..787355cc717 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2003-05-05 H.J. Lu <hjl@gnu.org>
+
+ * config-ml.in: Restored from gcc repository.
+
+2003-05-02 Chris Demetriou <cgd@broadcom.com>
+
+ * Makefile.tpl: Require "makeinfo" from texinfo 4.2 or later.
+ * Makefile.in: Regenerate.
+
+2003-04-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * src-release (DEVO_SUPPORT): Add src-release, Makefile.tpl,
+ and Makefile.def.
+
+2003-04-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.tpl: Clean $(BUILD_SUBDIR).
+ * Makefile.in: Regenerated.
+
2003-04-18 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* Makefile.tpl (MAKEINFOFLAGS): Default to --split-size=5000000.
diff --git a/MAINTAINERS b/MAINTAINERS
index a2e155bbeb3..718d3741000 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9,7 +9,7 @@ Makefile.in; configure; configure.in
binutils@sources.redhat.com
gdb-patches@sources.redhat.com
-bfd/; binutils/; gas/; gprof/; ld/; opcodes/; BFD's part of include/
+bfd/; binutils/; gas/; gprof/; ld/; opcodes/; cpu/; BFD's part of include/
binutils: http://sources.redhat.com/binutils/
Patches to binutils@sources.redhat.com.
Please notify the following of any interface changes:
diff --git a/Makefile.in b/Makefile.in
index 1b993f59e9c..3f3ea9a0261 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -191,13 +191,13 @@ M4 = `if [ -f $$r/m4/m4 ] ; \
then echo $$r/m4/m4 ; \
else echo ${DEFAULT_M4} ; fi`
-# For an installed makeinfo, we require it to be from texinfo 4 or
+# For an installed makeinfo, we require it to be from texinfo 4.2 or
# higher, else we use the "missing" dummy.
MAKEINFO=@MAKEINFO@
USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
then echo $$r/texinfo/makeinfo/makeinfo ; \
else if (makeinfo --version \
- | egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \
+ | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \
then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
# This just becomes part of the MAKEINFO definition passed down to
@@ -1112,6 +1112,7 @@ local-distclean:
-if [ "$(TARGET_SUBDIR)" != "." ]; then \
rm -rf $(TARGET_SUBDIR); \
else true; fi
+ -rm -rf $(BUILD_SUBDIR)
-rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
-rm -f texinfo/doc/Makefile texinfo/po/POTFILES
-rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
diff --git a/Makefile.tpl b/Makefile.tpl
index 314c44977d8..b634b357e46 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -194,13 +194,13 @@ M4 = `if [ -f $$r/m4/m4 ] ; \
then echo $$r/m4/m4 ; \
else echo ${DEFAULT_M4} ; fi`
-# For an installed makeinfo, we require it to be from texinfo 4 or
+# For an installed makeinfo, we require it to be from texinfo 4.2 or
# higher, else we use the "missing" dummy.
MAKEINFO=@MAKEINFO@
USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
then echo $$r/texinfo/makeinfo/makeinfo ; \
else if (makeinfo --version \
- | egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \
+ | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \
then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
# This just becomes part of the MAKEINFO definition passed down to
@@ -672,6 +672,7 @@ local-distclean:
-if [ "$(TARGET_SUBDIR)" != "." ]; then \
rm -rf $(TARGET_SUBDIR); \
else true; fi
+ -rm -rf $(BUILD_SUBDIR)
-rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
-rm -f texinfo/doc/Makefile texinfo/po/POTFILES
-rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 00042678430..0cf4ea341ad 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,426 @@
+2003-05-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+ * elf32-s390.c (allocate_dynrelocs, elf_s390_relocate_section):
+ Fix WILL_CALL_FINISH_DYNAMIC_SYMBOL call.
+ (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
+ * elf64-s390.c: Likewise.
+
+2003-05-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+ * elf32-s390.c (ELIMINATE_COPY_RELOCS): Define as one.
+ (elf_s390_adjust_dynamic_symbol): For weak symbols, copy
+ ELF_LINK_NON_GOT_REF from weakdef.
+ (elf_s390_copy_indirect_symbol): Test whether the weakdef sym has
+ already been adjusted before treating it specially.
+ * el64-s390.c: Likwise.
+
+2003-05-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+ * elf32-s390.c (allocate_dynrelocs): For undef weak syms with
+ non-default visibility, a) don't make them dynamic, b) discard
+ space for dynamic relocs.
+ (elf_s390_relocate_section): Initialize the GOT entries and skip
+ R_390_{8,16,32}/R_390_PC{16,16DBL,32DBL,32} for weak undefined
+ symbols with non-default visibility.
+ * elf64-s390.c: Likewise.
+
+2003-05-09 Alan Modra <amodra@bigpond.net.au>
+
+ * cpu-arm.c (arm_check_note): Warning fix.
+ * elf32-iq2000.c (iq2000_elf_check_relocs): Warning fixes. Arrange
+ to keep relocs if edited.
+ (iq2000_elf_print_private_bfd_data): Return TRUE.
+ * elfxx-ia64.c (elfNN_ia64_relax_section): Use ELFNN_R_SYM, not
+ ELF64_R_SYM.
+ (elfNN_ia64_relax_ldxmov): Warning fix.
+ * xtensa-isa.c (xtensa_add_isa): Warning fix.
+ * xtensa-modules.c (get_num_opcodes): Warning fix.
+
+2003-05-09 Andrey Petrov <petrov@netbsd.org>
+
+ * elf.c (elf_fake_sections): Use correct cast for sh_name.
+
+2003-05-09 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.c (_bfd_elf_link_create_dynamic_sections): Move from
+ elflink.h. Replace LOG_FILE_ALIGN with bed->s->log_file_align.
+ (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align.
+ (bfd_elf_record_link_assignment): Move from elflink.h.
+ (_bfd_elf_merge_symbol): Likewise.
+ (_bfd_elf_add_default_symbol): Likewise.
+ (_bfd_elf_export_symbol): Likewise.
+ (_bfd_elf_link_find_version_dependencies): Likewise.
+ (_bfd_elf_link_assign_sym_version): Likewise.
+ (_bfd_elf_link_read_relocs): Likewise.
+ (_bfd_elf_link_size_reloc_section): Likewise.
+ (_bfd_elf_fix_symbol_flags): Likewise.
+ (_bfd_elf_adjust_dynamic_symbol): Likewise.
+ (_bfd_elf_link_sec_merge_syms): Likewise.
+ (elf_link_read_relocs_from_section): Likewise. Use bed->s->sizeof_rel
+ and bed->s->sizeof_rela.
+ (_bfd_elf_link_output_relocs): Likewise.
+ * elf-bfd.h (struct elf_size_info): Rename file_align to
+ log_file_align.
+ (struct elf_info_failed): Move from elflink.h.
+ (struct elf_assign_sym_version_info): Likewise.
+ (struct elf_find_verdep_info): Likewise.
+ (_bfd_elf_create_dynamic_sections): Delete duplicate declaration.
+ (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol,
+ _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies,
+ _bfd_elf_link_assign_sym_version,
+ _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs,
+ _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs,
+ _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
+ _bfd_elf_link_sec_merge_syms): Declare.
+ (bfd_elf32_link_create_dynamic_sections): Don't declare.
+ (_bfd_elf32_link_read_relocs): Likewise.
+ (bfd_elf64_link_create_dynamic_sections): Likewise.
+ (_bfd_elf64_link_read_relocs): Likewise.
+ * elflink.h: Move lots o' stuff elsewhere.
+ * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare.
+ (bfd_elf64_record_link_assignment): Likewise.
+ (bfd_elf_record_link_assignment): Declare.
+ * bfd-in2.h: Regenerate.
+ * elfcode.h (elf_link_create_dynamic_sections): Don't declare.
+ (NAME(_bfd_elf,size_info)): Adjust for log_file_align.
+ * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align.
+ (assign_file_positions_for_segments): Likewise.
+ (assign_file_positions_except_relocs): Likewise.
+ (swap_out_syms, elfcore_write_note): Likewise.
+ * elf-m10200.c: Adjust for changed function names.
+ * elf-m10300.c: Likewise.
+ * elf32-arm.h: Likewise.
+ * elf32-h8300.c: Likewise.
+ * elf32-hppa.c: Likewise.
+ * elf32-ip2k.c: Likewise.
+ * elf32-m32r.c: Likewise.
+ * elf32-m68hc11.c: Likewise.
+ * elf32-m68hc1x.c: Likewise.
+ * elf32-m68k.c: Likewise.
+ * elf32-mips.c: Likewise.
+ * elf32-ppc.c: Likewise.
+ * elf32-sh.c: Likewise.
+ * elf32-v850.c: Likewise.
+ * elf32-xtensa.c: Likewise.
+ * elf64-alpha.c: Likewise.
+ * elf64-hppa.c: Likewise.
+ * elf64-mmix.c: Likewise.
+ * elf64-ppc.c: Likewise.
+ * elf64-sh64.c: Likewise.
+ * elfxx-ia64.c: Likewise.
+ * elfxx-mips.c: Likewise.
+ (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align.
+ * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align.
+ * elf64-hppa.c (hppa64_elf_size_info): Likewise.
+ * elf64-mips.c (mips_elf64_size_info): Likewise.
+ * elf64-s390.c (s390_elf64_size_info): Likewise.
+ * elf64-sparc.c (sparc64_elf_size_info): Likewise.
+
+2003-05-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elflink.h (elf_add_default_symbol): After skipping the
+ unversioned symbol, go to non-default one.
+
+2003-05-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-ia64.c (_bfd_elf_link_hash_hide_symbol): Also clear the
+ want_plt field.
+ (elfNN_ia64_relocate_section): Don't do dynamic symbol lookup
+ for symbols with non-default visibility.
+
+2003-05-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elflink.h (elf_link_check_versioned_symbol): Also handle the
+ case that a DSO references a hidden symbol which may be
+ satisfied by a versioned symbol in another DSO.
+ (elf_link_output_extsym): Check versioned definition for hidden
+ symbol referenced by a DSO.
+
+2003-05-07 Nick Clifton <nickc@redhat.com>
+
+ * elf32-xstormy16.c (xstormy16_elf_howto_table): Reset
+ R_XSTORMY16_16 reloc to ignore overflows.
+
+2003-05-06 Alexandre Oliva <aoliva@redhat.com>
+
+ * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Improve
+ error message for mixing different-endian files. Check for ABI
+ compatibility of input files with the selected emulation.
+
+2003-05-05 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-i386.c (allocate_dynrelocs): For undef weak syms with
+ non-default visibility, a) don't make them dynamic, b) discard
+ space for dynamic relocs.
+ * elf64-x86-64.c (allocate_dynrelocs): Likewise.
+
+ * elf32-ppc.c (allocate_dynrelocs): For undef weak syms with
+ non-default visibility, a) don't allocate plt entries, b) don't
+ allocate .got relocs, c) discard dyn rel space,
+ (ppc_elf_relocate_section): d) don't generate .got relocs, e)
+ don't generate dynamic relocs.
+ * elf64-ppc.c (allocate_dynrelocs): As above.
+ (ppc64_elf_relocate_section): As above.
+
+2003-05-05 Andreas Jaeger <aj@suse.de>
+
+ * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic
+ relocation entries for weak undefined symbols with non-default
+ visibility.
+ (elf64_x86_64_relocate_section): Initialize the GOT entries and
+ skip R_386_32/R_386_PC32 for weak undefined symbols with
+ non-default visibility.
+
+2003-05-04 H.J. Lu <hjl@gnu.org>
+
+ * elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic
+ relocation entries for weak undefined symbols with non-default
+ visibility.
+ (elf_i386_relocate_section): Initialize the GOT entries and
+ skip R_386_32/R_386_PC32 for weak undefined symbols with
+ non-default visibility.
+
+ * elfxx-ia64.c (allocate_fptr): Don't allocate function
+ descriptors for weak undefined symbols with non-default
+ visibility.
+ (allocate_dynrel_entries): Don't allocate relocation entries
+ for symbols resolved to 0.
+ (set_got_entry): Don't install dynamic relocation for weak
+ undefined symbols with non-default visibility.
+ (set_pltoff_entry): Likewise.
+
+ * elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols
+ with non-default visibility.
+ (elf_link_output_extsym): Don't make weak undefined symbols
+ with non-default visibility dynamic.
+
+2003-05-04 H.J. Lu <hjl@gnu.org>
+
+ * elflink.h (elf_merge_symbol): Correctly handle weak definiton.
+
+2003-05-04 H.J. Lu <hjl@gnu.org>
+
+ * elflink.h (elf_merge_symbol): Don't record a hidden/internal
+ symbol dynamic. Check indirection when removing the old
+ definition for symbols with non-default visibility.
+ (elf_add_default_symbol): Skip when told by elf_merge_symbol.
+
+2003-05-02 Nick Clifton <nickc@redhat.com>
+
+ * elf32-xstormy16.c (xstormy16_elf_howto_table): Make the
+ R_XSTORMY16_8 and R_XSTORMY16_16 relocs detect and complain about
+ unsigned overflow.
+
+2003-05-02 Andreas Jaeger <aj@suse.de>
+
+ * elf64-x86-64.c (elf_x86_64_copy_indirect_symbol): Don't copy
+ ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
+ (ELIMINATE_COPY_RELOCS): Define as one. Use throughout.
+ (elf_x86_64_adjust_dynamic_symbol): For weak symbols, copy
+ ELF_LINK_NON_GOT_REF from weakdef.
+
+2003-05-02 Charles Lepple <clepple@ghz.cc>
+ Nick Clifton <nickc@redhat.com>
+
+ * acinclude.m4: Fix name of --enable-install-libbfd switch.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+ * Makefile.in: Regenerate.
+
+2003-05-01 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Test whether the
+ weakdef sym has already been adjusted before treating it specially.
+ * elf32-i386.c (elf_i386_copy_indirect_symbol): Don't copy
+ ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
+ * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
+ (ppc64_elf_check_relocs): Set ELF_LINK_NON_GOT_REF.
+
+2003-04-28 H.J. Lu <hjl@gnu.org>
+
+ * elfxx-ia64.c (elfNN_ia64_relax_section): Relax ldxmov during
+ the relax finalize pass.
+
+ * section.c (struct sec): Add need_finalize_relax and remove
+ flag11.
+ (STD_SECTION): Update struct sec initializer.
+ * bfd-in2.h: Regenerated.
+
+2003-04-28 H.J. Lu <hjl@gnu.org>
+
+ * elflink.h (elf_merge_symbol): Call elf_backend_copy_indirect_symbol
+ to copy any information related to dynamic linking when we flip
+ the indirection.
+
+2003-04-27 H.J. Lu <hjl@gnu.org>
+
+ * elf-bfd.h (ELF_LINK_DYNAMIC_DEF): New.
+ (ELF_LINK_DYNAMIC_WEAK): New.
+
+ * elflink.h (elf_merge_symbol): Add one argument to indicate if
+ a symbol should be skipped. Ignore definitions in dynamic
+ objects for symbols with non-default visibility.
+ (elf_add_default_symbol): Adjusted.
+ (elf_link_add_object_symbols): Check if a symbol should be
+ skipped. Don't merge the visibility field with the one from
+ a dynamic object.
+ (elf_link_check_versioned_symbol): Use undef_bfd.
+ (elf_link_output_extsym): Warn if a forced local symbol is
+ referenced from dynamic objects. Make non-weak undefined symbol
+ with non-default visibility a fatal error.
+
+2003-04-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * configure.in: Bump version on HEAD to 2.14.90.
+ * configure: Regenerated.
+
+2003-04-26 Stephane Carrez <stcarrez@nerim.fr>
+
+ PR savannah/3331:
+ * elf32-m68hc11.c (m68hc11_elf_relax_section): Clear prev_insn_group
+ when we couldn't relax something.
+
+2003-04-25 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.h (elf_merge_symbol): When we find a regular definition
+ for an indirect symbol, flip the indirection so that the old
+ direct symbol now points to the new definition.
+
+2003-04-24 Roland McGrath <roland@redhat.com>
+
+ * elf.c (bfd_section_from_phdr): Map PT_GNU_EH_FRAME to "eh_frame_hdr".
+
+2003-04-24 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-ppc.c: Formatting and comment fixes.
+ (ELIMINATE_COPY_RELOCS): Move before ppc_elf_copy_indirect_symbol.
+ (ppc_elf_copy_indirect_symbol): Copy flags here for weakdefs.
+
+2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
+
+ * archures.c (bfd_mach_h8300hn, bfd_mach_h8300sn): Added.
+ * bfd-in2.h: Rebuilt.
+ * coff-h8300.c (BADMAG): Add check for H8300HNBADMAG & H8300SNBADMAG.
+ * coffcode.h (coff_set_arch_mach_hook): Add case for H8300HNMAGIC
+ & H8300SNMAGIC.
+ (coff_set_flags): Add case for bfd_mach_h8300hn & bfd_mach_h8300sn.
+ * cpu-h8300.c (h8300_scan): Handle h8300hn, h8300sn.
+ (h8300sn_info_struct, h8300hn_info_struct): New.
+ * elf32-h8300.c (elf32_h8_mach): Handle case for h8300hn & h8300sn
+ (elf32_h8_final_write_processing): Likewise.
+
+2003-04-23 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * elf32-sh.c (tpoff): New.
+ (struct elf_sh_dyn_relocs): Remove tls_tpoff32.
+ (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
+ (allocate_dynrelocs): Don't make unnecessary dynamic TLS
+ relocations. Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses.
+ (sh_elf_relocate_section): Likewise. Remove unnecessary tests.
+ (dtpoff_base): Fix wrong indentation.
+ (sh_elf_check_relocs): Don't set DF_STATIC_TLS flag with non-TLS
+ relocations. Don't set tls_tpoff32 flag. Don't make unnecessary
+ R_SH_TLS_TPOFF32 relocations.
+
+2003-04-23 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * archures.c (enum bfd_architecture): Amend comment to refer to SuperH.
+ * cpu-sh.c: Likewise.
+ * elf32-sh.c: Likewise.
+ * reloc.c (bfd_reloc_code_real): Likewise.
+ * elf32-sh64-com.c: Change comment to refer to SuperH.
+ * elf32-sh64.c: Likewise.
+ * elf64-sh64.c: Likewise.
+ * bfd-in2.h (enum bfd_architecture): Regenerate.
+
+2003-04-23 Alan Modra <amodra@bigpond.net.au>
+
+ From Julien LEMOINE <speedblue@debian.org>
+ * elf32-i386.c (elf_i386_info_to_howto): Delete.
+ (elf_info_to_howto): Define as elf_i386_info_to_howto_rel.
+
+2003-04-22 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * archures.c: Replace references to Mitsubishi M32R with references
+ to Renesas M32R.
+ * relocs.c: Likewise.
+ * bfd-in2.h: Regenerate.
+
+2003-04-21 Richard Henderson <rth@redhat.com>
+
+ * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Return false for an
+ executable when a symbol is defined both regular and dynamic.
+
+2003-04-21 Stephane Carrez <stcarrez@nerim.fr>
+
+ * Makefile.am (BFD32_BACKENDS): Add elf32-m68hc1x.lo.
+ (elf32-m68hc1x.lo): Update dependencies
+ * configure.in: Add elf32-m68hc1x.lo.
+ * configure: Rebuild.
+ * Makefile.in: Rebuild.
+
+2003-04-21 Stephane Carrez <stcarrez@nerim.fr>
+
+ * elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
+ (m68hc11_elf_hash_table_create): New function.
+ (elf32_m68hc11_link_hash_table_free): New function.
+ (stub_hash_newfunc): New function.
+ (m68hc11_add_stub): New function.
+ (elf32_m68hc11_add_symbol_hook): New function.
+ (elf32_m68hc11_setup_section_lists): New function.
+ (elf32_m68hc11_next_input_section): New function.
+ (elf32_m68hc11_size_stubs): New function.
+ (elf32_m68hc11_build_stubs): New function.
+ (m68hc11_get_relocation_value): New function.
+ (elf32_m68hc11_relocate_section): Call the above to redirect
+ some relocations to the trampoline code.
+ (m68hc11_elf_export_one_stub): New function.
+ (m68hc11_elf_set_symbol): New function.
+ (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse.
+ (m68hc11_elf_get_bank_parameters): Get parameters only when the info
+ is not yet initialized.
+
+ * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
+ (elf32_m68hc11_stub_hash_entry): New struct.
+ (m68hc11_page_info): Add trampoline handler address.
+ (m68hc11_elf_link_hash_table): Add stubs generation members.
+ (elf32_m68hc11_add_symbol_hook): Declare.
+ (elf32_m68hc11_setup_section_lists): Declare.
+ (elf32_m68hc11_size_stubs): Declare.
+ (elf32_m68hc11_build_stubs): Declare.
+
+ * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c.
+ (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise.
+ (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto.
+ (_bfd_m68hc11_elf_set_private_flags): Ditto.
+ (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto.
+ (_bfd_m68hc11_elf_print_private_bfd_data): Ditto.
+ (bfd_elf32_bfd_link_hash_table_create): Define.
+ (elf_backend_add_symbol_hook): Define.
+ (m68hc11_elf_bfd_link_hash_table_create): New function.
+ (m68hc11_elf_build_one_stub): New function.
+ (m68hc11_elf_size_one_stub): New function.
+ (m68hc11_elf_bfd_link_hash_table_create): Install the above.
+ (bfd_elf32_bfd_link_hash_table_create): Define.
+
+ * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove.
+ (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked.
+ (m68hc12_phys_addr): Ditto.
+ (m68hc12_phys_page): Ditto.
+ (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c.
+ (elf32_m68hc11_gc_mark_hook): Likewise.
+ (elf32_m68hc11_gc_sweep_hook): Likewise.
+ (elf32_m68hc11_check_relocs): Likewise.
+ (elf32_m68hc11_relocate_section): Likewise.
+ (_bfd_m68hc12_elf_set_private_flags): Likewise.
+ (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise.
+ (_bfd_m68hc12_elf_print_private_bfd_data): Likewise.
+ (m68hc12_elf_build_one_stub): New function.
+ (m68hc12_elf_size_one_stub): New function.
+ (m68hc12_elf_bfd_link_hash_table_create): New function, use the above.
+ (elf_backend_add_symbol_hook): Define.
+ (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
+
2003-04-18 Nick Clifton <nickc@redhat.com>
* format.c (bfd_check_format_matches): Only check associated
@@ -147,33 +570,33 @@
2003-04-01 Bob Wilson <bob.wilson@acm.org>
- * Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo.
- (ALL_MACHINES_CFILES): Add cpu-xtensa.c.
- (BFD32_BACKENDS): Add elf32-xtensa.lo, xtensa-isa.lo, and
- xtensa-modules.lo.
- (BFD32_BACKENDS_CFILES): Add elf32-xtensa.c, xtensa-isa.c, and
- xtensa-modules.c.
- (cpu-xtensa.lo): New target.
- (elf32-xtensa.lo): Likewise.
- (xtensa-isa.lo): Likewise.
- (xtensa-modules.lo): Likewise.
- * Makefile.in: Regenerate.
- * archures.c (bfd_architecture): Add bfd_{arch,mach}_xtensa.
- (bfd_archures_list): Add bfd_xtensa_arch.
- * config.bfd: Handle xtensa-*-*.
- * configure.in: Handle bfd_elf32_xtensa_{le,be}_vec.
- * configure: Regenerate.
- * reloc.c: Add BFD_RELOC_XTENSA_{RTLD,GLOB_DAT,JMP_SLOT,RELATIVE,
- PLT,OP0,OP1,OP2,ASM_EXPAND,ASM_SIMPLIFY}.
- * targets.c (bfd_elf32_xtensa_be_vec): Declare.
- (bfd_elf32_xtensa_le_vec): Likewise.
- (bfd_target_vector): Add bfd_elf32_xtensa_{be,le}_vec.
- * cpu-xtensa.c: New file.
- * elf32-xtensa.c: Likewise.
- * xtensa-isa.c: Likewise.
- * xtensa-modules.c: Likewise.
- * libbfd.h: Regenerate.
- * bfd-in2.h: Likewise.
+ * Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo.
+ (ALL_MACHINES_CFILES): Add cpu-xtensa.c.
+ (BFD32_BACKENDS): Add elf32-xtensa.lo, xtensa-isa.lo, and
+ xtensa-modules.lo.
+ (BFD32_BACKENDS_CFILES): Add elf32-xtensa.c, xtensa-isa.c, and
+ xtensa-modules.c.
+ (cpu-xtensa.lo): New target.
+ (elf32-xtensa.lo): Likewise.
+ (xtensa-isa.lo): Likewise.
+ (xtensa-modules.lo): Likewise.
+ * Makefile.in: Regenerate.
+ * archures.c (bfd_architecture): Add bfd_{arch,mach}_xtensa.
+ (bfd_archures_list): Add bfd_xtensa_arch.
+ * config.bfd: Handle xtensa-*-*.
+ * configure.in: Handle bfd_elf32_xtensa_{le,be}_vec.
+ * configure: Regenerate.
+ * reloc.c: Add BFD_RELOC_XTENSA_{RTLD,GLOB_DAT,JMP_SLOT,RELATIVE,
+ PLT,OP0,OP1,OP2,ASM_EXPAND,ASM_SIMPLIFY}.
+ * targets.c (bfd_elf32_xtensa_be_vec): Declare.
+ (bfd_elf32_xtensa_le_vec): Likewise.
+ (bfd_target_vector): Add bfd_elf32_xtensa_{be,le}_vec.
+ * cpu-xtensa.c: New file.
+ * elf32-xtensa.c: Likewise.
+ * xtensa-isa.c: Likewise.
+ * xtensa-modules.c: Likewise.
+ * libbfd.h: Regenerate.
+ * bfd-in2.h: Likewise.
2003-04-01 Nick Clifton <nickc@redhat.com>
@@ -198,7 +621,7 @@
bfd_arm_get_mach_from_notes.
(elf32_arm_merge_private_bfd_data): Use bfd_arm_merge_machines.
(elf32_arm_final_write_processing): Use bfd_arm_update_notes.
-
+
2003-04-01 Ben Elliston <bje@wasabisystems.com>
* dwarf2.c (read_attribute_value): Correct typo in comment.
@@ -250,7 +673,7 @@
* linker.c (bfd_generic_final_link): Likewise.
* opncls.c (find_separate_debug_info): Likewise.
* simple.c (bfd_simple_get_relocated_section_contents): Likewise.
-
+
2003-03-28 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_add_object_symbols): Correctly combine
@@ -277,7 +700,7 @@
2003-03-25 Stan Cox <scox@redhat.com>
Nick Clifton <nickc@redhat.com>
-
+
Contribute support for Intel's iWMMXt chip - an ARM variant:
* archures.c: Add bfd_mach_arm_iWMMXt.
@@ -332,8 +755,8 @@
2003-03-18 Richard Henderson <rth@redhat.com>
- * elfxx-ia64.c (get_dyn_sym_info): Return NULL gracefully for
- local symbols that have no dyninfo.
+ * elfxx-ia64.c (get_dyn_sym_info): Return NULL gracefully for
+ local symbols that have no dyninfo.
2003-03-14 Gene Smith <gene.smith@siemens.com>
@@ -509,7 +932,7 @@
(elfNN_ia64_relax_section): Handle LTOFF22X, LDXMOV.
(elfNN_ia64_choose_gp): Split out from ...
(elfNN_ia64_final_link): ... here.
-
+
2003-02-27 Andrew Cagney <cagney@redhat.com>
* bfd.c (struct bfd): Rename "struct _bfd".
@@ -1130,7 +1553,7 @@
* libbfd.h: Regenerate.
* reloc.c: Add s390 TLS relocations.
-2003-01-24 Charles Lepple clepple.ghz.cc
+2003-01-24 Charles Lepple <clepple@ghz.cc>
* aclocal.m4: Fix name of --enable-install-libbfd switch.
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index ee04261549e..5ecaa5b1600 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -231,6 +231,7 @@ BFD32_BACKENDS = \
elf32-m32r.lo \
elf32-m68hc11.lo \
elf32-m68hc12.lo \
+ elf32-m68hc1x.lo \
elf32-m68k.lo \
elf32-m88k.lo \
elf-m10200.lo \
@@ -394,6 +395,7 @@ BFD32_BACKENDS_CFILES = \
elf32-m68k.c \
elf32-m68hc11.c \
elf32-m68hc12.c \
+ elf32-m68hc1x.c \
elf32-m88k.c \
elf-m10200.c \
elf-m10300.c \
@@ -1206,12 +1208,16 @@ elf32-m68k.lo: elf32-m68k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf32-m68hc11.lo: elf32-m68hc11.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/m68hc11.h \
- $(INCDIR)/elf/reloc-macros.h elf32-target.h
+ $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m68hc1x.h
elf32-m68hc12.lo: elf32-m68hc12.c $(INCDIR)/filenames.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/m68hc11.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/m68hc11.h \
- elf32-target.h
+ elf32-target.h elf32-m68hc1x.h
+elf32-m68hc1x.lo: elf32-m68hc1x.c $(INCDIR)/filenames.h \
+ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/m68hc11.h \
+ $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m68hc1x.h
elf32-m88k.lo: elf32-m88k.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h elf32-target.h
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 3de6121d8e4..d8fc69f4f59 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -358,6 +358,7 @@ BFD32_BACKENDS = \
elf32-m32r.lo \
elf32-m68hc11.lo \
elf32-m68hc12.lo \
+ elf32-m68hc1x.lo \
elf32-m68k.lo \
elf32-m88k.lo \
elf-m10200.lo \
@@ -522,6 +523,7 @@ BFD32_BACKENDS_CFILES = \
elf32-m68k.c \
elf32-m68hc11.c \
elf32-m68hc12.c \
+ elf32-m68hc1x.c \
elf32-m88k.c \
elf-m10200.c \
elf-m10300.c \
@@ -1739,12 +1741,16 @@ elf32-m68k.lo: elf32-m68k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf32-m68hc11.lo: elf32-m68hc11.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/m68hc11.h \
- $(INCDIR)/elf/reloc-macros.h elf32-target.h
+ $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m68hc1x.h
elf32-m68hc12.lo: elf32-m68hc12.c $(INCDIR)/filenames.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/m68hc11.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/m68hc11.h \
- elf32-target.h
+ elf32-target.h elf32-m68hc1x.h
+elf32-m68hc1x.lo: elf32-m68hc1x.c $(INCDIR)/filenames.h \
+ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/m68hc11.h \
+ $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m68hc1x.h
elf32-m88k.lo: elf32-m88k.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h elf32-target.h
diff --git a/bfd/acinclude.m4 b/bfd/acinclude.m4
index 7c2902c1330..bf328dbafc7 100644
--- a/bfd/acinclude.m4
+++ b/bfd/acinclude.m4
@@ -127,7 +127,7 @@ AC_SUBST(INTLLIBS)
AC_DEFUN([AM_INSTALL_LIBBFD],
[AC_MSG_CHECKING([whether to install libbfd])
AC_ARG_ENABLE(install-libbfd,
-[ --install-libbfd controls installation of libbfd and related headers],
+[ --enable-install-libbfd controls installation of libbfd and related headers],
install_libbfd_p=$enableval,
if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then
install_libbfd_p=yes
diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4
index 9e739ea7737..3673e07f43f 100644
--- a/bfd/aclocal.m4
+++ b/bfd/aclocal.m4
@@ -173,6 +173,24 @@ else
$1_FALSE=
fi])
+#serial 1
+# This test replaces the one in autoconf.
+# Currently this macro should have the same name as the autoconf macro
+# because gettext's gettext.m4 (distributed in the automake package)
+# still uses it. Otherwise, the use in gettext.m4 makes autoheader
+# give these diagnostics:
+# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
+# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
+
+undefine([AC_ISC_POSIX])
+
+AC_DEFUN([AC_ISC_POSIX],
+ [
+ dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
+ AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
+ ]
+)
+
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
diff --git a/bfd/archures.c b/bfd/archures.c
index 20087b2d9b6..3d473c3b8a2 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -164,9 +164,11 @@ DESCRIPTION
. bfd_arch_m98k, {* Motorola 98xxx *}
. bfd_arch_pyramid, {* Pyramid Technology *}
. bfd_arch_h8300, {* Renesas H8/300 (formerly Hitachi H8/300) *}
-.#define bfd_mach_h8300 1
-.#define bfd_mach_h8300h 2
-.#define bfd_mach_h8300s 3
+.#define bfd_mach_h8300 1
+.#define bfd_mach_h8300h 2
+.#define bfd_mach_h8300s 3
+.#define bfd_mach_h8300hn 4
+.#define bfd_mach_h8300sn 5
. bfd_arch_pdp11, {* DEC PDP-11 *}
. bfd_arch_powerpc, {* PowerPC *}
.#define bfd_mach_ppc 32
@@ -209,7 +211,7 @@ DESCRIPTION
.#define bfd_mach_z8001 1
.#define bfd_mach_z8002 2
. bfd_arch_h8500, {* Renesas H8/500 (formerly Hitachi H8/500) *}
-. bfd_arch_sh, {* Renesas SH (formerly Hitachi SH) *}
+. bfd_arch_sh, {* Renesas / SuperH SH (formerly Hitachi SH) *}
.#define bfd_mach_sh 1
.#define bfd_mach_sh2 0x20
.#define bfd_mach_sh_dsp 0x2d
@@ -253,7 +255,7 @@ DESCRIPTION
.#define bfd_mach_arc_6 6
.#define bfd_mach_arc_7 7
.#define bfd_mach_arc_8 8
-. bfd_arch_m32r, {* Mitsubishi M32R/D *}
+. bfd_arch_m32r, {* Renesas M32R (formerly Mitsubishi M32R/D) *}
.#define bfd_mach_m32r 1 {* For backwards compatibility. *}
.#define bfd_mach_m32rx 'x'
. bfd_arch_mn10200, {* Matsushita MN10200 *}
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index c39bfedd59f..93fd0fd13b3 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -651,9 +651,7 @@ struct bfd_link_needed_list
const char *name;
};
-extern bfd_boolean bfd_elf32_record_link_assignment
- PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean));
-extern bfd_boolean bfd_elf64_record_link_assignment
+extern bfd_boolean bfd_elf_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean));
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
PARAMS ((bfd *, struct bfd_link_info *));
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index d349f77f01e..637376bc0dd 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -658,9 +658,7 @@ struct bfd_link_needed_list
const char *name;
};
-extern bfd_boolean bfd_elf32_record_link_assignment
- PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean));
-extern bfd_boolean bfd_elf64_record_link_assignment
+extern bfd_boolean bfd_elf_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean));
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
PARAMS ((bfd *, struct bfd_link_info *));
@@ -1291,8 +1289,10 @@ typedef struct sec
/* Bits used by various backends. */
unsigned int has_tls_reloc:1;
+ /* Nonzero if this section needs the relax finalize pass. */
+ unsigned int need_finalize_relax:1;
+
/* Usused bits. */
- unsigned int flag11:1;
unsigned int flag12:1;
unsigned int flag13:1;
unsigned int flag14:1;
@@ -1630,9 +1630,11 @@ enum bfd_architecture
bfd_arch_m98k, /* Motorola 98xxx */
bfd_arch_pyramid, /* Pyramid Technology */
bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */
-#define bfd_mach_h8300 1
-#define bfd_mach_h8300h 2
-#define bfd_mach_h8300s 3
+#define bfd_mach_h8300 1
+#define bfd_mach_h8300h 2
+#define bfd_mach_h8300s 3
+#define bfd_mach_h8300hn 4
+#define bfd_mach_h8300sn 5
bfd_arch_pdp11, /* DEC PDP-11 */
bfd_arch_powerpc, /* PowerPC */
#define bfd_mach_ppc 32
@@ -1675,7 +1677,7 @@ enum bfd_architecture
#define bfd_mach_z8001 1
#define bfd_mach_z8002 2
bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */
- bfd_arch_sh, /* Renesas SH (formerly Hitachi SH) */
+ bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */
#define bfd_mach_sh 1
#define bfd_mach_sh2 0x20
#define bfd_mach_sh_dsp 0x2d
@@ -1719,7 +1721,7 @@ enum bfd_architecture
#define bfd_mach_arc_6 6
#define bfd_mach_arc_7 7
#define bfd_mach_arc_8 8
- bfd_arch_m32r, /* Mitsubishi M32R/D */
+ bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */
#define bfd_mach_m32r 1 /* For backwards compatibility. */
#define bfd_mach_m32rx 'x'
bfd_arch_mn10200, /* Matsushita MN10200 */
@@ -2598,7 +2600,7 @@ field in the instruction. */
BFD_RELOC_ARM_GOTOFF,
BFD_RELOC_ARM_GOTPC,
-/* Renesas SH relocs. Not all of these appear in object files. */
+/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
BFD_RELOC_SH_PCDISP8BY2,
BFD_RELOC_SH_PCDISP12BY2,
BFD_RELOC_SH_IMM4,
@@ -2776,7 +2778,7 @@ of the container. */
/* DLX relocs */
BFD_RELOC_DLX_JMP26,
-/* Mitsubishi M32R relocs.
+/* Renesas M32R (formerly Mitsubishi M32R) relocs.
This is a 24 bit absolute address. */
BFD_RELOC_M32R_24,
diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c
index dab7e017041..ac091533553 100644
--- a/bfd/coff-h8300.c
+++ b/bfd/coff-h8300.c
@@ -281,8 +281,9 @@ static reloc_howto_type howto_table[] = {
#define SELECT_RELOC(x,howto) \
{ x.r_type = select_reloc (howto); }
-#define BADMAG(x) (H8300BADMAG (x) && H8300HBADMAG (x) && H8300SBADMAG (x))
-#define H8300 1 /* Customize coffcode.h */
+#define BADMAG(x) (H8300BADMAG (x) && H8300HBADMAG (x) && H8300SBADMAG (x) \
+ && H8300HNBADMAG(x) && H8300SNBADMAG(x))
+#define H8300 1 /* Customize coffcode.h */
#define __A_MAGIC_SET__
/* Code to swap in the reloc. */
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 5c6c286c064..31338ee99ea 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -2071,7 +2071,7 @@ coff_set_arch_mach_hook (abfd, filehdr)
case H8300MAGIC:
arch = bfd_arch_h8300;
machine = bfd_mach_h8300;
- /* !! FIXME this probably isn't the right place for this */
+ /* !! FIXME this probably isn't the right place for this. */
abfd->flags |= BFD_IS_RELAXABLE;
break;
#endif
@@ -2080,7 +2080,7 @@ coff_set_arch_mach_hook (abfd, filehdr)
case H8300HMAGIC:
arch = bfd_arch_h8300;
machine = bfd_mach_h8300h;
- /* !! FIXME this probably isn't the right place for this */
+ /* !! FIXME this probably isn't the right place for this. */
abfd->flags |= BFD_IS_RELAXABLE;
break;
#endif
@@ -2089,7 +2089,25 @@ coff_set_arch_mach_hook (abfd, filehdr)
case H8300SMAGIC:
arch = bfd_arch_h8300;
machine = bfd_mach_h8300s;
- /* !! FIXME this probably isn't the right place for this */
+ /* !! FIXME this probably isn't the right place for this. */
+ abfd->flags |= BFD_IS_RELAXABLE;
+ break;
+#endif
+
+#ifdef H8300HNMAGIC
+ case H8300HNMAGIC:
+ arch = bfd_arch_h8300;
+ machine = bfd_mach_h8300hn;
+ /* !! FIXME this probably isn't the right place for this. */
+ abfd->flags |= BFD_IS_RELAXABLE;
+ break;
+#endif
+
+#ifdef H8300SNMAGIC
+ case H8300SNMAGIC:
+ arch = bfd_arch_h8300;
+ machine = bfd_mach_h8300sn;
+ /* !! FIXME this probably isn't the right place for this. */
abfd->flags |= BFD_IS_RELAXABLE;
break;
#endif
@@ -2739,6 +2757,12 @@ coff_set_flags (abfd, magicp, flagsp)
case bfd_mach_h8300s:
*magicp = H8300SMAGIC;
return TRUE;
+ case bfd_mach_h8300hn:
+ *magicp = H8300HNMAGIC;
+ return TRUE;
+ case bfd_mach_h8300sn:
+ *magicp = H8300SNMAGIC;
+ return TRUE;
}
break;
#endif
diff --git a/bfd/configure b/bfd/configure
index ad1475dc32c..47eaef7476f 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -734,249 +734,49 @@ test "$host_alias" != "$target_alias" &&
NONENONEs,x,x, &&
program_prefix=${target_alias}-
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:741: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:771: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_prog_rejected=no
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# -gt 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- set dummy "$ac_dir/$ac_word" "$@"
- shift
- ac_cv_prog_CC="$@"
- fi
-fi
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
- if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32*)
- # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:822: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
+echo "configure:740: checking for strerror in -lcposix" >&5
+ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="cl"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
- ;;
- esac
- fi
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:854: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext << EOF
-
-#line 865 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-lcposix $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 748 "configure"
#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strerror();
-main(){return(0);}
+int main() {
+strerror()
+; return 0; }
EOF
-if { (eval echo configure:870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- ac_cv_prog_cc_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
- ac_cv_prog_cc_cross=no
- else
- ac_cv_prog_cc_cross=yes
- fi
+if { (eval echo configure:759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
-fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:896: 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:901: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
-else
- ac_cv_prog_gcc=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-else
- GCC=
-fi
-
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:929: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
-else
- ac_cv_prog_cc_g=no
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
+LIBS="$ac_save_LIBS"
fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-
-echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:961: checking for POSIXized ISC" >&5
-if test -d /etc/conf/kconfig.d &&
- grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
-then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ISC=yes # If later tests want to check for ISC.
- cat >> confdefs.h <<\EOF
-#define _POSIX_SOURCE 1
-EOF
-
- if test "$GCC" = yes; then
- CC="$CC -posix"
- else
- CC="$CC -Xp"
- fi
+ LIBS="$LIBS -lcposix"
else
echo "$ac_t""no" 1>&6
- ISC=
fi
+
+
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -990,7 +790,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:994: checking for a BSD compatible install" >&5
+echo "configure:794: 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
@@ -1043,7 +843,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:1047: checking whether build environment is sane" >&5
+echo "configure:847: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -1100,7 +900,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1104: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:904: 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
@@ -1129,7 +929,7 @@ fi
PACKAGE=bfd
-VERSION=2.13.90
+VERSION=2.14.90
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
{ echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -1146,7 +946,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1150: checking for working aclocal" >&5
+echo "configure:950: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1159,7 +959,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1163: checking for working autoconf" >&5
+echo "configure:963: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1172,7 +972,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1176: checking for working automake" >&5
+echo "configure:976: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1185,7 +985,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1189: checking for working autoheader" >&5
+echo "configure:989: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1198,7 +998,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1202: checking for working makeinfo" >&5
+echo "configure:1002: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1233,7 +1033,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:1237: checking for $ac_word" >&5
+echo "configure:1037: 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
@@ -1265,7 +1065,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:1269: checking for $ac_word" >&5
+echo "configure:1069: 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
@@ -1297,7 +1097,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:1301: checking for $ac_word" >&5
+echo "configure:1101: 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
@@ -1400,6 +1200,228 @@ else
enable_fast_install=yes
fi
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1207: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1237: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_prog_rejected=no
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1288: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1320: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 1331 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:1336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1362: 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:1367: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1395: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+
# Check whether --with-gnu-ld or --without-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
withval="$with_gnu_ld"
@@ -1412,7 +1434,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:1416: checking for ld used by GCC" >&5
+echo "configure:1438: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1442,10 +1464,10 @@ echo "configure:1416: 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:1446: checking for GNU ld" >&5
+echo "configure:1468: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1449: checking for non-GNU ld" >&5
+echo "configure:1471: 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
@@ -1480,7 +1502,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:1484: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1506: 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
@@ -1497,7 +1519,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:1501: checking for $LD option to reload object files" >&5
+echo "configure:1523: 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
@@ -1509,7 +1531,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:1513: checking for BSD-compatible nm" >&5
+echo "configure:1535: 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
@@ -1547,7 +1569,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:1551: checking whether ln -s works" >&5
+echo "configure:1573: 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
@@ -1568,7 +1590,7 @@ else
fi
echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1572: checking how to recognise dependant libraries" >&5
+echo "configure:1594: 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
@@ -1678,7 +1700,7 @@ irix5* | irix6*)
# This must be Linux ELF.
linux-gnu*)
case $host_cpu in
- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
+ alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
lt_cv_deplibs_check_method=pass_all ;;
*)
# glibc up to 2.1.1 does not perform some relocations on ARM
@@ -1741,13 +1763,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:1745: checking for object suffix" >&5
+echo "configure:1767: 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:1751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -1767,7 +1789,7 @@ ac_objext=$ac_cv_objext
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1771: checking for executable suffix" >&5
+echo "configure:1793: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1777,7 +1799,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -1804,7 +1826,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:1808: checking for ${ac_tool_prefix}file" >&5
+echo "configure:1830: 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
@@ -1866,7 +1888,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:1870: checking for file" >&5
+echo "configure:1892: 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
@@ -1937,7 +1959,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:1941: checking for $ac_word" >&5
+echo "configure:1963: 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
@@ -1969,7 +1991,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:1973: checking for $ac_word" >&5
+echo "configure:1995: 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
@@ -2004,7 +2026,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:2008: checking for $ac_word" >&5
+echo "configure:2030: 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
@@ -2036,7 +2058,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:2040: checking for $ac_word" >&5
+echo "configure:2062: 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
@@ -2103,8 +2125,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 2107 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 2129 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if test "$lt_cv_prog_gnu_ld" = yes; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
@@ -2137,7 +2159,7 @@ case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:2141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*ELF-32*)
HPUX_IA64_MODE="32"
@@ -2155,7 +2177,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:2159: checking whether the C compiler needs -belf" >&5
+echo "configure:2181: 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
@@ -2168,14 +2190,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 2172 "configure"
+#line 2194 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2201: \"$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
@@ -2365,7 +2387,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:2369: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2391: 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"
@@ -2388,7 +2410,7 @@ fi
echo $ac_n "checking whether to install libbfd""... $ac_c" 1>&6
-echo "configure:2392: checking whether to install libbfd" >&5
+echo "configure:2414: 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"
@@ -2425,7 +2447,7 @@ fi
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2429: checking for executable suffix" >&5
+echo "configure:2451: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2435,7 +2457,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:2439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:2461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -2465,7 +2487,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:2469: checking for $ac_word" >&5
+echo "configure:2491: 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
@@ -2495,7 +2517,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:2499: checking for $ac_word" >&5
+echo "configure:2521: 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
@@ -2546,7 +2568,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:2550: checking for $ac_word" >&5
+echo "configure:2572: 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
@@ -2578,7 +2600,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2582: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2604: 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.
@@ -2589,12 +2611,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 2593 "configure"
+#line 2615 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:2598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2620: \"$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
@@ -2620,12 +2642,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:2624: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2646: 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:2629: checking whether we are using GNU C" >&5
+echo "configure:2651: 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
@@ -2634,7 +2656,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2638: \"$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:2660: \"$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
@@ -2653,7 +2675,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:2657: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2679: 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
@@ -2687,7 +2709,7 @@ fi
ALL_LINGUAS="fr tr ja es sv da zh_CN"
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2691: checking how to run the C preprocessor" >&5
+echo "configure:2713: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2702,13 +2724,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 2706 "configure"
+#line 2728 "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:2712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2734: \"$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
:
@@ -2719,13 +2741,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2723 "configure"
+#line 2745 "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:2729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2751: \"$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
:
@@ -2736,13 +2758,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2740 "configure"
+#line 2762 "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:2746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2768: \"$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
:
@@ -2769,7 +2791,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:2773: checking for $ac_word" >&5
+echo "configure:2795: 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
@@ -2797,12 +2819,12 @@ else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2801: checking for ANSI C header files" >&5
+echo "configure:2823: 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 2806 "configure"
+#line 2828 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2810,7 +2832,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2836: \"$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*
@@ -2827,7 +2849,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 2831 "configure"
+#line 2853 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2845,7 +2867,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 2849 "configure"
+#line 2871 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2866,7 +2888,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2870 "configure"
+#line 2892 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2877,7 +2899,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2901,12 +2923,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2905: checking for working const" >&5
+echo "configure:2927: 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 2910 "configure"
+#line 2932 "configure"
#include "confdefs.h"
int main() {
@@ -2955,7 +2977,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:2959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -2976,21 +2998,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2980: checking for inline" >&5
+echo "configure:3002: 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 2987 "configure"
+#line 3009 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:2994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -3016,12 +3038,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3020: checking for off_t" >&5
+echo "configure:3042: 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 3025 "configure"
+#line 3047 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3049,12 +3071,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3053: checking for size_t" >&5
+echo "configure:3075: 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 3058 "configure"
+#line 3080 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3084,19 +3106,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:3088: checking for working alloca.h" >&5
+echo "configure:3110: 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 3093 "configure"
+#line 3115 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:3100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3122: \"$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
@@ -3117,12 +3139,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3121: checking for alloca" >&5
+echo "configure:3143: 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 3126 "configure"
+#line 3148 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -3150,7 +3172,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3176: \"$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
@@ -3182,12 +3204,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:3186: checking whether alloca needs Cray hooks" >&5
+echo "configure:3208: 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 3191 "configure"
+#line 3213 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -3212,12 +3234,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:3216: checking for $ac_func" >&5
+echo "configure:3238: 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 3221 "configure"
+#line 3243 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3240,7 +3262,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3266: \"$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
@@ -3267,7 +3289,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3271: checking stack direction for C alloca" >&5
+echo "configure:3293: 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
@@ -3275,7 +3297,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 3279 "configure"
+#line 3301 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -3294,7 +3316,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:3298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3320: \"$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
@@ -3319,17 +3341,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3323: checking for $ac_hdr" >&5
+echo "configure:3345: 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 3328 "configure"
+#line 3350 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3355: \"$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*
@@ -3358,12 +3380,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3362: checking for $ac_func" >&5
+echo "configure:3384: 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 3367 "configure"
+#line 3389 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3386,7 +3408,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3412: \"$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
@@ -3411,7 +3433,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3415: checking for working mmap" >&5
+echo "configure:3437: 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
@@ -3419,7 +3441,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 3423 "configure"
+#line 3445 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3559,7 +3581,7 @@ main()
}
EOF
-if { (eval echo configure:3563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3585: \"$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
@@ -3587,17 +3609,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:3591: checking for $ac_hdr" >&5
+echo "configure:3613: 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 3596 "configure"
+#line 3618 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3623: \"$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*
@@ -3627,12 +3649,12 @@ done
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3631: checking for $ac_func" >&5
+echo "configure:3653: 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 3636 "configure"
+#line 3658 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3655,7 +3677,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3681: \"$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
@@ -3684,12 +3706,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3688: checking for $ac_func" >&5
+echo "configure:3710: 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 3693 "configure"
+#line 3715 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3712,7 +3734,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3716: \"$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*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3746,19 +3768,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3750: checking for LC_MESSAGES" >&5
+echo "configure:3772: 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 3755 "configure"
+#line 3777 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:3762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3784: \"$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
@@ -3779,7 +3801,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3783: checking whether NLS is requested" >&5
+echo "configure:3805: 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"
@@ -3799,7 +3821,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3803: checking whether included gettext is requested" >&5
+echo "configure:3825: 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"
@@ -3818,17 +3840,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3822: checking for libintl.h" >&5
+echo "configure:3844: 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 3827 "configure"
+#line 3849 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3854: \"$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*
@@ -3845,19 +3867,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:3849: checking for gettext in libc" >&5
+echo "configure:3871: 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 3854 "configure"
+#line 3876 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:3861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3883: \"$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
@@ -3873,7 +3895,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:3877: checking for bindtextdomain in -lintl" >&5
+echo "configure:3899: 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
@@ -3881,7 +3903,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3885 "configure"
+#line 3907 "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
@@ -3892,7 +3914,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:3896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3918: \"$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
@@ -3908,19 +3930,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:3912: checking for gettext in libintl" >&5
+echo "configure:3934: 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 3917 "configure"
+#line 3939 "configure"
#include "confdefs.h"
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:3924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3946: \"$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
@@ -3948,7 +3970,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:3952: checking for $ac_word" >&5
+echo "configure:3974: 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
@@ -3982,12 +4004,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3986: checking for $ac_func" >&5
+echo "configure:4008: 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 3991 "configure"
+#line 4013 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4010,7 +4032,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4036: \"$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
@@ -4037,7 +4059,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:4041: checking for $ac_word" >&5
+echo "configure:4063: 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
@@ -4073,7 +4095,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:4077: checking for $ac_word" >&5
+echo "configure:4099: 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
@@ -4105,7 +4127,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 4109 "configure"
+#line 4131 "configure"
#include "confdefs.h"
int main() {
@@ -4113,7 +4135,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:4117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -4145,7 +4167,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:4149: checking for $ac_word" >&5
+echo "configure:4171: 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
@@ -4179,7 +4201,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:4183: checking for $ac_word" >&5
+echo "configure:4205: 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
@@ -4215,7 +4237,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:4219: checking for $ac_word" >&5
+echo "configure:4241: 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
@@ -4305,7 +4327,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:4309: checking for catalogs to be installed" >&5
+echo "configure:4331: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -4333,17 +4355,17 @@ echo "configure:4309: 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:4337: checking for linux/version.h" >&5
+echo "configure:4359: 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 4342 "configure"
+#line 4364 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4369: \"$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*
@@ -4421,7 +4443,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:4425: checking for a BSD compatible install" >&5
+echo "configure:4447: 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
@@ -4504,7 +4526,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:4508: checking for build system executable suffix" >&5
+echo "configure:4530: 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
@@ -4532,17 +4554,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:4536: checking for $ac_hdr" >&5
+echo "configure:4558: 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 4541 "configure"
+#line 4563 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4568: \"$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*
@@ -4572,17 +4594,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:4576: checking for $ac_hdr" >&5
+echo "configure:4598: 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 4581 "configure"
+#line 4603 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4608: \"$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*
@@ -4609,12 +4631,12 @@ fi
done
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:4613: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:4635: 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 4618 "configure"
+#line 4640 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -4623,7 +4645,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:4627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -4648,12 +4670,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:4652: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4674: 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 4657 "configure"
+#line 4679 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -4661,7 +4683,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:4665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -4686,7 +4708,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:4690: checking for opendir in -ldir" >&5
+echo "configure:4712: 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
@@ -4694,7 +4716,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4698 "configure"
+#line 4720 "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
@@ -4705,7 +4727,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4731: \"$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
@@ -4727,7 +4749,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4731: checking for opendir in -lx" >&5
+echo "configure:4753: 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
@@ -4735,7 +4757,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4739 "configure"
+#line 4761 "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
@@ -4746,7 +4768,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4772: \"$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
@@ -4771,12 +4793,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:4775: checking for $ac_func" >&5
+echo "configure:4797: 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 4780 "configure"
+#line 4802 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4799,7 +4821,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4825: \"$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
@@ -4834,12 +4856,12 @@ EOF
esac
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4838: checking whether strstr must be declared" >&5
+echo "configure:4860: 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 4843 "configure"
+#line 4865 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4860,7 +4882,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:4864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -4881,12 +4903,12 @@ EOF
fi
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:4885: checking whether malloc must be declared" >&5
+echo "configure:4907: 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 4890 "configure"
+#line 4912 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4907,7 +4929,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:4911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_malloc=no
else
@@ -4928,12 +4950,12 @@ EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:4932: checking whether realloc must be declared" >&5
+echo "configure:4954: 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 4937 "configure"
+#line 4959 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4954,7 +4976,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:4958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_realloc=no
else
@@ -4975,12 +4997,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:4979: checking whether free must be declared" >&5
+echo "configure:5001: 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 4984 "configure"
+#line 5006 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -5001,7 +5023,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:5005: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -5022,12 +5044,12 @@ EOF
fi
echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:5026: checking whether getenv must be declared" >&5
+echo "configure:5048: 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 5031 "configure"
+#line 5053 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -5048,7 +5070,7 @@ int main() {
char *(*pfn) = (char *(*)) getenv
; return 0; }
EOF
-if { (eval echo configure:5052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_getenv=no
else
@@ -5235,16 +5257,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:5239: checking for c_impl in struct core_dumpx" >&5
+echo "configure:5261: checking for c_impl in struct core_dumpx" >&5
cat > conftest.$ac_ext <<EOF
-#line 5241 "configure"
+#line 5263 "configure"
#include "confdefs.h"
#include <core.h>
int main() {
struct core_dumpx c; c.c_impl = 0;
; return 0; }
EOF
-if { (eval echo configure:5248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_ST_C_IMPL 1
@@ -5312,17 +5334,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:5316: checking for $ac_hdr" >&5
+echo "configure:5338: 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 5321 "configure"
+#line 5343 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5326: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5348: \"$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*
@@ -5350,12 +5372,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:5354: checking for prstatus_t in sys/procfs.h" >&5
+echo "configure:5376: 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 5359 "configure"
+#line 5381 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5364,7 +5386,7 @@ int main() {
prstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prstatus_t=yes
else
@@ -5386,12 +5408,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:5390: checking for prstatus32_t in sys/procfs.h" >&5
+echo "configure:5412: 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 5395 "configure"
+#line 5417 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5400,7 +5422,7 @@ int main() {
prstatus32_t avar
; return 0; }
EOF
-if { (eval echo configure:5404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prstatus32_t=yes
else
@@ -5422,12 +5444,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:5426: checking for prstatus_t.pr_who in sys/procfs.h" >&5
+echo "configure:5448: 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 5431 "configure"
+#line 5453 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5436,7 +5458,7 @@ int main() {
prstatus_t avar; void* aref = (void*) &avar.pr_who
; return 0; }
EOF
-if { (eval echo configure:5440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5462: \"$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
@@ -5458,12 +5480,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:5462: checking for prstatus32_t.pr_who in sys/procfs.h" >&5
+echo "configure:5484: 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 5467 "configure"
+#line 5489 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5472,7 +5494,7 @@ int main() {
prstatus32_t avar; void* aref = (void*) &avar.pr_who
; return 0; }
EOF
-if { (eval echo configure:5476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5498: \"$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
@@ -5494,12 +5516,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:5498: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:5520: 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 5503 "configure"
+#line 5525 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5508,7 +5530,7 @@ int main() {
pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus_t=yes
else
@@ -5530,12 +5552,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:5534: checking for pxstatus_t in sys/procfs.h" >&5
+echo "configure:5556: 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 5539 "configure"
+#line 5561 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5544,7 +5566,7 @@ int main() {
pxstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pxstatus_t=yes
else
@@ -5566,12 +5588,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:5570: checking for pstatus32_t in sys/procfs.h" >&5
+echo "configure:5592: 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 5575 "configure"
+#line 5597 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5580,7 +5602,7 @@ int main() {
pstatus32_t avar
; return 0; }
EOF
-if { (eval echo configure:5584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus32_t=yes
else
@@ -5602,12 +5624,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:5606: checking for prpsinfo_t in sys/procfs.h" >&5
+echo "configure:5628: 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 5611 "configure"
+#line 5633 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5616,7 +5638,7 @@ int main() {
prpsinfo_t avar
; return 0; }
EOF
-if { (eval echo configure:5620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prpsinfo_t=yes
else
@@ -5638,12 +5660,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:5642: checking for prpsinfo32_t in sys/procfs.h" >&5
+echo "configure:5664: 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 5647 "configure"
+#line 5669 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5652,7 +5674,7 @@ int main() {
prpsinfo32_t avar
; return 0; }
EOF
-if { (eval echo configure:5656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes
else
@@ -5674,12 +5696,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:5678: checking for psinfo_t in sys/procfs.h" >&5
+echo "configure:5700: 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 5683 "configure"
+#line 5705 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5688,7 +5710,7 @@ int main() {
psinfo_t avar
; return 0; }
EOF
-if { (eval echo configure:5692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psinfo_t=yes
else
@@ -5710,12 +5732,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:5714: checking for psinfo32_t in sys/procfs.h" >&5
+echo "configure:5736: 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 5719 "configure"
+#line 5741 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5724,7 +5746,7 @@ int main() {
psinfo32_t avar
; return 0; }
EOF
-if { (eval echo configure:5728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psinfo32_t=yes
else
@@ -5746,12 +5768,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:5750: checking for lwpstatus_t in sys/procfs.h" >&5
+echo "configure:5772: 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 5755 "configure"
+#line 5777 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5760,7 +5782,7 @@ int main() {
lwpstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpstatus_t=yes
else
@@ -5782,12 +5804,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:5786: checking for lwpxstatus_t in sys/procfs.h" >&5
+echo "configure:5808: 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 5791 "configure"
+#line 5813 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5796,7 +5818,7 @@ int main() {
lwpxstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes
else
@@ -5818,12 +5840,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:5822: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
+echo "configure:5844: 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 5827 "configure"
+#line 5849 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5832,7 +5854,7 @@ int main() {
lwpstatus_t avar; void* aref = (void*) &avar.pr_context
; return 0; }
EOF
-if { (eval echo configure:5836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5858: \"$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
@@ -5854,12 +5876,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:5858: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
+echo "configure:5880: 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 5863 "configure"
+#line 5885 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5868,7 +5890,7 @@ int main() {
lwpstatus_t avar; void* aref = (void*) &avar.pr_reg
; return 0; }
EOF
-if { (eval echo configure:5872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5894: \"$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
@@ -5890,12 +5912,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:5894: checking for win32_pstatus_t in sys/procfs.h" >&5
+echo "configure:5916: 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 5899 "configure"
+#line 5921 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5904,7 +5926,7 @@ int main() {
win32_pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5930: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes
else
@@ -6113,8 +6135,8 @@ do
bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
- bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;;
- bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;;
+ bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
+ bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
@@ -6374,10 +6396,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:6378: checking for gcc version with buggy 64-bit support" >&5
+echo "configure:6400: 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 6381 "configure"
+#line 6403 "configure"
#include "confdefs.h"
:__GNUC__:__GNUC_MINOR__:__i386__:
EOF
@@ -6423,17 +6445,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6427: checking for $ac_hdr" >&5
+echo "configure:6449: 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 6432 "configure"
+#line 6454 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6437: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6459: \"$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*
@@ -6462,12 +6484,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6466: checking for $ac_func" >&5
+echo "configure:6488: 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 6471 "configure"
+#line 6493 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6490,7 +6512,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6516: \"$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
@@ -6515,7 +6537,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6519: checking for working mmap" >&5
+echo "configure:6541: 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
@@ -6523,7 +6545,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 6527 "configure"
+#line 6549 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6663,7 +6685,7 @@ main()
}
EOF
-if { (eval echo configure:6667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6689: \"$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
@@ -6688,12 +6710,12 @@ fi
for ac_func in madvise mprotect
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6692: checking for $ac_func" >&5
+echo "configure:6714: 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 6697 "configure"
+#line 6719 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6716,7 +6738,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6742: \"$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
@@ -6896,7 +6918,6 @@ s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
-s%@CC@%$CC%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
@@ -6912,6 +6933,7 @@ s%@bfd_version@%$bfd_version%g
s%@bfd_version_string@%$bfd_version_string%g
s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
+s%@CC@%$CC%g
s%@LN_S@%$LN_S%g
s%@OBJEXT@%$OBJEXT%g
s%@EXEEXT@%$EXEEXT%g
diff --git a/bfd/configure.in b/bfd/configure.in
index 347ad97c1e4..a2b56d2f341 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -7,7 +7,7 @@ AC_INIT(libbfd.c)
AC_CANONICAL_SYSTEM
AC_ISC_POSIX
-AM_INIT_AUTOMAKE(bfd, 2.13.90)
+AM_INIT_AUTOMAKE(bfd, 2.14.90)
# Uncomment the next line to remove the date from the reported bfd version
#is_release=y
@@ -597,8 +597,8 @@ do
bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
- bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;;
- bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;;
+ bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
+ bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c
index 66c3a466523..9ef527cb943 100644
--- a/bfd/cpu-arm.c
+++ b/bfd/cpu-arm.c
@@ -260,7 +260,7 @@ arm_check_note (abfd, buffer, buffer_size, expected_name, description_return)
}
else
{
- if (namesz != (strlen (expected_name) + 1 + 3) & ~3)
+ if (namesz != ((strlen (expected_name) + 1 + 3) & ~3))
return FALSE;
if (strcmp (descr, expected_name) != 0)
diff --git a/bfd/cpu-h8300.c b/bfd/cpu-h8300.c
index daef763a29b..2a5c604df64 100644
--- a/bfd/cpu-h8300.c
+++ b/bfd/cpu-h8300.c
@@ -69,16 +69,22 @@ h8300_scan (info, string)
if (*string == 'h' || *string == 'H')
{
+ string++;
+ if (*string == 'n' || *string == 'N')
+ return (info->mach == bfd_mach_h8300hn);
+
return (info->mach == bfd_mach_h8300h);
}
else if (*string == 's' || *string == 'S')
{
+ string++;
+ if (*string == 'n' || *string == 'N')
+ return (info->mach == bfd_mach_h8300sn);
+
return (info->mach == bfd_mach_h8300s);
}
else
- {
- return info->mach == bfd_mach_h8300;
- }
+ return info->mach == bfd_mach_h8300;
}
/* This routine is provided two arch_infos and works out the machine
@@ -97,33 +103,66 @@ compatible (in, out)
return in;
}
+static const bfd_arch_info_type h8300sn_info_struct =
+{
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
+ bfd_arch_h8300,
+ bfd_mach_h8300sn,
+ "h8300sn", /* Architecture name. */
+ "h8300sn", /* Printable name. */
+ 1,
+ FALSE, /* The default machine. */
+ compatible,
+ h8300_scan,
+ 0
+};
+
+
+static const bfd_arch_info_type h8300hn_info_struct =
+{
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
+ bfd_arch_h8300,
+ bfd_mach_h8300hn,
+ "h8300hn", /* Architecture name. */
+ "h8300hn", /* Printable name. */
+ 1,
+ FALSE, /* The default machine. */
+ compatible,
+ h8300_scan,
+ &h8300sn_info_struct
+};
+
static const bfd_arch_info_type h8300s_info_struct =
{
- 32, /* 32 bits in a word */
- 32, /* 32 bits in an address */
- 8, /* 8 bits in a byte */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
bfd_arch_h8300,
bfd_mach_h8300s,
- "h8300s", /* arch_name */
- "h8300s", /* printable name */
+ "h8300s", /* Architecture name. */
+ "h8300s", /* Printable name. */
1,
- FALSE, /* the default machine */
+ FALSE, /* The default machine. */
compatible,
h8300_scan,
- 0
+ & h8300hn_info_struct
};
static const bfd_arch_info_type h8300h_info_struct =
{
- 32, /* 32 bits in a word */
- 32, /* 32 bits in an address */
- 8, /* 8 bits in a byte */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
bfd_arch_h8300,
bfd_mach_h8300h,
- "h8300h", /* arch_name */
- "h8300h", /* printable name */
+ "h8300h", /* Architecture name. */
+ "h8300h", /* Printable name. */
1,
- FALSE, /* the default machine */
+ FALSE, /* The default machine. */
compatible,
h8300_scan,
&h8300s_info_struct
@@ -131,15 +170,15 @@ static const bfd_arch_info_type h8300h_info_struct =
const bfd_arch_info_type bfd_h8300_arch =
{
- 16, /* 16 bits in a word */
- 16, /* 16 bits in an address */
- 8, /* 8 bits in a byte */
+ 16, /* 16 bits in a word. */
+ 16, /* 16 bits in an address. */
+ 8, /* 8 bits in a byte. */
bfd_arch_h8300,
bfd_mach_h8300,
- "h8300", /* arch_name */
- "h8300", /* printable name */
+ "h8300", /* Architecture name. */
+ "h8300", /* Printable name. */
1,
- TRUE, /* the default machine */
+ TRUE, /* The default machine. */
compatible,
h8300_scan,
&h8300h_info_struct
diff --git a/bfd/cpu-sh.c b/bfd/cpu-sh.c
index fc4bf4263c2..e247cb8aaec 100644
--- a/bfd/cpu-sh.c
+++ b/bfd/cpu-sh.c
@@ -1,4 +1,4 @@
-/* BFD library support routines for the Renesas SH architecture.
+/* BFD library support routines for the Renesas / SuperH SH architecture.
Copyright 1993, 1994, 1997, 1998, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 2e5587cf798..073aee8a179 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -204,6 +204,10 @@ struct elf_link_hash_entry
/* Symbol is referenced by a non-GOT/non-PLT relocation. This is
not currently set by all the backends. */
#define ELF_LINK_NON_GOT_REF 010000
+ /* Symbol has a definition in a shared object. */
+#define ELF_LINK_DYNAMIC_DEF 020000
+ /* Symbol is weak in all shared objects. */
+#define ELF_LINK_DYNAMIC_WEAK 040000
};
/* Records local symbols to be emitted in the dynamic symbol table. */
@@ -424,7 +428,7 @@ struct elf_size_info {
handle all back-ends. */
#define MAX_INT_RELS_PER_EXT_REL 3
- unsigned char arch_size, file_align;
+ unsigned char arch_size, log_file_align;
unsigned char elfclass, ev_current;
int (*write_out_phdrs)
PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int));
@@ -1048,6 +1052,46 @@ typedef struct elf_linker_section_pointers
bfd_boolean written_address_p; /* whether address was written yet */
} elf_linker_section_pointers_t;
+/* This struct is used to pass information to routines called via
+ elf_link_hash_traverse which must return failure. */
+
+struct elf_info_failed
+{
+ bfd_boolean failed;
+ struct bfd_link_info *info;
+ struct bfd_elf_version_tree *verdefs;
+};
+
+/* This structure is used to pass information to
+ _bfd_elf_link_assign_sym_version. */
+
+struct elf_assign_sym_version_info
+{
+ /* Output BFD. */
+ bfd *output_bfd;
+ /* General link information. */
+ struct bfd_link_info *info;
+ /* Version tree. */
+ struct bfd_elf_version_tree *verdefs;
+ /* Whether we had a failure. */
+ bfd_boolean failed;
+};
+
+/* This structure is used to pass information to
+ _bfd_elf_link_find_version_dependencies. */
+
+struct elf_find_verdep_info
+{
+ /* Output BFD. */
+ bfd *output_bfd;
+ /* General link information. */
+ struct bfd_link_info *info;
+ /* The number of dependencies. */
+ unsigned int vers;
+ /* Whether we had a failure. */
+ bfd_boolean failed;
+};
+
/* Some private data is stashed away for future use using the tdata pointer
in the bfd structure. */
@@ -1391,8 +1435,6 @@ extern asection *bfd_section_from_r_symndx
PARAMS ((bfd *, struct sym_sec_cache *, asection *, unsigned long));
extern asection *bfd_section_from_elf_index
PARAMS ((bfd *, unsigned int));
-extern bfd_boolean _bfd_elf_create_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
extern struct bfd_strtab_hash *_bfd_elf_stringtab_init
PARAMS ((void));
@@ -1431,6 +1473,26 @@ extern bfd_boolean _bfd_elf_write_section_eh_frame_hdr
extern bfd_boolean _bfd_elf_maybe_strip_eh_frame_hdr
PARAMS ((struct bfd_link_info *));
+extern bfd_boolean _bfd_elf_merge_symbol
+ PARAMS ((bfd *, struct bfd_link_info *, const char *,
+ Elf_Internal_Sym *, asection **, bfd_vma *,
+ struct elf_link_hash_entry **, bfd_boolean *, bfd_boolean *,
+ bfd_boolean *, bfd_boolean *, bfd_boolean));
+
+extern bfd_boolean _bfd_elf_add_default_symbol
+ PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
+ const char *, Elf_Internal_Sym *, asection **, bfd_vma *,
+ bfd_boolean *, bfd_boolean, bfd_boolean));
+
+extern bfd_boolean _bfd_elf_export_symbol
+ PARAMS ((struct elf_link_hash_entry *, PTR));
+
+extern bfd_boolean _bfd_elf_link_find_version_dependencies
+ PARAMS ((struct elf_link_hash_entry *, PTR));
+
+extern bfd_boolean _bfd_elf_link_assign_sym_version
+ PARAMS ((struct elf_link_hash_entry *, PTR));
+
extern bfd_boolean _bfd_elf_link_record_dynamic_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
extern long _bfd_elf_link_lookup_local_dynindx
@@ -1445,6 +1507,8 @@ extern file_ptr _bfd_elf_assign_file_position_for_section
extern bfd_boolean _bfd_elf_validate_reloc
PARAMS ((bfd *, arelent *));
+extern bfd_boolean _bfd_elf_link_create_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
extern bfd_boolean _bfd_elf_create_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
extern bfd_boolean _bfd_elf_create_got_section
@@ -1486,6 +1550,24 @@ extern bfd_vma bfd_elf64_finish_pointer_linker_section
extern bfd_boolean _bfd_elf_make_linker_section_rela
PARAMS ((bfd *, elf_linker_section_t *, int));
+extern Elf_Internal_Rela *_bfd_elf_link_read_relocs
+ PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean));
+
+extern bfd_boolean _bfd_elf_link_size_reloc_section
+ PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
+
+extern bfd_boolean _bfd_elf_link_output_relocs
+ PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *));
+
+extern bfd_boolean _bfd_elf_fix_symbol_flags
+ PARAMS ((struct elf_link_hash_entry *, struct elf_info_failed *));
+
+extern bfd_boolean _bfd_elf_adjust_dynamic_symbol
+ PARAMS ((struct elf_link_hash_entry *, PTR));
+
+extern bfd_boolean _bfd_elf_link_sec_merge_syms
+ PARAMS ((struct elf_link_hash_entry *, PTR));
+
extern const bfd_target *bfd_elf32_object_p
PARAMS ((bfd *));
extern const bfd_target *bfd_elf32_core_file_p
@@ -1534,10 +1616,6 @@ extern bfd_boolean bfd_elf32_slurp_reloc_table
PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
extern bfd_boolean bfd_elf32_add_dynamic_entry
PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma));
-extern bfd_boolean bfd_elf32_link_create_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-extern Elf_Internal_Rela *_bfd_elf32_link_read_relocs
- PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean));
extern const bfd_target *bfd_elf64_object_p
PARAMS ((bfd *));
@@ -1586,10 +1664,6 @@ extern bfd_boolean bfd_elf64_slurp_reloc_table
PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
extern bfd_boolean bfd_elf64_add_dynamic_entry
PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma));
-extern bfd_boolean bfd_elf64_link_create_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-extern Elf_Internal_Rela *_bfd_elf64_link_read_relocs
- PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean));
#define bfd_elf32_link_record_dynamic_symbol \
_bfd_elf_link_record_dynamic_symbol
diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c
index f5f27894c03..c35adcba81c 100644
--- a/bfd/elf-m10200.c
+++ b/bfd/elf-m10200.c
@@ -1,5 +1,5 @@
/* Matsushita 10200 specific support for 32-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -529,7 +529,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -1342,7 +1342,7 @@ mn10200_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
asection **secpp;
bfd_size_type amt;
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(input_bfd, input_section, (PTR) NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index 2f0cd905700..cad2b9c7b8c 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -1,5 +1,5 @@
/* Matsushita 10300 specific support for 32-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -859,7 +859,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
{
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(input_bfd, section, (PTR) NULL,
(Elf_Internal_Rela *) NULL,
link_info->keep_memory));
@@ -1125,7 +1125,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
if (section->reloc_count != 0)
{
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(input_bfd, section, (PTR) NULL,
(Elf_Internal_Rela *) NULL,
link_info->keep_memory));
@@ -1351,7 +1351,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -2577,7 +2577,7 @@ mn10300_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
Elf_Internal_Sym *isym, *isymend;
bfd_size_type amt;
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(input_bfd, input_section, (PTR) NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
diff --git a/bfd/elf.c b/bfd/elf.c
index 56dfda3321e..737f4954711 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2292,6 +2292,10 @@ bfd_section_from_phdr (abfd, hdr, index)
case PT_PHDR:
return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "phdr");
+ case PT_GNU_EH_FRAME:
+ return _bfd_elf_make_section_from_phdr (abfd, hdr, index,
+ "eh_frame_hdr");
+
default:
/* Check for any processor-specific program segment types.
If no handler for them, default to making "segment" sections. */
@@ -2331,7 +2335,7 @@ _bfd_elf_init_reloc_shdr (abfd, rel_hdr, asect, use_rela_p)
rel_hdr->sh_entsize = (use_rela_p
? bed->s->sizeof_rela
: bed->s->sizeof_rel);
- rel_hdr->sh_addralign = bed->s->file_align;
+ rel_hdr->sh_addralign = 1 << bed->s->log_file_align;
rel_hdr->sh_flags = 0;
rel_hdr->sh_addr = 0;
rel_hdr->sh_size = 0;
@@ -2361,9 +2365,9 @@ elf_fake_sections (abfd, asect, failedptrarg)
this_hdr = &elf_section_data (asect)->this_hdr;
- this_hdr->sh_name = (unsigned long) _bfd_elf_strtab_add (elf_shstrtab (abfd),
- asect->name, FALSE);
- if (this_hdr->sh_name == (unsigned long) -1)
+ this_hdr->sh_name = (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd),
+ asect->name, FALSE);
+ if (this_hdr->sh_name == (unsigned int) -1)
{
*failedptr = TRUE;
return;
@@ -3744,7 +3748,7 @@ assign_file_positions_for_segments (abfd)
&& (abfd->flags & D_PAGED) != 0)
p->p_align = bed->maxpagesize;
else if (m->count == 0)
- p->p_align = bed->s->file_align;
+ p->p_align = 1 << bed->s->log_file_align;
else
p->p_align = 0;
@@ -4241,7 +4245,7 @@ assign_file_positions_except_relocs (abfd)
}
/* Place the section headers. */
- off = align_file_position (off, bed->s->file_align);
+ off = align_file_position (off, 1 << bed->s->log_file_align);
i_ehdrp->e_shoff = off;
off += i_ehdrp->e_shnum * i_ehdrp->e_shentsize;
@@ -4778,7 +4782,7 @@ copy_private_bfd_data (ibfd, obfd)
section = section->next)
if (INCLUDE_SECTION_IN_SEGMENT (section, segment, bed))
++section_count;
-
+
/* Allocate a segment map big enough to contain
all of the sections we have selected. */
amt = sizeof (struct elf_segment_map);
@@ -5298,7 +5302,7 @@ swap_out_syms (abfd, sttp, relocatable_p)
symtab_hdr->sh_entsize = bed->s->sizeof_sym;
symtab_hdr->sh_size = symtab_hdr->sh_entsize * (symcount + 1);
symtab_hdr->sh_info = elf_num_locals (abfd) + 1;
- symtab_hdr->sh_addralign = bed->s->file_align;
+ symtab_hdr->sh_addralign = 1 << bed->s->log_file_align;
symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr;
symstrtab_hdr->sh_type = SHT_STRTAB;
@@ -5458,11 +5462,11 @@ swap_out_syms (abfd, sttp, relocatable_p)
Unable to find equivalent output section for symbol '%s' from section '%s'"),
syms[idx]->name ? syms[idx]->name : "<Local sym>",
sec->name);
- bfd_set_error (bfd_error_invalid_operation);
+ bfd_set_error (bfd_error_invalid_operation);
_bfd_stringtab_free (stt);
return FALSE;
}
-
+
shndx = _bfd_elf_section_from_bfd_section (abfd, sec2);
BFD_ASSERT (shndx != -1);
}
@@ -7071,7 +7075,7 @@ elfcore_grok_nto_note (abfd, note)
Elf_Internal_Note *note;
{
/* Every GREG section has a STATUS section before it. Store the
- tid from the previous call to pass down to the next gregs
+ tid from the previous call to pass down to the next gregs
function. */
static pid_t tid = 1;
@@ -7121,7 +7125,7 @@ elfcore_write_note (abfd, buf, bufsiz, name, type, input, size)
namesz = strlen (name) + 1;
bed = get_elf_backend_data (abfd);
- pad = -namesz & (bed->s->file_align - 1);
+ pad = -namesz & ((1 << bed->s->log_file_align) - 1);
}
newspace = sizeof (Elf_External_Note) - 1 + namesz + pad + size;
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index 631b2b9e530..ba286b1237d 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -679,8 +679,8 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge)
/* Load the relocs. */
internal_relocs
- = _bfd_elf32_link_read_relocs (abfd, sec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL, FALSE);
+ = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL, FALSE);
if (internal_relocs == NULL)
goto error_return;
diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c
index c79688a3959..30db68f2119 100644
--- a/bfd/elf32-h8300.c
+++ b/bfd/elf32-h8300.c
@@ -573,6 +573,12 @@ elf32_h8_mach (flags)
case E_H8_MACH_H8300S:
return bfd_mach_h8300s;
+
+ case E_H8_MACH_H8300HN:
+ return bfd_mach_h8300hn;
+
+ case E_H8_MACH_H8300SN:
+ return bfd_mach_h8300sn;
}
}
@@ -601,6 +607,14 @@ elf32_h8_final_write_processing (abfd, linker)
case bfd_mach_h8300s:
val = E_H8_MACH_H8300S;
break;
+
+ case bfd_mach_h8300hn:
+ val = E_H8_MACH_H8300HN;
+ break;
+
+ case bfd_mach_h8300sn:
+ val = E_H8_MACH_H8300SN;
+ break;
}
elf_elfheader (abfd)->e_flags &= ~ (EF_H8_MACH);
@@ -695,7 +709,7 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -764,9 +778,12 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
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);
+ symval = isym->st_value;
+ /* If the reloc is absolute, it will not have
+ a symbol or section associated with it. */
+ if (sym_sec)
+ symval += sym_sec->output_section->vma
+ + sym_sec->output_offset;
}
else
{
@@ -1068,6 +1085,7 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
&& value >= 0xffff00
&& value <= 0xffffff))
{
+ bfd_boolean skip = FALSE;
unsigned char code;
/* Note that we've changed the relocs, section contents,
@@ -1085,16 +1103,27 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
- if ((code & 0xf0) == 0x00)
- bfd_put_8 (abfd,
- (code & 0xf) | 0x20,
- contents + irel->r_offset - 2);
- else if ((code & 0xf0) == 0x80)
- bfd_put_8 (abfd,
- (code & 0xf) | 0x30,
- contents + irel->r_offset - 2);
- else
- abort ();
+ switch (code & 0xf0)
+ {
+ case 0x00:
+ bfd_put_8 (abfd, (code & 0xf) | 0x20,
+ contents + irel->r_offset - 2);
+ break;
+ case 0x80:
+ bfd_put_8 (abfd, (code & 0xf) | 0x30,
+ contents + irel->r_offset - 2);
+ break;
+ case 0x20:
+ case 0xa0:
+ /* Skip 32bit versions. */
+ skip = TRUE;
+ break;
+ default:
+ abort ();
+ }
+
+ if (skip)
+ break;
/* Fix the relocation's type. */
irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
@@ -1365,7 +1394,7 @@ elf32_h8_get_relocated_section_contents (output_bfd, link_info, link_order,
Elf_Internal_Sym *isym, *isymend;
bfd_size_type amt;
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(input_bfd, input_section, (PTR) NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index b204c57df46..becfb73c873 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -2950,9 +2950,9 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size,
/* Get the relocs. */
internal_relocs
- = _bfd_elf32_link_read_relocs (input_bfd, section, NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ = _bfd_elf_link_read_relocs (input_bfd, section, NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (internal_relocs == NULL)
goto error_ret_free_local;
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index eae3190c420..320e9859839 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -26,8 +26,6 @@
static reloc_howto_type *elf_i386_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
-static void elf_i386_info_to_howto
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void elf_i386_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static bfd_boolean elf_i386_is_local_label_name
@@ -373,15 +371,6 @@ elf_i386_reloc_type_lookup (abfd, code)
}
static void
-elf_i386_info_to_howto (abfd, cache_ptr, dst)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *cache_ptr ATTRIBUTE_UNUSED;
- Elf_Internal_Rela *dst ATTRIBUTE_UNUSED;
-{
- abort ();
-}
-
-static void
elf_i386_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr;
@@ -849,7 +838,19 @@ elf_i386_copy_indirect_symbol (bed, dir, ind)
edir->tls_type = eind->tls_type;
eind->tls_type = GOT_UNKNOWN;
}
- _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
+
+ if (ELIMINATE_COPY_RELOCS
+ && ind->root.type != bfd_link_hash_indirect
+ && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+ /* If called to transfer flags for a weakdef during processing
+ of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
+ We clear it ourselves for ELIMINATE_COPY_RELOCS. */
+ dir->elf_link_hash_flags |=
+ (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
+ | ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK));
+ else
+ _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
}
static int
@@ -1557,7 +1558,9 @@ allocate_dynrelocs (h, inf)
htab = elf_i386_hash_table (info);
if (htab->elf.dynamic_sections_created
- && h->plt.refcount > 0)
+ && h->plt.refcount > 0
+ && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
{
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
@@ -1655,8 +1658,10 @@ allocate_dynrelocs (h, inf)
htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
else if (tls_type == GOT_TLS_GD)
htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rel);
- else if (info->shared
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
+ else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
+ && (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
}
else
@@ -1690,6 +1695,12 @@ allocate_dynrelocs (h, inf)
pp = &p->next;
}
}
+
+ /* Also discard relocs on undefined weak syms with non-default
+ visibility. */
+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ && h->root.type == bfd_link_hash_undefweak)
+ eh->dyn_relocs = NULL;
}
else if (ELIMINATE_COPY_RELOCS)
{
@@ -2297,7 +2308,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
&& (info->symbolic
|| h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+ || (ELF_ST_VISIBILITY (h->other)
+ && h->root.type == bfd_link_hash_undefweak))
{
/* This is actually a static link, or it is a
-Bsymbolic link and the symbol is defined
@@ -2421,6 +2434,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
break;
if ((info->shared
+ && (h == NULL
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
&& (r_type != R_386_PC32
|| (h != NULL
&& h->dynindx != -1
@@ -3367,7 +3383,8 @@ elf_i386_finish_dynamic_sections (output_bfd, info)
#define elf_backend_got_header_size 12
#define elf_backend_plt_header_size PLT_ENTRY_SIZE
-#define elf_info_to_howto elf_i386_info_to_howto
+/* Support RELA for objdump of prelink objects. */
+#define elf_info_to_howto elf_i386_info_to_howto_rel
#define elf_info_to_howto_rel elf_i386_info_to_howto_rel
#define bfd_elf32_mkobject elf_i386_mkobject
diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c
index cd2b970daad..e10e9410ac6 100644
--- a/bfd/elf32-ip2k.c
+++ b/bfd/elf32-ip2k.c
@@ -847,9 +847,9 @@ ip2k_elf_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
- internal_relocs = _bfd_elf32_link_read_relocs (abfd, sec, NULL,
- (Elf_Internal_Rela *)NULL,
- link_info->keep_memory);
+ internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL,
+ (Elf_Internal_Rela *)NULL,
+ link_info->keep_memory);
if (internal_relocs == NULL)
goto error_return;
@@ -861,9 +861,9 @@ ip2k_elf_relax_section (abfd, sec, link_info, again)
/* So stab does exits. */
Elf_Internal_Rela * irelbase;
- irelbase = _bfd_elf32_link_read_relocs (abfd, stab, NULL,
- (Elf_Internal_Rela *)NULL,
- link_info->keep_memory);
+ irelbase = _bfd_elf_link_read_relocs (abfd, stab, NULL,
+ (Elf_Internal_Rela *)NULL,
+ link_info->keep_memory);
}
/* Get section contents cached copy if it exists. */
diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c
index c4261bf7492..ebdd30300ff 100644
--- a/bfd/elf32-iq2000.c
+++ b/bfd/elf32-iq2000.c
@@ -454,8 +454,9 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
- Elf_Internal_Rela *rel;
- Elf_Internal_Rela *rel_end;
+ const Elf_Internal_Rela *rel;
+ const Elf_Internal_Rela *rel_end;
+ bfd_boolean changed = FALSE;
if (info->relocateable)
return TRUE;
@@ -499,10 +500,20 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs)
if (memcmp (sec->name, ".debug", 6) == 0
|| memcmp (sec->name, ".stab", 5) == 0
|| memcmp (sec->name, ".eh_frame", 9) == 0)
- rel->r_info = ELF32_R_INFO (ELF32_R_SYM (rel->r_info), R_IQ2000_32_DEBUG);
+ {
+ ((Elf_Internal_Rela *) rel)->r_info
+ = ELF32_R_INFO (ELF32_R_SYM (rel->r_info), R_IQ2000_32_DEBUG);
+ changed = TRUE;
+ }
break;
}
}
+
+ if (changed)
+ /* Note that we've changed relocs, otherwise if !info->keep_memory
+ we'll free the relocs and lose our changes. */
+ (const Elf_Internal_Rela *) (elf_section_data (sec)->relocs) = relocs;
+
return TRUE;
}
@@ -929,6 +940,7 @@ iq2000_elf_print_private_bfd_data (abfd, ptr)
}
fputc ('\n', file);
+ return TRUE;
}
static
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index b53f50a89af..3116ace867a 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -1,5 +1,5 @@
/* M32R-specific support for 32-bit ELF.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -1340,7 +1340,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again)
{
Elf_Internal_Shdr *symtab_hdr;
/* The Rela structures are used here because that's what
- _bfd_elf32_link_read_relocs uses [for convenience - it sets the addend
+ _bfd_elf_link_read_relocs uses [for convenience - it sets the addend
field to 0]. */
Elf_Internal_Rela *internal_relocs = NULL;
Elf_Internal_Rela *irel, *irelend;
@@ -1368,7 +1368,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -1781,7 +1781,7 @@ m32r_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
asection **secpp;
Elf32_External_Sym *esym, *esymend;
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(input_bfd, input_section, (PTR) NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c
index 26fa3933a74..1b95105299d 100644
--- a/bfd/elf32-m68hc11.c
+++ b/bfd/elf32-m68hc11.c
@@ -24,29 +24,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfdlink.h"
#include "libbfd.h"
#include "elf-bfd.h"
+#include "elf32-m68hc1x.h"
#include "elf/m68hc11.h"
+#include "opcode/m68hc11.h"
+/* Relocation functions. */
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
static void m68hc11_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
-static bfd_reloc_status_type m68hc11_elf_ignore_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-/* GC mark and sweep. */
-static asection *elf32_m68hc11_gc_mark_hook
- PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *));
-static bfd_boolean elf32_m68hc11_gc_sweep_hook
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
-static bfd_boolean elf32_m68hc11_check_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
-static bfd_boolean elf32_m68hc11_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
+/* Trampoline generation. */
+static bfd_boolean m68hc11_elf_size_one_stub
+ PARAMS((struct bfd_hash_entry *gen_entry, PTR in_arg));
+static bfd_boolean m68hc11_elf_build_one_stub
+ PARAMS((struct bfd_hash_entry *gen_entry, PTR in_arg));
+static struct bfd_link_hash_table* m68hc11_elf_bfd_link_hash_table_create
+ PARAMS ((bfd* abfd));
+
+/* Linker relaxation. */
static bfd_boolean m68hc11_elf_relax_section
PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *));
static void m68hc11_elf_relax_delete_bytes
@@ -56,18 +52,14 @@ static void m68hc11_relax_group
unsigned long, unsigned long));
static int compare_reloc PARAMS ((const void *, const void *));
-
-bfd_boolean _bfd_m68hc11_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *));
-bfd_boolean _bfd_m68hc11_elf_set_private_flags PARAMS ((bfd *, flagword));
-bfd_boolean _bfd_m68hc11_elf_print_private_bfd_data PARAMS ((bfd *, PTR));
-
/* Use REL instead of RELA to save space */
#define USE_REL 1
-/* The Motorola 68HC11 microcontroler only addresses 64Kb.
+/* The Motorola 68HC11 microcontroller only addresses 64Kb but we also
+ support a memory bank switching mechanism similar to 68HC12.
We must handle 8 and 16-bit relocations. The 32-bit relocation
- is defined but not used except by gas when -gstabs is used (which
- is wrong).
+ are used for debugging sections (DWARF2) to represent a virtual
+ address.
The 3-bit and 16-bit PC rel relocation is only used by 68HC12. */
static reloc_howto_type elf_m68hc11_howto_table[] = {
/* This reloc does nothing. */
@@ -367,25 +359,6 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
return NULL;
}
-/* This function is used for relocs which are only used for relaxing,
- which the linker should otherwise ignore. */
-
-static bfd_reloc_status_type
-m68hc11_elf_ignore_reloc (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- asymbol *symbol ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
-{
- if (output_bfd != NULL)
- reloc_entry->address += input_section->output_offset;
- return bfd_reloc_ok;
-}
-
/* Set the howto pointer for an M68HC11 ELF reloc. */
static void
@@ -401,50 +374,106 @@ m68hc11_info_to_howto_rel (abfd, cache_ptr, dst)
cache_ptr->howto = &elf_m68hc11_howto_table[r_type];
}
-static asection *
-elf32_m68hc11_gc_mark_hook (sec, info, rel, h, sym)
- asection *sec;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- Elf_Internal_Rela *rel;
- struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
-{
- if (h != NULL)
- {
- switch (ELF32_R_TYPE (rel->r_info))
- {
- default:
- switch (h->root.type)
- {
- case bfd_link_hash_defined:
- case bfd_link_hash_defweak:
- return h->root.u.def.section;
-
- case bfd_link_hash_common:
- return h->root.u.c.p->section;
+
+/* Far trampoline generation. */
- default:
- break;
- }
- }
- }
- else
- return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
+/* Build a 68HC11 trampoline stub. */
+static bfd_boolean
+m68hc11_elf_build_one_stub (gen_entry, in_arg)
+ struct bfd_hash_entry *gen_entry;
+ PTR in_arg;
+{
+ struct elf32_m68hc11_stub_hash_entry *stub_entry;
+ struct bfd_link_info *info;
+ struct m68hc11_elf_link_hash_table *htab;
+ asection *stub_sec;
+ bfd *stub_bfd;
+ bfd_byte *loc;
+ bfd_vma sym_value, phys_page, phys_addr;
+
+ /* Massage our args to the form they really have. */
+ stub_entry = (struct elf32_m68hc11_stub_hash_entry *) gen_entry;
+ info = (struct bfd_link_info *) in_arg;
+
+ htab = m68hc11_elf_hash_table (info);
+
+ stub_sec = stub_entry->stub_sec;
+
+ /* Make a note of the offset within the stubs for this entry. */
+ stub_entry->stub_offset = stub_sec->_raw_size;
+ stub_sec->_raw_size += 10;
+ loc = stub_sec->contents + stub_entry->stub_offset;
+
+ stub_bfd = stub_sec->owner;
+
+ /* Create the trampoline call stub:
+
+ pshb
+ ldab #%page(symbol)
+ ldy #%addr(symbol)
+ jmp __trampoline
+
+ */
+ sym_value = (stub_entry->target_value
+ + stub_entry->target_section->output_offset
+ + stub_entry->target_section->output_section->vma);
+ phys_addr = m68hc11_phys_addr (&htab->pinfo, sym_value);
+ phys_page = m68hc11_phys_page (&htab->pinfo, sym_value);
+
+ /* pshb; ldab #%page(sym) */
+ bfd_put_8 (stub_bfd, 0x37, loc);
+ bfd_put_8 (stub_bfd, 0xC6, loc + 1);
+ bfd_put_8 (stub_bfd, phys_page, loc + 2);
+ loc += 3;
+
+ /* ldy #%addr(sym) */
+ bfd_put_8 (stub_bfd, 0x18, loc);
+ bfd_put_8 (stub_bfd, 0xCE, loc + 1);
+ bfd_put_16 (stub_bfd, phys_addr, loc + 2);
+ loc += 4;
+
+ /* jmp __trampoline */
+ bfd_put_8 (stub_bfd, 0x7E, loc);
+ bfd_put_16 (stub_bfd, htab->pinfo.trampoline_addr, loc + 1);
- return NULL;
+ return TRUE;
}
+/* As above, but don't actually build the stub. Just bump offset so
+ we know stub section sizes. */
+
static bfd_boolean
-elf32_m68hc11_gc_sweep_hook (abfd, info, sec, relocs)
- bfd *abfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- asection *sec ATTRIBUTE_UNUSED;
- const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
+m68hc11_elf_size_one_stub (gen_entry, in_arg)
+ struct bfd_hash_entry *gen_entry;
+ PTR in_arg ATTRIBUTE_UNUSED;
{
- /* We don't use got and plt entries for 68hc11/68hc12. */
+ struct elf32_m68hc11_stub_hash_entry *stub_entry;
+
+ /* Massage our args to the form they really have. */
+ stub_entry = (struct elf32_m68hc11_stub_hash_entry *) gen_entry;
+
+ stub_entry->stub_sec->_raw_size += 10;
return TRUE;
}
+/* Create a 68HC11 ELF linker hash table. */
+
+static struct bfd_link_hash_table *
+m68hc11_elf_bfd_link_hash_table_create (abfd)
+ bfd *abfd;
+{
+ struct m68hc11_elf_link_hash_table *ret;
+
+ ret = m68hc11_elf_hash_table_create (abfd);
+ if (ret == (struct m68hc11_elf_link_hash_table *) NULL)
+ return NULL;
+
+ ret->size_one_stub = m68hc11_elf_size_one_stub;
+ ret->build_one_stub = m68hc11_elf_build_one_stub;
+
+ return &ret->root.root;
+}
+
/* 68HC11 Linker Relaxation. */
@@ -676,7 +705,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -1044,6 +1073,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
}
}
prev_insn_branch = 0;
+ prev_insn_group = 0;
}
if (free_relocs != NULL)
@@ -1251,365 +1281,7 @@ m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count)
}
}
-/* Look through the relocs for a section during the first phase.
- Since we don't do .gots or .plts, we just need to consider the
- virtual table relocs for gc. */
-
-static bfd_boolean
-elf32_m68hc11_check_relocs (abfd, info, sec, relocs)
- bfd * abfd;
- struct bfd_link_info * info;
- asection * sec;
- const Elf_Internal_Rela * relocs;
-{
- Elf_Internal_Shdr * symtab_hdr;
- struct elf_link_hash_entry ** sym_hashes;
- struct elf_link_hash_entry ** sym_hashes_end;
- const Elf_Internal_Rela * rel;
- const Elf_Internal_Rela * rel_end;
-
- if (info->relocateable)
- return TRUE;
-
- symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
- sym_hashes = elf_sym_hashes (abfd);
- sym_hashes_end = sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
- if (!elf_bad_symtab (abfd))
- sym_hashes_end -= symtab_hdr->sh_info;
-
- rel_end = relocs + sec->reloc_count;
-
- for (rel = relocs; rel < rel_end; rel++)
- {
- struct elf_link_hash_entry * h;
- unsigned long r_symndx;
-
- r_symndx = ELF32_R_SYM (rel->r_info);
-
- if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
- else
- h = sym_hashes [r_symndx - symtab_hdr->sh_info];
-
- switch (ELF32_R_TYPE (rel->r_info))
- {
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_M68HC11_GNU_VTINHERIT:
- if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_M68HC11_GNU_VTENTRY:
- if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
- }
- }
-
- return TRUE;
-}
-
-/* Relocate a 68hc11/68hc12 ELF section. */
-static bfd_boolean
-elf32_m68hc11_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, relocs, local_syms, local_sections)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- Elf_Internal_Rela *relocs;
- Elf_Internal_Sym *local_syms;
- asection **local_sections;
-{
- Elf_Internal_Shdr *symtab_hdr;
- struct elf_link_hash_entry **sym_hashes;
- Elf_Internal_Rela *rel, *relend;
- const char *name;
-
- symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
- sym_hashes = elf_sym_hashes (input_bfd);
-
- rel = relocs;
- relend = relocs + input_section->reloc_count;
- for (; rel < relend; rel++)
- {
- int r_type;
- reloc_howto_type *howto;
- unsigned long r_symndx;
- Elf_Internal_Sym *sym;
- asection *sec;
- struct elf_link_hash_entry *h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
-
- r_symndx = ELF32_R_SYM (rel->r_info);
- r_type = ELF32_R_TYPE (rel->r_info);
-
- if (r_type == R_M68HC11_GNU_VTENTRY
- || r_type == R_M68HC11_GNU_VTINHERIT )
- continue;
-
- howto = elf_m68hc11_howto_table + r_type;
-
- if (info->relocateable)
- {
- /* This is a relocateable link. We don't have to change
- anything, unless the reloc is against a section symbol,
- in which case we have to adjust according to where the
- section symbol winds up in the output section. */
- if (r_symndx < symtab_hdr->sh_info)
- {
- sym = local_syms + r_symndx;
- if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
- {
- sec = local_sections[r_symndx];
- rel->r_addend += sec->output_offset + sym->st_value;
- }
- }
-
- continue;
- }
-
- /* This is a final link. */
- h = NULL;
- sym = NULL;
- sec = NULL;
- if (r_symndx < symtab_hdr->sh_info)
- {
- sym = local_syms + r_symndx;
- sec = local_sections[r_symndx];
- relocation = (sec->output_section->vma
- + sec->output_offset
- + sym->st_value);
- }
- else
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- relocation = 0;
- else
- {
- if (!((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset, TRUE)))
- return FALSE;
- relocation = 0;
- }
- }
-
- if (h != NULL)
- name = h->root.root.string;
- else
- {
- name = (bfd_elf_string_from_elf_section
- (input_bfd, symtab_hdr->sh_link, sym->st_name));
- if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
- }
-
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, rel->r_addend);
-
- if (r != bfd_reloc_ok)
- {
- const char * msg = (const char *) 0;
-
- switch (r)
- {
- case bfd_reloc_overflow:
- if (!((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
- return FALSE;
- break;
-
- case bfd_reloc_undefined:
- if (!((*info->callbacks->undefined_symbol)
- (info, name, input_bfd, input_section,
- rel->r_offset, TRUE)))
- return FALSE;
- break;
-
- case bfd_reloc_outofrange:
- msg = _ ("internal error: out of range error");
- goto common_error;
-
- case bfd_reloc_notsupported:
- msg = _ ("internal error: unsupported relocation error");
- goto common_error;
-
- case bfd_reloc_dangerous:
- msg = _ ("internal error: dangerous error");
- goto common_error;
-
- default:
- msg = _ ("internal error: unknown error");
- /* fall through */
-
- common_error:
- if (!((*info->callbacks->warning)
- (info, msg, name, input_bfd, input_section,
- rel->r_offset)))
- return FALSE;
- break;
- }
- }
- }
-
- return TRUE;
-}
-
-
-/* Set and control ELF flags in ELF header. */
-
-bfd_boolean
-_bfd_m68hc11_elf_set_private_flags (abfd, flags)
- bfd *abfd;
- flagword flags;
-{
- BFD_ASSERT (!elf_flags_init (abfd)
- || elf_elfheader (abfd)->e_flags == flags);
-
- elf_elfheader (abfd)->e_flags = flags;
- elf_flags_init (abfd) = TRUE;
- return TRUE;
-}
-
-/* Merge backend specific data from an object file to the output
- object file when linking. */
-
-bfd_boolean
-_bfd_m68hc11_elf_merge_private_bfd_data (ibfd, obfd)
- bfd *ibfd;
- bfd *obfd;
-{
- flagword old_flags;
- flagword new_flags;
- bfd_boolean ok = TRUE;
-
- /* Check if we have the same endianess */
- if (!_bfd_generic_verify_endian_match (ibfd, obfd))
- return FALSE;
-
- if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
- || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
- return TRUE;
-
- new_flags = elf_elfheader (ibfd)->e_flags;
- elf_elfheader (obfd)->e_flags |= new_flags & EF_M68HC11_ABI;
- old_flags = elf_elfheader (obfd)->e_flags;
-
- if (! elf_flags_init (obfd))
- {
- elf_flags_init (obfd) = TRUE;
- elf_elfheader (obfd)->e_flags = new_flags;
- elf_elfheader (obfd)->e_ident[EI_CLASS]
- = elf_elfheader (ibfd)->e_ident[EI_CLASS];
-
- if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
- && bfd_get_arch_info (obfd)->the_default)
- {
- if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd),
- bfd_get_mach (ibfd)))
- return FALSE;
- }
-
- return TRUE;
- }
-
- /* Check ABI compatibility. */
- if ((new_flags & E_M68HC11_I32) != (old_flags & E_M68HC11_I32))
- {
- (*_bfd_error_handler)
- (_("%s: linking files compiled for 16-bit integers (-mshort) "
- "and others for 32-bit integers"),
- bfd_archive_filename (ibfd));
- ok = FALSE;
- }
- if ((new_flags & E_M68HC11_F64) != (old_flags & E_M68HC11_F64))
- {
- (*_bfd_error_handler)
- (_("%s: linking files compiled for 32-bit double (-fshort-double) "
- "and others for 64-bit double"),
- bfd_archive_filename (ibfd));
- ok = FALSE;
- }
- new_flags &= ~EF_M68HC11_ABI;
- old_flags &= ~EF_M68HC11_ABI;
-
- /* Warn about any other mismatches */
- if (new_flags != old_flags)
- {
- (*_bfd_error_handler)
- (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
- bfd_archive_filename (ibfd), (unsigned long) new_flags,
- (unsigned long) old_flags);
- ok = FALSE;
- }
-
- if (! ok)
- {
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
-
- return TRUE;
-}
-
-bfd_boolean
-_bfd_m68hc11_elf_print_private_bfd_data (abfd, ptr)
- bfd *abfd;
- PTR ptr;
-{
- FILE *file = (FILE *) ptr;
-
- BFD_ASSERT (abfd != NULL && ptr != NULL);
-
- /* Print normal ELF private data. */
- _bfd_elf_print_private_bfd_data (abfd, ptr);
-
- /* xgettext:c-format */
- fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
-
- if (elf_elfheader (abfd)->e_flags & E_M68HC11_I32)
- fprintf (file, _("[abi=32-bit int,"));
- else
- fprintf (file, _("[abi=16-bit int,"));
-
- if (elf_elfheader (abfd)->e_flags & E_M68HC11_F64)
- fprintf (file, _(" 64-bit double]"));
- else
- fprintf (file, _(" 32-bit double]"));
-
- if (elf_elfheader (abfd)->e_flags & E_M68HC12_BANKS)
- fprintf (file, _(" [memory=bank-model]"));
- else
- fprintf (file, _(" [memory=flat]"));
-
- fputc ('\n', file);
-
- return TRUE;
-}
-
-/* Below is the only difference between elf32-m68hc12.c and elf32-m68hc11.c.
- The Motorola spec says to use a different Elf machine code. */
#define ELF_ARCH bfd_arch_m68hc11
#define ELF_MACHINE_CODE EM_68HC11
#define ELF_MAXPAGESIZE 0x1000
@@ -1624,9 +1296,15 @@ _bfd_m68hc11_elf_print_private_bfd_data (abfd, ptr)
#define elf_backend_gc_sweep_hook elf32_m68hc11_gc_sweep_hook
#define elf_backend_check_relocs elf32_m68hc11_check_relocs
#define elf_backend_relocate_section elf32_m68hc11_relocate_section
+#define elf_backend_add_symbol_hook elf32_m68hc11_add_symbol_hook
#define elf_backend_object_p 0
#define elf_backend_final_write_processing 0
#define elf_backend_can_gc_sections 1
+
+#define bfd_elf32_bfd_link_hash_table_create \
+ m68hc11_elf_bfd_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_free \
+ m68hc11_elf_bfd_link_hash_table_free
#define bfd_elf32_bfd_merge_private_bfd_data \
_bfd_m68hc11_elf_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags _bfd_m68hc11_elf_set_private_flags
diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c
index 219fd6b0da3..54fdca28277 100644
--- a/bfd/elf32-m68hc12.c
+++ b/bfd/elf32-m68hc12.c
@@ -1,5 +1,5 @@
/* Motorola 68HC12-specific support for 32-bit ELF
- Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
Contributed by Stephane Carrez (stcarrez@nerim.fr)
(Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com))
@@ -21,49 +21,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
+#include "bfdlink.h"
#include "libbfd.h"
#include "elf-bfd.h"
+#include "elf32-m68hc1x.h"
#include "elf/m68hc11.h"
#include "opcode/m68hc11.h"
+/* Relocation functions. */
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
static void m68hc11_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
-static bfd_reloc_status_type m68hc11_elf_ignore_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static bfd_reloc_status_type m68hc12_elf_special_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static int m68hc12_addr_is_banked PARAMS ((bfd_vma));
-static bfd_vma m68hc12_phys_addr PARAMS ((bfd_vma));
-static bfd_vma m68hc12_phys_page PARAMS ((bfd_vma));
-
-/* GC mark and sweep. */
-static asection *elf32_m68hc11_gc_mark_hook
- PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *));
-static bfd_boolean elf32_m68hc11_gc_sweep_hook
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
+/* Trampoline generation. */
+static bfd_boolean m68hc12_elf_size_one_stub
+ PARAMS((struct bfd_hash_entry *gen_entry, PTR in_arg));
+static bfd_boolean m68hc12_elf_build_one_stub
+ PARAMS((struct bfd_hash_entry *gen_entry, PTR in_arg));
+static struct bfd_link_hash_table* m68hc12_elf_bfd_link_hash_table_create
+ PARAMS((bfd*));
static bfd_boolean m68hc12_elf_set_mach_from_flags PARAMS ((bfd *));
-bfd_boolean _bfd_m68hc12_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *));
-bfd_boolean _bfd_m68hc12_elf_set_private_flags PARAMS ((bfd *, flagword));
-bfd_boolean _bfd_m68hc12_elf_print_private_bfd_data PARAMS ((bfd *, PTR));
-
-
-
/* Use REL instead of RELA to save space */
#define USE_REL 1
-/* The Motorola 68HC11 microcontroler only addresses 64Kb.
- We must handle 8 and 16-bit relocations. The 32-bit relocation
- is defined but not used except by gas when -gstabs is used (which
- is wrong).
-
- The 68HC12 microcontroler has a memory bank switching system
+/* The 68HC12 microcontroler has a memory bank switching system
with a 16Kb window in the 64Kb address space. The extended memory
is mapped in the 16Kb window (at 0x8000). The page register controls
which 16Kb bank is mapped. The call/rtc instructions take care of
@@ -199,7 +183,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = {
FALSE, /* partial_inplace */
0x00ff, /* src_mask */
0x00ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* A 16 bit absolute relocation */
HOWTO (R_M68HC11_16, /* type */
@@ -209,7 +193,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = {
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont /*bitfield */ , /* complain_on_overflow */
- m68hc12_elf_special_reloc, /* special_function */
+ bfd_elf_generic_reloc, /* special_function */
"R_M68HC12_16", /* name */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
@@ -260,7 +244,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = {
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy */
HOWTO (R_M68HC11_GNU_VTINHERIT, /* type */
@@ -295,16 +279,16 @@ static reloc_howto_type elf_m68hc11_howto_table[] = {
/* A 24 bit relocation */
HOWTO (R_M68HC11_24, /* type */
0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
24, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- m68hc12_elf_special_reloc, /* special_function */
+ m68hc11_elf_special_reloc, /* special_function */
"R_M68HC12_24", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
+ 0xffffff, /* src_mask */
+ 0xffffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A 16-bit low relocation */
@@ -315,7 +299,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = {
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- m68hc12_elf_special_reloc,/* special_function */
+ m68hc11_elf_special_reloc,/* special_function */
"R_M68HC12_LO16", /* name */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
@@ -330,7 +314,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = {
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- m68hc12_elf_special_reloc,/* special_function */
+ m68hc11_elf_special_reloc,/* special_function */
"R_M68HC12_PAGE", /* name */
FALSE, /* partial_inplace */
0x00ff, /* src_mask */
@@ -423,217 +407,112 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
return NULL;
}
-/* This function is used for relocs which are only used for relaxing,
- which the linker should otherwise ignore. */
+/* Set the howto pointer for an M68HC11 ELF reloc. */
-static bfd_reloc_status_type
-m68hc11_elf_ignore_reloc (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
+static void
+m68hc11_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- asymbol *symbol ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+ arelent *cache_ptr;
+ Elf_Internal_Rela *dst;
{
- if (output_bfd != NULL)
- reloc_entry->address += input_section->output_offset;
- return bfd_reloc_ok;
-}
+ unsigned int r_type;
-static int
-m68hc12_addr_is_banked (addr)
- bfd_vma addr;
-{
- return (addr >= M68HC12_BANK_VIRT) ? 1 : 0;
+ r_type = ELF32_R_TYPE (dst->r_info);
+ BFD_ASSERT (r_type < (unsigned int) R_M68HC11_max);
+ cache_ptr->howto = &elf_m68hc11_howto_table[r_type];
}
-/* Return the physical address seen by the processor, taking
- into account banked memory. */
-static bfd_vma
-m68hc12_phys_addr (addr)
- bfd_vma addr;
-{
- if (addr < M68HC12_BANK_VIRT)
- return addr;
-
- /* Map the address to the memory bank. */
- addr -= M68HC12_BANK_VIRT;
- addr &= M68HC12_BANK_MASK;
- addr += M68HC12_BANK_BASE;
- return addr;
-}
+
+/* Far trampoline generation. */
-/* Return the page number corresponding to an address in banked memory. */
-static bfd_vma
-m68hc12_phys_page (addr)
- bfd_vma addr;
+/* Build a 68HC12 trampoline stub. */
+static bfd_boolean
+m68hc12_elf_build_one_stub (gen_entry, in_arg)
+ struct bfd_hash_entry *gen_entry;
+ PTR in_arg;
{
- if (addr < M68HC12_BANK_VIRT)
- return 0;
-
- /* Map the address to the memory bank. */
- addr -= M68HC12_BANK_VIRT;
- addr >>= M68HC12_BANK_SHIFT;
- addr &= M68HC12_BANK_PAGE_MASK;
- return addr;
-}
+ struct elf32_m68hc11_stub_hash_entry *stub_entry;
+ struct bfd_link_info *info;
+ struct m68hc11_elf_link_hash_table *htab;
+ asection *stub_sec;
+ bfd *stub_bfd;
+ bfd_byte *loc;
+ bfd_vma sym_value, phys_page, phys_addr;
-static bfd_reloc_status_type
-m68hc12_elf_special_reloc (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
-{
- reloc_howto_type *howto;
- bfd_vma relocation;
- bfd_vma phys_addr;
- bfd_vma phys_page;
- bfd_vma insn_page;
- bfd_vma insn_addr;
-
- if (output_bfd != (bfd *) NULL
- && (symbol->flags & BSF_SECTION_SYM) == 0
- && (! reloc_entry->howto->partial_inplace
- || reloc_entry->addend == 0))
- {
- reloc_entry->address += input_section->output_offset;
- return bfd_reloc_ok;
- }
+ /* Massage our args to the form they really have. */
+ stub_entry = (struct elf32_m68hc11_stub_hash_entry *) gen_entry;
+ info = (struct bfd_link_info *) in_arg;
- if (output_bfd != NULL)
- return bfd_reloc_continue;
+ htab = m68hc11_elf_hash_table (info);
- if (reloc_entry->address > input_section->_cooked_size)
- return bfd_reloc_outofrange;
+ stub_sec = stub_entry->stub_sec;
- /* Compute relocation. */
- relocation = (symbol->value
- + symbol->section->output_section->vma
- + symbol->section->output_offset);
- relocation += reloc_entry->addend;
- relocation += bfd_get_16 (abfd, (bfd_byte*) data + reloc_entry->address);
+ /* Make a note of the offset within the stubs for this entry. */
+ stub_entry->stub_offset = stub_sec->_raw_size;
+ stub_sec->_raw_size += 7;
+ loc = stub_sec->contents + stub_entry->stub_offset;
- /* Do the memory bank mapping. */
- phys_addr = m68hc12_phys_addr (relocation);
- phys_page = m68hc12_phys_page (relocation);
+ stub_bfd = stub_sec->owner;
- howto = reloc_entry->howto;
- if (howto->complain_on_overflow != complain_overflow_dont
- && (phys_addr & (((bfd_vma) -1) << 16)))
- return bfd_reloc_overflow;
+ /* Create the trampoline call stub:
- switch (howto->type)
- {
- case R_M68HC11_16:
- /* Get virtual address of instruction having the relocation. */
- insn_addr = input_section->output_section->vma
- + input_section->output_offset
- + reloc_entry->address;
-
- insn_page = m68hc12_phys_page (insn_addr);
-
- if (m68hc12_addr_is_banked (relocation)
- && m68hc12_addr_is_banked (insn_addr)
- && phys_page != insn_page)
- {
- *error_message = _("address is not in the same bank");
- return bfd_reloc_dangerous;
- }
- if (m68hc12_addr_is_banked (relocation)
- && !m68hc12_addr_is_banked (insn_addr))
- {
- *error_message = _("reference to a banked address in "
- "the normal address space");
- return bfd_reloc_dangerous;
- }
-
- case R_M68HC11_LO16:
- bfd_put_16 (abfd, phys_addr, (bfd_byte*) data + reloc_entry->address);
- break;
+ ldy #%addr(symbol)
+ call %page(symbol), __trampoline
- case R_M68HC11_24:
- bfd_put_16 (abfd, phys_addr, (bfd_byte*) data + reloc_entry->address);
- bfd_put_8 (abfd, phys_page, (bfd_byte*) data + reloc_entry->address + 2);
- break;
+ */
+ sym_value = (stub_entry->target_value
+ + stub_entry->target_section->output_offset
+ + stub_entry->target_section->output_section->vma);
+ phys_addr = m68hc11_phys_addr (&htab->pinfo, sym_value);
+ phys_page = m68hc11_phys_page (&htab->pinfo, sym_value);
- case R_M68HC11_PAGE:
- bfd_put_8 (abfd, phys_page, (bfd_byte*) data + reloc_entry->address);
- break;
+ /* ldy #%page(sym) */
+ bfd_put_8 (stub_bfd, 0xCD, loc);
+ bfd_put_16 (stub_bfd, phys_addr, loc + 1);
+ loc += 3;
- default:
- abort ();
- break;
- }
+ /* call %page(sym), __trampoline */
+ bfd_put_8 (stub_bfd, 0x4a, loc);
+ bfd_put_16 (stub_bfd, htab->pinfo.trampoline_addr, loc + 1);
+ bfd_put_8 (stub_bfd, phys_page, loc + 3);
- return bfd_reloc_ok;
+ return TRUE;
}
-/* Set the howto pointer for an M68HC11 ELF reloc. */
+/* As above, but don't actually build the stub. Just bump offset so
+ we know stub section sizes. */
-static void
-m68hc11_info_to_howto_rel (abfd, cache_ptr, dst)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *cache_ptr;
- Elf_Internal_Rela *dst;
+static bfd_boolean
+m68hc12_elf_size_one_stub (gen_entry, in_arg)
+ struct bfd_hash_entry *gen_entry;
+ PTR in_arg ATTRIBUTE_UNUSED;
{
- unsigned int r_type;
+ struct elf32_m68hc11_stub_hash_entry *stub_entry;
- r_type = ELF32_R_TYPE (dst->r_info);
- BFD_ASSERT (r_type < (unsigned int) R_M68HC11_max);
- cache_ptr->howto = &elf_m68hc11_howto_table[r_type];
+ /* Massage our args to the form they really have. */
+ stub_entry = (struct elf32_m68hc11_stub_hash_entry *) gen_entry;
+
+ stub_entry->stub_sec->_raw_size += 7;
+ return TRUE;
}
-static asection *
-elf32_m68hc11_gc_mark_hook (sec, info, rel, h, sym)
- asection *sec;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- Elf_Internal_Rela *rel;
- struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+/* Create a 68HC12 ELF linker hash table. */
+
+static struct bfd_link_hash_table *
+m68hc12_elf_bfd_link_hash_table_create (abfd)
+ bfd *abfd;
{
- if (h != NULL)
- {
- switch (ELF32_R_TYPE (rel->r_info))
- {
- default:
- switch (h->root.type)
- {
- case bfd_link_hash_defined:
- case bfd_link_hash_defweak:
- return h->root.u.def.section;
-
- case bfd_link_hash_common:
- return h->root.u.c.p->section;
-
- default:
- break;
- }
- }
- }
- else
- return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
+ struct m68hc11_elf_link_hash_table *ret;
- return NULL;
-}
+ ret = m68hc11_elf_hash_table_create (abfd);
+ if (ret == (struct m68hc11_elf_link_hash_table *) NULL)
+ return NULL;
-static bfd_boolean
-elf32_m68hc11_gc_sweep_hook (abfd, info, sec, relocs)
- bfd *abfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- asection *sec ATTRIBUTE_UNUSED;
- const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
-{
- /* We don't use got and plt entries for 68hc11/68hc12. */
- return TRUE;
-}
+ ret->size_one_stub = m68hc12_elf_size_one_stub;
+ ret->build_one_stub = m68hc12_elf_build_one_stub;
+ return &ret->root.root;
+}
static bfd_boolean
m68hc12_elf_set_mach_from_flags (abfd)
@@ -659,149 +538,6 @@ m68hc12_elf_set_mach_from_flags (abfd)
return TRUE;
}
-/* Set and control ELF flags in ELF header. */
-
-bfd_boolean
-_bfd_m68hc12_elf_set_private_flags (abfd, flags)
- bfd *abfd;
- flagword flags;
-{
- BFD_ASSERT (!elf_flags_init (abfd)
- || elf_elfheader (abfd)->e_flags == flags);
-
- elf_elfheader (abfd)->e_flags = flags;
- elf_flags_init (abfd) = TRUE;
- return m68hc12_elf_set_mach_from_flags (abfd);
-}
-
-/* Merge backend specific data from an object file to the output
- object file when linking. */
-
-bfd_boolean
-_bfd_m68hc12_elf_merge_private_bfd_data (ibfd, obfd)
- bfd *ibfd;
- bfd *obfd;
-{
- flagword old_flags;
- flagword new_flags;
- bfd_boolean ok = TRUE;
-
- /* Check if we have the same endianess */
- if (!_bfd_generic_verify_endian_match (ibfd, obfd))
- return FALSE;
-
- if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
- || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
- return TRUE;
-
- new_flags = elf_elfheader (ibfd)->e_flags;
- old_flags = elf_elfheader (obfd)->e_flags;
-
- if (! elf_flags_init (obfd))
- {
- elf_flags_init (obfd) = TRUE;
- elf_elfheader (obfd)->e_flags = new_flags;
- elf_elfheader (obfd)->e_ident[EI_CLASS]
- = elf_elfheader (ibfd)->e_ident[EI_CLASS];
-
- if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
- && bfd_get_arch_info (obfd)->the_default)
- {
- if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd),
- bfd_get_mach (ibfd)))
- return FALSE;
- }
-
- return TRUE;
- }
-
- /* Check ABI compatibility. */
- if ((new_flags & E_M68HC11_I32) != (old_flags & E_M68HC11_I32))
- {
- (*_bfd_error_handler)
- (_("%s: linking files compiled for 16-bit integers (-mshort) "
- "and others for 32-bit integers"),
- bfd_archive_filename (ibfd));
- ok = FALSE;
- }
- if ((new_flags & E_M68HC11_F64) != (old_flags & E_M68HC11_F64))
- {
- (*_bfd_error_handler)
- (_("%s: linking files compiled for 32-bit double (-fshort-double) "
- "and others for 64-bit double"),
- bfd_archive_filename (ibfd));
- ok = FALSE;
- }
-
- /* Processor compatibility. */
- if (!EF_M68HC11_CAN_MERGE_MACH (new_flags, old_flags))
- {
- (*_bfd_error_handler)
- (_("%s: linking files compiled for HCS12 with "
- "others compiled for HC12"),
- bfd_archive_filename (ibfd));
- ok = FALSE;
- }
- new_flags = ((new_flags & ~EF_M68HC11_MACH_MASK)
- | (EF_M68HC11_MERGE_MACH (new_flags, old_flags)));
-
- elf_elfheader (obfd)->e_flags = new_flags;
-
- /* Warn about any other mismatches */
- new_flags &= ~(EF_M68HC11_ABI | EF_M68HC11_MACH_MASK);
- old_flags &= ~(EF_M68HC11_ABI | EF_M68HC11_MACH_MASK);
- if (new_flags != old_flags)
- {
- (*_bfd_error_handler)
- (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
- bfd_archive_filename (ibfd), (unsigned long) new_flags,
- (unsigned long) old_flags);
- ok = FALSE;
- }
-
- if (! ok)
- {
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
-
- return TRUE;
-}
-
-bfd_boolean
-_bfd_m68hc12_elf_print_private_bfd_data (abfd, ptr)
- bfd *abfd;
- PTR ptr;
-{
- FILE *file = (FILE *) ptr;
-
- BFD_ASSERT (abfd != NULL && ptr != NULL);
-
- /* Print normal ELF private data. */
- _bfd_elf_print_private_bfd_data (abfd, ptr);
-
- /* xgettext:c-format */
- fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
-
- if (elf_elfheader (abfd)->e_flags & E_M68HC11_I32)
- fprintf (file, _("[abi=32-bit int,"));
- else
- fprintf (file, _("[abi=16-bit int,"));
-
- if (elf_elfheader (abfd)->e_flags & E_M68HC11_F64)
- fprintf (file, _(" 64-bit double,"));
- else
- fprintf (file, _(" 32-bit double,"));
-
- if (elf_elfheader (abfd)->e_flags & EF_M68HCS12_MACH)
- fprintf (file, _(" cpu=HCS12]"));
- else
- fprintf (file, _(" cpu=HC12]"));
- fputc ('\n', file);
-
- return TRUE;
-}
-
#define ELF_ARCH bfd_arch_m68hc12
#define ELF_MACHINE_CODE EM_68HC12
#define ELF_MAXPAGESIZE 0x1000
@@ -813,15 +549,22 @@ _bfd_m68hc12_elf_print_private_bfd_data (abfd, ptr)
#define elf_info_to_howto_rel m68hc11_info_to_howto_rel
#define elf_backend_gc_mark_hook elf32_m68hc11_gc_mark_hook
#define elf_backend_gc_sweep_hook elf32_m68hc11_gc_sweep_hook
+#define elf_backend_check_relocs elf32_m68hc11_check_relocs
+#define elf_backend_relocate_section elf32_m68hc11_relocate_section
#define elf_backend_object_p m68hc12_elf_set_mach_from_flags
#define elf_backend_final_write_processing 0
-/* Disabled as this backend uses the generic linker. */
-#define elf_backend_can_gc_sections 0
-
+#define elf_backend_can_gc_sections 1
+#define elf_backend_post_process_headers elf32_m68hc11_post_process_headers
+#define elf_backend_add_symbol_hook elf32_m68hc11_add_symbol_hook
+
+#define bfd_elf32_bfd_link_hash_table_create \
+ m68hc12_elf_bfd_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_free \
+ m68hc11_elf_bfd_link_hash_table_free
#define bfd_elf32_bfd_merge_private_bfd_data \
- _bfd_m68hc12_elf_merge_private_bfd_data
-#define bfd_elf32_bfd_set_private_flags _bfd_m68hc12_elf_set_private_flags
+ _bfd_m68hc11_elf_merge_private_bfd_data
+#define bfd_elf32_bfd_set_private_flags _bfd_m68hc11_elf_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data \
- _bfd_m68hc12_elf_print_private_bfd_data
+ _bfd_m68hc11_elf_print_private_bfd_data
#include "elf32-target.h"
diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c
new file mode 100644
index 00000000000..3c2ff6118f5
--- /dev/null
+++ b/bfd/elf32-m68hc1x.c
@@ -0,0 +1,1508 @@
+/* Motorola 68HC11/HC12-specific support for 32-bit ELF
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Contributed by Stephane Carrez (stcarrez@nerim.fr)
+
+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 "bfdlink.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf32-m68hc1x.h"
+#include "elf/m68hc11.h"
+#include "opcode/m68hc11.h"
+
+
+#define m68hc12_stub_hash_lookup(table, string, create, copy) \
+ ((struct elf32_m68hc11_stub_hash_entry *) \
+ bfd_hash_lookup ((table), (string), (create), (copy)))
+
+static struct elf32_m68hc11_stub_hash_entry* m68hc12_add_stub
+ PARAMS((const char *stub_name,
+ asection *section,
+ struct m68hc11_elf_link_hash_table *htab));
+
+static struct bfd_hash_entry *stub_hash_newfunc
+ PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
+
+static void m68hc11_elf_set_symbol
+ PARAMS ((bfd* abfd, struct bfd_link_info *info,
+ const char* name, bfd_vma value, asection* sec));
+
+static bfd_boolean m68hc11_elf_export_one_stub
+ PARAMS((struct bfd_hash_entry *gen_entry, PTR in_arg));
+
+static bfd_boolean m68hc11_get_relocation_value
+ PARAMS ((bfd* abfd,
+ struct bfd_link_info* info,
+ asection **local_sections,
+ Elf_Internal_Sym* local_syms,
+ Elf_Internal_Rela* rel,
+ const char** name,
+ bfd_vma* relocation,
+ bfd_boolean* is_far));
+
+static void scan_sections_for_abi PARAMS ((bfd*, asection*, PTR));
+
+struct m68hc11_scan_param
+{
+ struct m68hc11_page_info* pinfo;
+ bfd_boolean use_memory_banks;
+};
+
+
+/* Create a 68HC11/68HC12 ELF linker hash table. */
+
+struct m68hc11_elf_link_hash_table*
+m68hc11_elf_hash_table_create (abfd)
+ bfd *abfd;
+{
+ struct m68hc11_elf_link_hash_table *ret;
+ bfd_size_type amt = sizeof (struct m68hc11_elf_link_hash_table);
+
+ ret = (struct m68hc11_elf_link_hash_table *) bfd_zalloc (abfd, amt);
+ if (ret == (struct m68hc11_elf_link_hash_table *) NULL)
+ return NULL;
+
+ if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
+ _bfd_elf_link_hash_newfunc))
+ {
+ bfd_release (abfd, ret);
+ return NULL;
+ }
+
+ /* Init the stub hash table too. */
+ amt = sizeof (struct bfd_hash_table);
+ ret->stub_hash_table = (struct bfd_hash_table*) bfd_malloc (amt);
+ if (ret->stub_hash_table == NULL)
+ {
+ bfd_release (abfd, ret);
+ return NULL;
+ }
+ if (!bfd_hash_table_init (ret->stub_hash_table, stub_hash_newfunc))
+ return NULL;
+
+ ret->stub_bfd = NULL;
+ ret->stub_section = 0;
+ ret->add_stub_section = NULL;
+ ret->sym_sec.abfd = NULL;
+
+ return ret;
+}
+
+/* Free the derived linker hash table. */
+
+void
+m68hc11_elf_bfd_link_hash_table_free (hash)
+ struct bfd_link_hash_table *hash;
+{
+ struct m68hc11_elf_link_hash_table *ret
+ = (struct m68hc11_elf_link_hash_table *) hash;
+
+ bfd_hash_table_free (ret->stub_hash_table);
+ free (ret->stub_hash_table);
+ _bfd_generic_link_hash_table_free (hash);
+}
+
+/* Assorted hash table functions. */
+
+/* Initialize an entry in the stub hash table. */
+
+static struct bfd_hash_entry *
+stub_hash_newfunc (entry, table, string)
+ struct bfd_hash_entry *entry;
+ struct bfd_hash_table *table;
+ const char *string;
+{
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (entry == NULL)
+ {
+ entry = bfd_hash_allocate (table,
+ sizeof (struct elf32_m68hc11_stub_hash_entry));
+ if (entry == NULL)
+ return entry;
+ }
+
+ /* Call the allocation method of the superclass. */
+ entry = bfd_hash_newfunc (entry, table, string);
+ if (entry != NULL)
+ {
+ struct elf32_m68hc11_stub_hash_entry *eh;
+
+ /* Initialize the local fields. */
+ eh = (struct elf32_m68hc11_stub_hash_entry *) entry;
+ eh->stub_sec = NULL;
+ eh->stub_offset = 0;
+ eh->target_value = 0;
+ eh->target_section = NULL;
+ }
+
+ return entry;
+}
+
+/* Add a new stub entry to the stub hash. Not all fields of the new
+ stub entry are initialised. */
+
+static struct elf32_m68hc11_stub_hash_entry *
+m68hc12_add_stub (stub_name, section, htab)
+ const char *stub_name;
+ asection *section;
+ struct m68hc11_elf_link_hash_table *htab;
+{
+ struct elf32_m68hc11_stub_hash_entry *stub_entry;
+
+ /* Enter this entry into the linker stub hash table. */
+ stub_entry = m68hc12_stub_hash_lookup (htab->stub_hash_table, stub_name,
+ TRUE, FALSE);
+ if (stub_entry == NULL)
+ {
+ (*_bfd_error_handler) (_("%s: cannot create stub entry %s"),
+ bfd_archive_filename (section->owner),
+ stub_name);
+ return NULL;
+ }
+
+ if (htab->stub_section == 0)
+ {
+ htab->stub_section = (*htab->add_stub_section) (".tramp",
+ htab->tramp_section);
+ }
+
+ stub_entry->stub_sec = htab->stub_section;
+ stub_entry->stub_offset = 0;
+ return stub_entry;
+}
+
+/* Hook called by the linker routine which adds symbols from an object
+ file. We use it for identify far symbols and force a loading of
+ the trampoline handler. */
+
+bfd_boolean
+elf32_m68hc11_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ const Elf_Internal_Sym *sym;
+ const char **namep ATTRIBUTE_UNUSED;
+ flagword *flagsp ATTRIBUTE_UNUSED;
+ asection **secp ATTRIBUTE_UNUSED;
+ bfd_vma *valp ATTRIBUTE_UNUSED;
+{
+ if (sym->st_other & STO_M68HC12_FAR)
+ {
+ struct elf_link_hash_entry *h;
+
+ h = (struct elf_link_hash_entry *)
+ bfd_link_hash_lookup (info->hash, "__far_trampoline",
+ FALSE, FALSE, FALSE);
+ if (h == NULL)
+ {
+ struct bfd_link_hash_entry* entry = NULL;
+
+ _bfd_generic_link_add_one_symbol (info, abfd,
+ "__far_trampoline",
+ BSF_GLOBAL,
+ bfd_und_section_ptr,
+ (bfd_vma) 0, (const char*) NULL,
+ FALSE, FALSE, &entry);
+ }
+
+ }
+ return TRUE;
+}
+
+/* External entry points for sizing and building linker stubs. */
+
+/* Set up various things so that we can make a list of input sections
+ for each output section included in the link. Returns -1 on error,
+ 0 when no stubs will be needed, and 1 on success. */
+
+int
+elf32_m68hc11_setup_section_lists (output_bfd, info)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+{
+ bfd *input_bfd;
+ unsigned int bfd_count;
+ int top_id, top_index;
+ asection *section;
+ asection **input_list, **list;
+ bfd_size_type amt;
+ asection *text_section;
+ struct m68hc11_elf_link_hash_table *htab;
+
+ htab = m68hc11_elf_hash_table (info);
+
+ if (htab->root.root.creator->flavour != bfd_target_elf_flavour)
+ return 0;
+
+ /* Count the number of input BFDs and find the top input section id.
+ Also search for an existing ".tramp" section so that we know
+ where generated trampolines must go. Default to ".text" if we
+ can't find it. */
+ htab->tramp_section = 0;
+ text_section = 0;
+ for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0;
+ input_bfd != NULL;
+ input_bfd = input_bfd->link_next)
+ {
+ bfd_count += 1;
+ for (section = input_bfd->sections;
+ section != NULL;
+ section = section->next)
+ {
+ const char* name = bfd_get_section_name (input_bfd, section);
+
+ if (!strcmp (name, ".tramp"))
+ htab->tramp_section = section;
+
+ if (!strcmp (name, ".text"))
+ text_section = section;
+
+ if (top_id < section->id)
+ top_id = section->id;
+ }
+ }
+ htab->bfd_count = bfd_count;
+ if (htab->tramp_section == 0)
+ htab->tramp_section = text_section;
+
+ /* We can't use output_bfd->section_count here to find the top output
+ section index as some sections may have been removed, and
+ _bfd_strip_section_from_output doesn't renumber the indices. */
+ for (section = output_bfd->sections, top_index = 0;
+ section != NULL;
+ section = section->next)
+ {
+ if (top_index < section->index)
+ top_index = section->index;
+ }
+
+ htab->top_index = top_index;
+ amt = sizeof (asection *) * (top_index + 1);
+ input_list = (asection **) bfd_malloc (amt);
+ htab->input_list = input_list;
+ if (input_list == NULL)
+ return -1;
+
+ /* For sections we aren't interested in, mark their entries with a
+ value we can check later. */
+ list = input_list + top_index;
+ do
+ *list = bfd_abs_section_ptr;
+ while (list-- != input_list);
+
+ for (section = output_bfd->sections;
+ section != NULL;
+ section = section->next)
+ {
+ if ((section->flags & SEC_CODE) != 0)
+ input_list[section->index] = NULL;
+ }
+
+ return 1;
+}
+
+/* Determine and set the size of the stub section for a final link.
+
+ The basic idea here is to examine all the relocations looking for
+ PC-relative calls to a target that is unreachable with a "bl"
+ instruction. */
+
+bfd_boolean
+elf32_m68hc11_size_stubs (output_bfd, stub_bfd, info, add_stub_section)
+ bfd *output_bfd;
+ bfd *stub_bfd;
+ struct bfd_link_info *info;
+ asection * (*add_stub_section) PARAMS ((const char *, asection *));
+{
+ bfd *input_bfd;
+ asection *section;
+ Elf_Internal_Sym *local_syms, **all_local_syms;
+ unsigned int bfd_indx, bfd_count;
+ bfd_size_type amt;
+ asection *stub_sec;
+
+ struct m68hc11_elf_link_hash_table *htab = m68hc11_elf_hash_table (info);
+
+ /* Stash our params away. */
+ htab->stub_bfd = stub_bfd;
+ htab->add_stub_section = add_stub_section;
+
+ /* Count the number of input BFDs and find the top input section id. */
+ for (input_bfd = info->input_bfds, bfd_count = 0;
+ input_bfd != NULL;
+ input_bfd = input_bfd->link_next)
+ {
+ bfd_count += 1;
+ }
+
+ /* We want to read in symbol extension records only once. To do this
+ we need to read in the local symbols in parallel and save them for
+ later use; so hold pointers to the local symbols in an array. */
+ amt = sizeof (Elf_Internal_Sym *) * bfd_count;
+ all_local_syms = (Elf_Internal_Sym **) bfd_zmalloc (amt);
+ if (all_local_syms == NULL)
+ return FALSE;
+
+ /* Walk over all the input BFDs, swapping in local symbols. */
+ for (input_bfd = info->input_bfds, bfd_indx = 0;
+ input_bfd != NULL;
+ input_bfd = input_bfd->link_next, bfd_indx++)
+ {
+ Elf_Internal_Shdr *symtab_hdr;
+ Elf_Internal_Shdr *shndx_hdr;
+ Elf_Internal_Sym *isym;
+ Elf32_External_Sym *extsyms, *esym, *end_sy;
+ Elf_External_Sym_Shndx *shndx_buf, *shndx;
+ bfd_size_type sec_size;
+
+ /* We'll need the symbol table in a second. */
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ if (symtab_hdr->sh_info == 0)
+ continue;
+
+ /* We need an array of the local symbols attached to the input bfd.
+ Unfortunately, we're going to have to read & swap them in. */
+ sec_size = symtab_hdr->sh_info;
+ sec_size *= sizeof (Elf_Internal_Sym);
+ local_syms = (Elf_Internal_Sym *) bfd_malloc (sec_size);
+ if (local_syms == NULL)
+ goto error_ret_free_local;
+
+ all_local_syms[bfd_indx] = local_syms;
+ sec_size = symtab_hdr->sh_info;
+ sec_size *= sizeof (Elf32_External_Sym);
+
+ /* Get the cached copy. */
+ 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_ret_free_local;
+
+ if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0
+ || bfd_bread ((PTR) extsyms, amt, input_bfd) != amt)
+ {
+ error_ret_free_ext_syms:
+ free (extsyms);
+ goto error_ret_free_local;
+ }
+ }
+ shndx_buf = NULL;
+ shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr;
+ if (shndx_hdr->sh_size != 0)
+ {
+ bfd_size_type amt;
+
+ amt = symtab_hdr->sh_info * sizeof (Elf_External_Sym_Shndx);
+ shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt);
+ if (shndx_buf == NULL)
+ goto error_ret_free_ext_syms;
+ if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0
+ || bfd_bread ((PTR) shndx_buf, amt, input_bfd) != amt)
+ {
+ free (shndx_buf);
+ goto error_ret_free_ext_syms;
+ }
+ shndx_hdr->contents = (PTR) shndx_buf;
+ }
+
+ /* Swap the local symbols in. */
+ for (esym = extsyms, end_sy = esym + symtab_hdr->sh_info,
+ isym = local_syms, shndx = shndx_buf;
+ esym < end_sy;
+ esym++, isym++, shndx = (shndx ? shndx + 1 : NULL))
+ bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, isym);
+
+ /* Now we can free the external symbols. */
+ free (shndx_buf);
+ }
+
+ for (input_bfd = info->input_bfds, bfd_indx = 0;
+ input_bfd != NULL;
+ input_bfd = input_bfd->link_next, bfd_indx++)
+ {
+ Elf_Internal_Shdr *symtab_hdr;
+ Elf_Internal_Sym *local_syms;
+ struct elf_link_hash_entry ** sym_hashes;
+
+ sym_hashes = elf_sym_hashes (input_bfd);
+
+ /* We'll need the symbol table in a second. */
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ if (symtab_hdr->sh_info == 0)
+ continue;
+
+ local_syms = all_local_syms[bfd_indx];
+
+ /* Walk over each section attached to the input bfd. */
+ for (section = input_bfd->sections;
+ section != NULL;
+ section = section->next)
+ {
+ Elf_Internal_Rela *internal_relocs, *irelaend, *irela;
+
+ /* If there aren't any relocs, then there's nothing more
+ to do. */
+ if ((section->flags & SEC_RELOC) == 0
+ || section->reloc_count == 0)
+ continue;
+
+ /* If this section is a link-once section that will be
+ discarded, then don't create any stubs. */
+ if (section->output_section == NULL
+ || section->output_section->owner != output_bfd)
+ continue;
+
+ /* Get the relocs. */
+ internal_relocs
+ = _bfd_elf_link_read_relocs (input_bfd, section, NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
+ if (internal_relocs == NULL)
+ goto error_ret_free_local;
+
+ /* Now examine each relocation. */
+ irela = internal_relocs;
+ irelaend = irela + section->reloc_count;
+ for (; irela < irelaend; irela++)
+ {
+ unsigned int r_type, r_indx;
+ struct elf32_m68hc11_stub_hash_entry *stub_entry;
+ asection *sym_sec;
+ bfd_vma sym_value;
+ struct elf_link_hash_entry *hash;
+ const char *stub_name;
+ Elf_Internal_Sym *sym;
+
+ r_type = ELF32_R_TYPE (irela->r_info);
+
+ /* Only look at 16-bit relocs. */
+ if (r_type != (unsigned int) R_M68HC11_16)
+ continue;
+
+ /* Now determine the call target, its name, value,
+ section. */
+ r_indx = ELF32_R_SYM (irela->r_info);
+ if (r_indx < symtab_hdr->sh_info)
+ {
+ /* It's a local symbol. */
+ Elf_Internal_Shdr *hdr;
+ bfd_boolean is_far;
+
+ sym = local_syms + r_indx;
+ hdr = elf_elfsections (input_bfd)[sym->st_shndx];
+ sym_sec = hdr->bfd_section;
+ is_far = (sym && (sym->st_other & STO_M68HC12_FAR));
+ if (!is_far)
+ continue;
+ stub_name = (bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link,
+ sym->st_name));
+ sym_value = sym->st_value;
+ hash = NULL;
+ }
+ else
+ {
+ /* It's an external symbol. */
+ int e_indx;
+
+ e_indx = r_indx - symtab_hdr->sh_info;
+ hash = (struct elf_link_hash_entry *)
+ (sym_hashes[e_indx]);
+
+ while (hash->root.type == bfd_link_hash_indirect
+ || hash->root.type == bfd_link_hash_warning)
+ hash = ((struct elf_link_hash_entry *)
+ hash->root.u.i.link);
+
+ if (hash->root.type == bfd_link_hash_defined
+ || hash->root.type == bfd_link_hash_defweak)
+ {
+ if (!(hash->other & STO_M68HC12_FAR))
+ continue;
+ }
+ else if (hash->root.type == bfd_link_hash_undefweak)
+ {
+ continue;
+ }
+ else if (hash->root.type == bfd_link_hash_undefined)
+ {
+ continue;
+ }
+ else
+ {
+ bfd_set_error (bfd_error_bad_value);
+ goto error_ret_free_internal;
+ }
+ sym_sec = hash->root.u.def.section;
+ sym_value = hash->root.u.def.value;
+ stub_name = hash->root.root.string;
+ }
+
+ if (!stub_name)
+ goto error_ret_free_internal;
+
+ stub_entry = m68hc12_stub_hash_lookup
+ (htab->stub_hash_table,
+ stub_name,
+ FALSE, FALSE);
+ if (stub_entry == NULL)
+ {
+ if (add_stub_section == 0)
+ continue;
+
+ stub_entry = m68hc12_add_stub (stub_name, section, htab);
+ if (stub_entry == NULL)
+ {
+ error_ret_free_internal:
+ if (elf_section_data (section)->relocs == NULL)
+ free (internal_relocs);
+ goto error_ret_free_local;
+ }
+ }
+
+ stub_entry->target_value = sym_value;
+ stub_entry->target_section = sym_sec;
+ }
+
+ /* We're done with the internal relocs, free them. */
+ if (elf_section_data (section)->relocs == NULL)
+ free (internal_relocs);
+ }
+ }
+
+ if (add_stub_section)
+ {
+ /* OK, we've added some stubs. Find out the new size of the
+ stub sections. */
+ for (stub_sec = htab->stub_bfd->sections;
+ stub_sec != NULL;
+ stub_sec = stub_sec->next)
+ {
+ stub_sec->_raw_size = 0;
+ stub_sec->_cooked_size = 0;
+ }
+
+ bfd_hash_traverse (htab->stub_hash_table, htab->size_one_stub, htab);
+ }
+ free (htab->all_local_syms);
+ return TRUE;
+
+ error_ret_free_local:
+ free (htab->all_local_syms);
+ return FALSE;
+}
+
+/* Export the trampoline addresses in the symbol table. */
+static bfd_boolean
+m68hc11_elf_export_one_stub (gen_entry, in_arg)
+ struct bfd_hash_entry *gen_entry;
+ PTR in_arg;
+{
+ struct bfd_link_info *info;
+ struct m68hc11_elf_link_hash_table *htab;
+ struct elf32_m68hc11_stub_hash_entry *stub_entry;
+ char* name;
+ bfd_boolean result;
+
+ info = (struct bfd_link_info *) in_arg;
+ htab = m68hc11_elf_hash_table (info);
+
+ /* Massage our args to the form they really have. */
+ stub_entry = (struct elf32_m68hc11_stub_hash_entry *) gen_entry;
+
+ /* Generate the trampoline according to HC11 or HC12. */
+ result = (* htab->build_one_stub) (gen_entry, in_arg);
+
+ /* Make a printable name that does not conflict with the real function. */
+ name = alloca (strlen (stub_entry->root.string) + 16);
+ sprintf (name, "tramp.%s", stub_entry->root.string);
+
+ /* Export the symbol for debugging/disassembling. */
+ m68hc11_elf_set_symbol (htab->stub_bfd, info, name,
+ stub_entry->stub_offset,
+ stub_entry->stub_sec);
+ return result;
+}
+
+/* Export a symbol or set its value and section. */
+static void
+m68hc11_elf_set_symbol (abfd, info, name, value, sec)
+ bfd* abfd;
+ struct bfd_link_info *info;
+ const char* name;
+ bfd_vma value;
+ asection* sec;
+{
+ struct elf_link_hash_entry *h;
+
+ h = (struct elf_link_hash_entry *)
+ bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, FALSE);
+ if (h == NULL)
+ {
+ _bfd_generic_link_add_one_symbol (info, abfd,
+ name,
+ BSF_GLOBAL,
+ sec,
+ value,
+ (const char*) NULL,
+ TRUE, FALSE, NULL);
+ }
+ else
+ {
+ h->root.type = bfd_link_hash_defined;
+ h->root.u.def.value = value;
+ h->root.u.def.section = sec;
+ }
+}
+
+
+/* Build all the stubs associated with the current output file. The
+ stubs are kept in a hash table attached to the main linker hash
+ table. This function is called via m68hc12elf_finish in the
+ linker. */
+
+bfd_boolean
+elf32_m68hc11_build_stubs (abfd, info)
+ bfd* abfd;
+ struct bfd_link_info *info;
+{
+ asection *stub_sec;
+ struct bfd_hash_table *table;
+ struct m68hc11_elf_link_hash_table *htab;
+ struct m68hc11_scan_param param;
+
+ m68hc11_elf_get_bank_parameters (info);
+ htab = m68hc11_elf_hash_table (info);
+
+ for (stub_sec = htab->stub_bfd->sections;
+ stub_sec != NULL;
+ stub_sec = stub_sec->next)
+ {
+ bfd_size_type size;
+
+ /* Allocate memory to hold the linker stubs. */
+ size = stub_sec->_raw_size;
+ stub_sec->contents = (unsigned char *) bfd_zalloc (htab->stub_bfd, size);
+ if (stub_sec->contents == NULL && size != 0)
+ return FALSE;
+ stub_sec->_raw_size = 0;
+ }
+
+ /* Build the stubs as directed by the stub hash table. */
+ table = htab->stub_hash_table;
+ bfd_hash_traverse (table, m68hc11_elf_export_one_stub, info);
+
+ /* Scan the output sections to see if we use the memory banks.
+ If so, export the symbols that define how the memory banks
+ are mapped. This is used by gdb and the simulator to obtain
+ the information. It can be used by programs to burn the eprom
+ at the good addresses. */
+ param.use_memory_banks = FALSE;
+ param.pinfo = &htab->pinfo;
+ bfd_map_over_sections (abfd, scan_sections_for_abi, &param);
+ if (param.use_memory_banks)
+ {
+ m68hc11_elf_set_symbol (abfd, info, BFD_M68HC11_BANK_START_NAME,
+ htab->pinfo.bank_physical,
+ bfd_abs_section_ptr);
+ m68hc11_elf_set_symbol (abfd, info, BFD_M68HC11_BANK_VIRTUAL_NAME,
+ htab->pinfo.bank_virtual,
+ bfd_abs_section_ptr);
+ m68hc11_elf_set_symbol (abfd, info, BFD_M68HC11_BANK_SIZE_NAME,
+ htab->pinfo.bank_size,
+ bfd_abs_section_ptr);
+ }
+
+ return TRUE;
+}
+
+void
+m68hc11_elf_get_bank_parameters (info)
+ struct bfd_link_info *info;
+{
+ unsigned i;
+ struct m68hc11_page_info *pinfo;
+ struct bfd_link_hash_entry *h;
+
+ pinfo = &m68hc11_elf_hash_table (info)->pinfo;
+ if (pinfo->bank_param_initialized)
+ return;
+
+ pinfo->bank_virtual = M68HC12_BANK_VIRT;
+ pinfo->bank_mask = M68HC12_BANK_MASK;
+ pinfo->bank_physical = M68HC12_BANK_BASE;
+ pinfo->bank_shift = M68HC12_BANK_SHIFT;
+ pinfo->bank_size = 1 << M68HC12_BANK_SHIFT;
+
+ h = bfd_link_hash_lookup (info->hash, BFD_M68HC11_BANK_START_NAME,
+ FALSE, FALSE, TRUE);
+ if (h != (struct bfd_link_hash_entry*) NULL
+ && h->type == bfd_link_hash_defined)
+ pinfo->bank_physical = (h->u.def.value
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
+
+ h = bfd_link_hash_lookup (info->hash, BFD_M68HC11_BANK_VIRTUAL_NAME,
+ FALSE, FALSE, TRUE);
+ if (h != (struct bfd_link_hash_entry*) NULL
+ && h->type == bfd_link_hash_defined)
+ pinfo->bank_virtual = (h->u.def.value
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
+
+ h = bfd_link_hash_lookup (info->hash, BFD_M68HC11_BANK_SIZE_NAME,
+ FALSE, FALSE, TRUE);
+ if (h != (struct bfd_link_hash_entry*) NULL
+ && h->type == bfd_link_hash_defined)
+ pinfo->bank_size = (h->u.def.value
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
+
+ pinfo->bank_shift = 0;
+ for (i = pinfo->bank_size; i != 0; i >>= 1)
+ pinfo->bank_shift++;
+ pinfo->bank_shift--;
+ pinfo->bank_mask = (1 << pinfo->bank_shift) - 1;
+ pinfo->bank_physical_end = pinfo->bank_physical + pinfo->bank_size;
+ pinfo->bank_param_initialized = 1;
+
+ h = bfd_link_hash_lookup (info->hash, "__far_trampoline", FALSE,
+ FALSE, TRUE);
+ if (h != (struct bfd_link_hash_entry*) NULL
+ && h->type == bfd_link_hash_defined)
+ pinfo->trampoline_addr = (h->u.def.value
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
+}
+
+/* Return 1 if the address is in banked memory.
+ This can be applied to a virtual address and to a physical address. */
+int
+m68hc11_addr_is_banked (pinfo, addr)
+ struct m68hc11_page_info *pinfo;
+ bfd_vma addr;
+{
+ if (addr >= pinfo->bank_virtual)
+ return 1;
+
+ if (addr >= pinfo->bank_physical && addr <= pinfo->bank_physical_end)
+ return 1;
+
+ return 0;
+}
+
+/* Return the physical address seen by the processor, taking
+ into account banked memory. */
+bfd_vma
+m68hc11_phys_addr (pinfo, addr)
+ struct m68hc11_page_info *pinfo;
+ bfd_vma addr;
+{
+ if (addr < pinfo->bank_virtual)
+ return addr;
+
+ /* Map the address to the memory bank. */
+ addr -= pinfo->bank_virtual;
+ addr &= pinfo->bank_mask;
+ addr += pinfo->bank_physical;
+ return addr;
+}
+
+/* Return the page number corresponding to an address in banked memory. */
+bfd_vma
+m68hc11_phys_page (pinfo, addr)
+ struct m68hc11_page_info *pinfo;
+ bfd_vma addr;
+{
+ if (addr < pinfo->bank_virtual)
+ return 0;
+
+ /* Map the address to the memory bank. */
+ addr -= pinfo->bank_virtual;
+ addr >>= pinfo->bank_shift;
+ addr &= 0x0ff;
+ return addr;
+}
+
+/* This function is used for relocs which are only used for relaxing,
+ which the linker should otherwise ignore. */
+
+bfd_reloc_status_type
+m68hc11_elf_ignore_reloc (abfd, reloc_entry, symbol, data, input_section,
+ output_bfd, error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ if (output_bfd != NULL)
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+}
+
+bfd_reloc_status_type
+m68hc11_elf_special_reloc (abfd, reloc_entry, symbol, data, input_section,
+ output_bfd, error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry;
+ asymbol *symbol;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ if (output_bfd != (bfd *) NULL
+ && (symbol->flags & BSF_SECTION_SYM) == 0
+ && (! reloc_entry->howto->partial_inplace
+ || reloc_entry->addend == 0))
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
+ if (output_bfd != NULL)
+ return bfd_reloc_continue;
+
+ if (reloc_entry->address > input_section->_cooked_size)
+ return bfd_reloc_outofrange;
+
+ abort();
+}
+
+asection *
+elf32_m68hc11_gc_mark_hook (sec, info, rel, h, sym)
+ asection *sec;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ Elf_Internal_Rela *rel;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+{
+ if (h != NULL)
+ {
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ default:
+ switch (h->root.type)
+ {
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ return h->root.u.def.section;
+
+ case bfd_link_hash_common:
+ return h->root.u.c.p->section;
+
+ default:
+ break;
+ }
+ }
+ }
+ else
+ return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
+
+ return NULL;
+}
+
+bfd_boolean
+elf32_m68hc11_gc_sweep_hook (abfd, info, sec, relocs)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ asection *sec ATTRIBUTE_UNUSED;
+ const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
+{
+ /* We don't use got and plt entries for 68hc11/68hc12. */
+ return TRUE;
+}
+
+/* Look through the relocs for a section during the first phase.
+ Since we don't do .gots or .plts, we just need to consider the
+ virtual table relocs for gc. */
+
+bfd_boolean
+elf32_m68hc11_check_relocs (abfd, info, sec, relocs)
+ bfd * abfd;
+ struct bfd_link_info * info;
+ asection * sec;
+ const Elf_Internal_Rela * relocs;
+{
+ Elf_Internal_Shdr * symtab_hdr;
+ struct elf_link_hash_entry ** sym_hashes;
+ struct elf_link_hash_entry ** sym_hashes_end;
+ const Elf_Internal_Rela * rel;
+ const Elf_Internal_Rela * rel_end;
+
+ if (info->relocateable)
+ return TRUE;
+
+ symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+ sym_hashes_end = sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
+ if (!elf_bad_symtab (abfd))
+ sym_hashes_end -= symtab_hdr->sh_info;
+
+ rel_end = relocs + sec->reloc_count;
+
+ for (rel = relocs; rel < rel_end; rel++)
+ {
+ struct elf_link_hash_entry * h;
+ unsigned long r_symndx;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+
+ if (r_symndx < symtab_hdr->sh_info)
+ h = NULL;
+ else
+ h = sym_hashes [r_symndx - symtab_hdr->sh_info];
+
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_M68HC11_GNU_VTINHERIT:
+ if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_M68HC11_GNU_VTENTRY:
+ if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
+ }
+ }
+
+ return TRUE;
+}
+
+static bfd_boolean
+m68hc11_get_relocation_value (abfd, info, local_sections, local_syms,
+ rel, name,
+ relocation, is_far)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ asection **local_sections;
+ Elf_Internal_Sym* local_syms;
+ Elf_Internal_Rela* rel;
+ const char** name;
+ bfd_vma* relocation;
+ bfd_boolean* is_far;
+{
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ unsigned long r_symndx;
+ asection *sec;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+ const char* stub_name = 0;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+
+ /* This is a final link. */
+ h = NULL;
+ sym = NULL;
+ sec = NULL;
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+ *relocation = (sec->output_section->vma
+ + sec->output_offset
+ + sym->st_value);
+ *is_far = (sym && (sym->st_other & STO_M68HC12_FAR));
+ if (*is_far)
+ stub_name = (bfd_elf_string_from_elf_section
+ (abfd, symtab_hdr->sh_link,
+ sym->st_name));
+ }
+ else
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ {
+ sec = h->root.u.def.section;
+ *relocation = (h->root.u.def.value
+ + sec->output_section->vma
+ + sec->output_offset);
+ }
+ else if (h->root.type == bfd_link_hash_undefweak)
+ *relocation = 0;
+ else
+ {
+ if (!((*info->callbacks->undefined_symbol)
+ (info, h->root.root.string, abfd,
+ sec, rel->r_offset, TRUE)))
+ return FALSE;
+ *relocation = 0;
+ }
+ *is_far = (h && (h->other & STO_M68HC12_FAR));
+ stub_name = h->root.root.string;
+ }
+
+ if (h != NULL)
+ *name = h->root.root.string;
+ else
+ {
+ *name = (bfd_elf_string_from_elf_section
+ (abfd, symtab_hdr->sh_link, sym->st_name));
+ if (*name == NULL || **name == '\0')
+ *name = bfd_section_name (input_bfd, sec);
+ }
+
+ if (*is_far && ELF32_R_TYPE (rel->r_info) == R_M68HC11_16)
+ {
+ struct elf32_m68hc11_stub_hash_entry* stub;
+ struct m68hc11_elf_link_hash_table *htab;
+
+ htab = m68hc11_elf_hash_table (info);
+ stub = m68hc12_stub_hash_lookup (htab->stub_hash_table,
+ *name, FALSE, FALSE);
+ if (stub)
+ {
+ *relocation = stub->stub_offset
+ + stub->stub_sec->output_section->vma
+ + stub->stub_sec->output_offset;
+ *is_far = FALSE;
+ }
+ }
+ return TRUE;
+}
+
+/* Relocate a 68hc11/68hc12 ELF section. */
+bfd_boolean
+elf32_m68hc11_relocate_section (output_bfd, info, input_bfd, input_section,
+ contents, relocs, local_syms, local_sections)
+ bfd *output_bfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info;
+ bfd *input_bfd;
+ asection *input_section;
+ bfd_byte *contents;
+ Elf_Internal_Rela *relocs;
+ Elf_Internal_Sym *local_syms;
+ asection **local_sections;
+{
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ Elf_Internal_Rela *rel, *relend;
+ const char *name;
+ struct m68hc11_page_info *pinfo;
+ struct elf_backend_data * const ebd = get_elf_backend_data (input_bfd);
+
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (input_bfd);
+
+ /* Get memory bank parameters. */
+ m68hc11_elf_get_bank_parameters (info);
+ pinfo = &m68hc11_elf_hash_table (info)->pinfo;
+
+ rel = relocs;
+ relend = relocs + input_section->reloc_count;
+ for (; rel < relend; rel++)
+ {
+ int r_type;
+ arelent arel;
+ reloc_howto_type *howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym *sym;
+ asection *sec;
+ bfd_vma relocation;
+ bfd_reloc_status_type r = bfd_reloc_undefined;
+ bfd_vma phys_page;
+ bfd_vma phys_addr;
+ bfd_vma insn_addr;
+ bfd_vma insn_page;
+ bfd_boolean is_far;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ r_type = ELF32_R_TYPE (rel->r_info);
+
+ if (r_type == R_M68HC11_GNU_VTENTRY
+ || r_type == R_M68HC11_GNU_VTINHERIT )
+ continue;
+
+ if (info->relocateable)
+ {
+ /* This is a relocateable link. We don't have to change
+ anything, unless the reloc is against a section symbol,
+ in which case we have to adjust according to where the
+ section symbol winds up in the output section. */
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ {
+ sec = local_sections[r_symndx];
+ rel->r_addend += sec->output_offset + sym->st_value;
+ }
+ }
+
+ continue;
+ }
+ (*ebd->elf_info_to_howto_rel) (input_bfd, &arel, rel);
+ howto = arel.howto;
+
+ m68hc11_get_relocation_value (input_bfd, info,
+ local_sections, local_syms,
+ rel, &name, &relocation, &is_far);
+
+ /* Do the memory bank mapping. */
+ phys_addr = m68hc11_phys_addr (pinfo, relocation + rel->r_addend);
+ phys_page = m68hc11_phys_page (pinfo, relocation + rel->r_addend);
+ switch (r_type)
+ {
+ case R_M68HC11_24:
+ /* Reloc used by 68HC12 call instruction. */
+ bfd_put_16 (input_bfd, phys_addr,
+ (bfd_byte*) contents + rel->r_offset);
+ bfd_put_8 (input_bfd, phys_page,
+ (bfd_byte*) contents + rel->r_offset + 2);
+ r = bfd_reloc_ok;
+ r_type = R_M68HC11_NONE;
+ break;
+
+ case R_M68HC11_NONE:
+ r = bfd_reloc_ok;
+ break;
+
+ case R_M68HC11_LO16:
+ /* Reloc generated by %addr(expr) gas to obtain the
+ address as mapped in the memory bank window. */
+ relocation = phys_addr;
+ break;
+
+ case R_M68HC11_PAGE:
+ /* Reloc generated by %page(expr) gas to obtain the
+ page number associated with the address. */
+ relocation = phys_page;
+ break;
+
+ case R_M68HC11_16:
+ /* Get virtual address of instruction having the relocation. */
+ if (is_far)
+ {
+ const char* msg;
+ char* buf;
+ msg = _("Reference to the far symbol `%s' using a wrong "
+ "relocation may result in incorrect execution");
+ buf = alloca (strlen (msg) + strlen (name) + 10);
+ sprintf (buf, msg, name);
+
+ (* info->callbacks->warning)
+ (info, buf, name, input_bfd, NULL, rel->r_offset);
+ }
+
+ /* Get virtual address of instruction having the relocation. */
+ insn_addr = input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset;
+
+ insn_page = m68hc11_phys_page (pinfo, insn_addr);
+
+ if (m68hc11_addr_is_banked (pinfo, relocation + rel->r_addend)
+ && m68hc11_addr_is_banked (pinfo, insn_addr)
+ && phys_page != insn_page)
+ {
+ const char* msg;
+ char* buf;
+
+ msg = _("banked address [%lx:%04lx] (%lx) is not in the same bank "
+ "as current banked address [%lx:%04lx] (%lx)");
+
+ buf = alloca (strlen (msg) + 128);
+ sprintf (buf, msg, phys_page, phys_addr,
+ (long) (relocation + rel->r_addend),
+ insn_page, m68hc11_phys_addr (pinfo, insn_addr),
+ (long) (insn_addr));
+ if (!((*info->callbacks->warning)
+ (info, buf, name, input_bfd, input_section,
+ rel->r_offset)))
+ return FALSE;
+ break;
+ }
+ if (phys_page != 0 && insn_page == 0)
+ {
+ const char* msg;
+ char* buf;
+
+ msg = _("reference to a banked address [%lx:%04lx] in the "
+ "normal address space at %04lx");
+
+ buf = alloca (strlen (msg) + 128);
+ sprintf (buf, msg, phys_page, phys_addr, insn_addr);
+ if (!((*info->callbacks->warning)
+ (info, buf, name, input_bfd, input_section,
+ insn_addr)))
+ return FALSE;
+
+ relocation = phys_addr;
+ break;
+ }
+
+ /* If this is a banked address use the phys_addr so that
+ we stay in the banked window. */
+ if (m68hc11_addr_is_banked (pinfo, relocation + rel->r_addend))
+ relocation = phys_addr;
+ break;
+ }
+ if (r_type != R_M68HC11_NONE)
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset,
+ relocation, rel->r_addend);
+
+ if (r != bfd_reloc_ok)
+ {
+ const char * msg = (const char *) 0;
+
+ switch (r)
+ {
+ case bfd_reloc_overflow:
+ if (!((*info->callbacks->reloc_overflow)
+ (info, name, howto->name, (bfd_vma) 0,
+ input_bfd, input_section, rel->r_offset)))
+ return FALSE;
+ break;
+
+ case bfd_reloc_undefined:
+ if (!((*info->callbacks->undefined_symbol)
+ (info, name, input_bfd, input_section,
+ rel->r_offset, TRUE)))
+ return FALSE;
+ break;
+
+ case bfd_reloc_outofrange:
+ msg = _ ("internal error: out of range error");
+ goto common_error;
+
+ case bfd_reloc_notsupported:
+ msg = _ ("internal error: unsupported relocation error");
+ goto common_error;
+
+ case bfd_reloc_dangerous:
+ msg = _ ("internal error: dangerous error");
+ goto common_error;
+
+ default:
+ msg = _ ("internal error: unknown error");
+ /* fall through */
+
+ common_error:
+ if (!((*info->callbacks->warning)
+ (info, msg, name, input_bfd, input_section,
+ rel->r_offset)))
+ return FALSE;
+ break;
+ }
+ }
+ }
+
+ return TRUE;
+}
+
+
+
+/* Set and control ELF flags in ELF header. */
+
+bfd_boolean
+_bfd_m68hc11_elf_set_private_flags (abfd, flags)
+ bfd *abfd;
+ flagword flags;
+{
+ BFD_ASSERT (!elf_flags_init (abfd)
+ || elf_elfheader (abfd)->e_flags == flags);
+
+ elf_elfheader (abfd)->e_flags = flags;
+ elf_flags_init (abfd) = TRUE;
+ return TRUE;
+}
+
+/* Merge backend specific data from an object file to the output
+ object file when linking. */
+
+bfd_boolean
+_bfd_m68hc11_elf_merge_private_bfd_data (ibfd, obfd)
+ bfd *ibfd;
+ bfd *obfd;
+{
+ flagword old_flags;
+ flagword new_flags;
+ bfd_boolean ok = TRUE;
+
+ /* Check if we have the same endianess */
+ if (!_bfd_generic_verify_endian_match (ibfd, obfd))
+ return FALSE;
+
+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return TRUE;
+
+ new_flags = elf_elfheader (ibfd)->e_flags;
+ elf_elfheader (obfd)->e_flags |= new_flags & EF_M68HC11_ABI;
+ old_flags = elf_elfheader (obfd)->e_flags;
+
+ if (! elf_flags_init (obfd))
+ {
+ elf_flags_init (obfd) = TRUE;
+ elf_elfheader (obfd)->e_flags = new_flags;
+ elf_elfheader (obfd)->e_ident[EI_CLASS]
+ = elf_elfheader (ibfd)->e_ident[EI_CLASS];
+
+ if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
+ && bfd_get_arch_info (obfd)->the_default)
+ {
+ if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd),
+ bfd_get_mach (ibfd)))
+ return FALSE;
+ }
+
+ return TRUE;
+ }
+
+ /* Check ABI compatibility. */
+ if ((new_flags & E_M68HC11_I32) != (old_flags & E_M68HC11_I32))
+ {
+ (*_bfd_error_handler)
+ (_("%s: linking files compiled for 16-bit integers (-mshort) "
+ "and others for 32-bit integers"),
+ bfd_archive_filename (ibfd));
+ ok = FALSE;
+ }
+ if ((new_flags & E_M68HC11_F64) != (old_flags & E_M68HC11_F64))
+ {
+ (*_bfd_error_handler)
+ (_("%s: linking files compiled for 32-bit double (-fshort-double) "
+ "and others for 64-bit double"),
+ bfd_archive_filename (ibfd));
+ ok = FALSE;
+ }
+ new_flags &= ~EF_M68HC11_ABI;
+ old_flags &= ~EF_M68HC11_ABI;
+
+ /* Warn about any other mismatches */
+ if (new_flags != old_flags)
+ {
+ (*_bfd_error_handler)
+ (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
+ bfd_archive_filename (ibfd), (unsigned long) new_flags,
+ (unsigned long) old_flags);
+ ok = FALSE;
+ }
+
+ if (! ok)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+bfd_boolean
+_bfd_m68hc11_elf_print_private_bfd_data (abfd, ptr)
+ bfd *abfd;
+ PTR ptr;
+{
+ FILE *file = (FILE *) ptr;
+
+ BFD_ASSERT (abfd != NULL && ptr != NULL);
+
+ /* Print normal ELF private data. */
+ _bfd_elf_print_private_bfd_data (abfd, ptr);
+
+ /* xgettext:c-format */
+ fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
+
+ if (elf_elfheader (abfd)->e_flags & E_M68HC11_I32)
+ fprintf (file, _("[abi=32-bit int, "));
+ else
+ fprintf (file, _("[abi=16-bit int, "));
+
+ if (elf_elfheader (abfd)->e_flags & E_M68HC11_F64)
+ fprintf (file, _("64-bit double, "));
+ else
+ fprintf (file, _("32-bit double, "));
+
+ if (strcmp (bfd_get_target (abfd), "elf32-m68hc11") == 0)
+ fprintf (file, _("cpu=HC11]"));
+ else if (elf_elfheader (abfd)->e_flags & EF_M68HCS12_MACH)
+ fprintf (file, _("cpu=HCS12]"));
+ else
+ fprintf (file, _("cpu=HC12]"));
+
+ if (elf_elfheader (abfd)->e_flags & E_M68HC12_BANKS)
+ fprintf (file, _(" [memory=bank-model]"));
+ else
+ fprintf (file, _(" [memory=flat]"));
+
+ fputc ('\n', file);
+
+ return TRUE;
+}
+
+static void scan_sections_for_abi (abfd, asect, arg)
+ bfd* abfd ATTRIBUTE_UNUSED;
+ asection* asect;
+ PTR arg;
+{
+ struct m68hc11_scan_param* p = (struct m68hc11_scan_param*) arg;
+
+ if (asect->vma >= p->pinfo->bank_virtual)
+ p->use_memory_banks = TRUE;
+}
+
+/* Tweak the OSABI field of the elf header. */
+
+void
+elf32_m68hc11_post_process_headers (abfd, link_info)
+ bfd *abfd;
+ struct bfd_link_info *link_info;
+{
+ struct m68hc11_scan_param param;
+
+ if (link_info == 0)
+ return;
+
+ m68hc11_elf_get_bank_parameters (link_info);
+
+ param.use_memory_banks = FALSE;
+ param.pinfo = &m68hc11_elf_hash_table (link_info)->pinfo;
+ bfd_map_over_sections (abfd, scan_sections_for_abi, &param);
+ if (param.use_memory_banks)
+ {
+ Elf_Internal_Ehdr * i_ehdrp;
+
+ i_ehdrp = elf_elfheader (abfd);
+ i_ehdrp->e_flags |= E_M68HC12_BANKS;
+ }
+}
+
diff --git a/bfd/elf32-m68hc1x.h b/bfd/elf32-m68hc1x.h
new file mode 100644
index 00000000000..e70c172c37d
--- /dev/null
+++ b/bfd/elf32-m68hc1x.h
@@ -0,0 +1,205 @@
+/* Motorola 68HC11/68HC12-specific support for 32-bit ELF
+ Copyright 2003 Free Software Foundation, Inc.
+ Contributed by Stephane Carrez (stcarrez@nerim.fr)
+
+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 _ELF32_M68HC1X_H
+#define _ELF32_M68HC1X_H
+
+#include "elf-bfd.h"
+#include "bfdlink.h"
+#include "elf/m68hc11.h"
+
+/* Name of symbols exported by HC11/HC12 linker when there is a memory
+ bank window. */
+#define BFD_M68HC11_BANK_START_NAME "__bank_start"
+#define BFD_M68HC11_BANK_SIZE_NAME "__bank_size"
+#define BFD_M68HC11_BANK_VIRTUAL_NAME "__bank_virtual"
+
+/* Set and control ELF flags in ELF header. */
+extern bfd_boolean _bfd_m68hc11_elf_merge_private_bfd_data PARAMS ((bfd*,bfd*));
+extern bfd_boolean _bfd_m68hc11_elf_set_private_flags PARAMS ((bfd*,flagword));
+extern bfd_boolean _bfd_m68hc11_elf_print_private_bfd_data PARAMS ((bfd*,PTR));
+
+/* This hash entry is used to record a trampoline that must be generated
+ to call a far function using a normal calling convention ('jsr').
+ The trampoline is used when a pointer to a far function is used.
+ It takes care of installing the proper memory bank as well as creating
+ the 'call/rtc' calling convention. */
+struct elf32_m68hc11_stub_hash_entry {
+
+ /* Base hash table entry structure. */
+ struct bfd_hash_entry root;
+
+ /* The stub section. */
+ asection *stub_sec;
+
+ /* Offset within stub_sec of the beginning of this stub. */
+ bfd_vma stub_offset;
+
+ /* Given the symbol's value and its section we can determine its final
+ value when building the stubs (so the stub knows where to jump. */
+ bfd_vma target_value;
+ asection *target_section;
+};
+
+/* Placeholder for the parameters to compute memory page and physical address.
+ The following formulas are used:
+
+ sym > bank_virtual =>
+ %addr(sym) = (((sym - bank_virtual) & bank_mask) + bank_physical
+ %page(sym) = (((sym - bank_virtual) >> bank_shift) % 256
+
+ sym < bank_virtual =>
+ %addr(sym) = sym
+ %page(sym) = 0
+
+
+ These parameters are obtained from the symbol table by looking
+ at the following:
+
+ __bank_start Symbol marking the start of memory bank window
+ (bank_physical)
+ __bank_virtual Logical address of symbols for which the transformation
+ must be computed
+ __bank_page_size Size in bytes of page size (this is *NOT* the memory
+ bank window size and the window size is always
+ less or equal to the page size)
+
+ For 68HC12, the window is at 0x8000 and the page size is 16K (full window).
+ For 68HC11 this is board specific (implemented by external hardware).
+
+*/
+struct m68hc11_page_info
+{
+ bfd_vma bank_virtual;
+ bfd_vma bank_physical;
+ bfd_vma bank_physical_end;
+ bfd_vma bank_mask;
+ bfd_vma bank_size;
+ int bank_shift;
+ int bank_param_initialized;
+ bfd_vma trampoline_addr;
+};
+
+struct m68hc11_elf_link_hash_table
+{
+ struct elf_link_hash_table root;
+ struct m68hc11_page_info pinfo;
+
+ /* The stub hash table. */
+ struct bfd_hash_table* stub_hash_table;
+
+ /* Linker stub bfd. */
+ bfd *stub_bfd;
+
+ asection* stub_section;
+ asection* tramp_section;
+
+ /* Linker call-backs. */
+ asection * (*add_stub_section) PARAMS ((const char *, asection *));
+
+ /* Assorted information used by elf32_hppa_size_stubs. */
+ unsigned int bfd_count;
+ int top_index;
+ asection **input_list;
+ Elf_Internal_Sym **all_local_syms;
+
+ /* Small local sym to section mapping cache. */
+ struct sym_sec_cache sym_sec;
+
+ bfd_boolean (* size_one_stub) PARAMS((struct bfd_hash_entry*, PTR));
+ bfd_boolean (* build_one_stub) PARAMS((struct bfd_hash_entry*, PTR));
+};
+
+/* Get the Sparc64 ELF linker hash table from a link_info structure. */
+
+#define m68hc11_elf_hash_table(p) \
+ ((struct m68hc11_elf_link_hash_table *) ((p)->hash))
+
+/* Create a 68HC11/68HC12 ELF linker hash table. */
+
+extern struct m68hc11_elf_link_hash_table* m68hc11_elf_hash_table_create
+ PARAMS ((bfd*));
+extern void m68hc11_elf_bfd_link_hash_table_free
+ PARAMS ((struct bfd_link_hash_table*));
+
+extern void m68hc11_elf_get_bank_parameters
+ PARAMS ((struct bfd_link_info*));
+
+/* Return 1 if the address is in banked memory.
+ This can be applied to a virtual address and to a physical address. */
+extern int m68hc11_addr_is_banked
+ PARAMS ((struct m68hc11_page_info*, bfd_vma));
+
+/* Return the physical address seen by the processor, taking
+ into account banked memory. */
+extern bfd_vma m68hc11_phys_addr
+ PARAMS ((struct m68hc11_page_info*, bfd_vma));
+
+/* Return the page number corresponding to an address in banked memory. */
+extern bfd_vma m68hc11_phys_page
+ PARAMS ((struct m68hc11_page_info*, bfd_vma));
+
+bfd_reloc_status_type m68hc11_elf_ignore_reloc
+ PARAMS ((bfd *abfd, arelent *reloc_entry,
+ asymbol *symbol, PTR data, asection *input_section,
+ bfd *output_bfd, char **error_message));
+bfd_reloc_status_type m68hc11_elf_special_reloc
+ PARAMS ((bfd *abfd, arelent *reloc_entry,
+ asymbol *symbol, PTR data, asection *input_section,
+ bfd *output_bfd, char **error_message));
+
+/* GC mark and sweep. */
+asection *elf32_m68hc11_gc_mark_hook
+ PARAMS ((asection *sec, struct bfd_link_info *info,
+ Elf_Internal_Rela *rel, struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym));
+bfd_boolean elf32_m68hc11_gc_sweep_hook
+ PARAMS ((bfd *abfd, struct bfd_link_info *info,
+ asection *sec, const Elf_Internal_Rela *relocs));
+bfd_boolean elf32_m68hc11_check_relocs
+ PARAMS ((bfd * abfd, struct bfd_link_info * info,
+ asection * sec, const Elf_Internal_Rela * relocs));
+bfd_boolean elf32_m68hc11_relocate_section
+ PARAMS ((bfd *output_bfd, struct bfd_link_info *info,
+ bfd *input_bfd, asection *input_section,
+ bfd_byte *contents, Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms, asection **local_sections));
+
+bfd_boolean elf32_m68hc11_add_symbol_hook
+ PARAMS ((bfd *abfd, struct bfd_link_info *info,
+ const Elf_Internal_Sym *sym, const char **namep,
+ flagword *flagsp, asection **secp,
+ bfd_vma *valp));
+
+/* Tweak the OSABI field of the elf header. */
+
+extern void elf32_m68hc11_post_process_headers
+ PARAMS ((bfd*, struct bfd_link_info*));
+
+int elf32_m68hc11_setup_section_lists
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+bfd_boolean elf32_m68hc11_size_stubs
+ PARAMS ((bfd *, bfd *, struct bfd_link_info *,
+ asection * (*) PARAMS ((const char *, asection *))));
+
+bfd_boolean elf32_m68hc11_build_stubs
+ PARAMS ((bfd* abfd, struct bfd_link_info *));
+#endif
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index abb0eece334..e314ebb4b94 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -2188,7 +2188,7 @@ bfd_m68k_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(abfd, datasec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
info->keep_memory));
if (internal_relocs == NULL)
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index adf057b40d2..85819d55d3d 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -1716,7 +1716,7 @@ bfd_mips_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
}
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(abfd, datasec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
info->keep_memory));
if (internal_relocs == NULL)
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 186f39d82b6..64c2839f421 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -16,8 +16,9 @@
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. */
+ along with this program; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
/* This file is based on a preliminary PowerPC ELF ABI. The
information may not match the final PowerPC ELF ABI. It includes
@@ -152,7 +153,7 @@ static bfd_boolean ppc_elf_grok_psinfo
function symbols not defined in an app are set to their .plt entry,
it's necessary for shared libs to also reference the .plt even
though the symbol is really local to the shared lib. */
-#define SYMBOL_REFERENCES_LOCAL(INFO, H) \
+#define SYMBOL_REFERENCES_LOCAL(INFO, H) \
((! INFO->shared \
|| INFO->symbolic \
|| H->dynindx == -1 \
@@ -161,7 +162,7 @@ static bfd_boolean ppc_elf_grok_psinfo
&& (H->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
/* Will _calls_ to this symbol always call the version in this object? */
-#define SYMBOL_CALLS_LOCAL(INFO, H) \
+#define SYMBOL_CALLS_LOCAL(INFO, H) \
((! INFO->shared \
|| INFO->symbolic \
|| H->dynindx == -1 \
@@ -198,7 +199,7 @@ struct ppc_elf_link_hash_entry
struct ppc_elf_dyn_relocs *dyn_relocs;
/* Contexts in which symbol is used in the GOT (or TOC).
- TLS_GD .. TLS_EXPLICIT bits are or'd into the mask as the
+ TLS_GD .. TLS_TLS bits are or'd into the mask as the
corresponding relocs are encountered during check_relocs.
tls_optimize clears TLS_GD .. TLS_TPREL when optimizing to
indicate the corresponding GOT entry type is not needed. */
@@ -319,6 +320,12 @@ ppc_elf_link_hash_table_create (abfd)
return &ret->elf.root;
}
+/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
+ copying dynamic variables from a shared lib into an app's dynbss
+ section, and instead use a dynamic relocation to point into the
+ shared lib. */
+#define ELIMINATE_COPY_RELOCS 1
+
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
@@ -367,7 +374,18 @@ ppc_elf_copy_indirect_symbol (bed, dir, ind)
edir->tls_mask |= eind->tls_mask;
- _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
+ if (ELIMINATE_COPY_RELOCS
+ && ind->root.type != bfd_link_hash_indirect
+ && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+ /* If called to transfer flags for a weakdef during processing
+ of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
+ We clear it ourselves for ELIMINATE_COPY_RELOCS. */
+ dir->elf_link_hash_flags |=
+ (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
+ | ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK));
+ else
+ _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
}
static reloc_howto_type *ppc_elf_howto_table[(int) R_PPC_max];
@@ -1613,10 +1631,14 @@ ppc_elf_howto_init ()
{
unsigned int i, type;
- for (i = 0; i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]); i++)
+ for (i = 0;
+ i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]);
+ i++)
{
type = ppc_elf_howto_raw[i].type;
- BFD_ASSERT (type < sizeof (ppc_elf_howto_table) / sizeof (ppc_elf_howto_table[0]));
+ if (type >= (sizeof (ppc_elf_howto_table)
+ / sizeof (ppc_elf_howto_table[0])))
+ abort ();
ppc_elf_howto_table[type] = &ppc_elf_howto_raw[i];
}
}
@@ -1630,7 +1652,8 @@ ppc_elf_howto_init ()
2/ The branch is predicted as not taken.
3/ The branch is taken.
4/ The branch is located in the last 5 words of a page.
- (The EOP limit is 5 by default but may be specified as any value from 1-10.)
+ (The EOP limit is 5 by default but may be specified as any value
+ from 1-10.)
Our software solution is to detect these problematic branches in a
linker pass and modify them as follows:
@@ -1712,9 +1735,9 @@ ppc_elf_relax_section (abfd, isec, link_info, again)
/* Get a copy of the native relocations. */
internal_relocs
- = _bfd_elf32_link_read_relocs (abfd, isec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- link_info->keep_memory);
+ = _bfd_elf_link_read_relocs (abfd, isec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ link_info->keep_memory);
if (internal_relocs == NULL)
goto error_return;
if (! link_info->keep_memory)
@@ -2455,12 +2478,6 @@ ppc_elf_create_dynamic_sections (abfd, info)
return bfd_set_section_flags (abfd, s, flags);
}
-/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
- copying dynamic variables from a shared lib into an app's dynbss
- section, and instead use a dynamic relocation to point into the
- shared lib. */
-#define ELIMINATE_COPY_RELOCS 1
-
/* Adjust a symbol defined by a dynamic object and referenced by a
regular object. The current definition is in some section of the
dynamic object, but we're not including those sections. We have to
@@ -2500,7 +2517,7 @@ ppc_elf_adjust_dynamic_symbol (info, h)
/* Clear procedure linkage table information for any symbol that
won't need a .plt entry. */
if (! htab->elf.dynamic_sections_created
- || SYMBOL_CALLS_LOCAL (info, h)
+ || SYMBOL_CALLS_LOCAL (info, h)
|| h->plt.refcount <= 0)
{
/* A PLT entry is not required/allowed when:
@@ -2677,7 +2694,9 @@ allocate_dynrelocs (h, inf)
htab = ppc_elf_hash_table (info);
if (htab->elf.dynamic_sections_created
- && h->plt.refcount > 0)
+ && h->plt.refcount > 0
+ && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
{
/* Make sure this symbol is output as a dynamic symbol. */
if (h->dynindx == -1
@@ -2772,8 +2791,10 @@ allocate_dynrelocs (h, inf)
else
htab->got->_raw_size += 4;
dyn = htab->elf.dynamic_sections_created;
- if (info->shared
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, &eh->elf))
+ if ((info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, &eh->elf))
+ && (ELF_ST_VISIBILITY (eh->elf.other) == STV_DEFAULT
+ || eh->elf.root.type != bfd_link_hash_undefweak))
{
/* All the entries we allocated need relocs. */
htab->relgot->_raw_size
@@ -2814,6 +2835,12 @@ allocate_dynrelocs (h, inf)
pp = &p->next;
}
}
+
+ /* Also discard relocs on undefined weak syms with non-default
+ visibility. */
+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ && h->root.type == bfd_link_hash_undefweak)
+ eh->dyn_relocs = NULL;
}
else if (ELIMINATE_COPY_RELOCS)
{
@@ -3833,9 +3860,9 @@ ppc_elf_tls_optimize (obfd, info)
int expecting_tls_get_addr;
/* Read the relocations. */
- relstart = _bfd_elf32_link_read_relocs (ibfd, sec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ relstart = _bfd_elf_link_read_relocs (ibfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (relstart == NULL)
return FALSE;
@@ -4776,7 +4803,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
/* Generate relocs for the dynamic linker. */
- if (info->shared || indx != 0)
+ if ((info->shared || indx != 0)
+ && (h == NULL
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
{
outrel.r_offset = (htab->got->output_section->vma
+ htab->got->output_offset
@@ -4978,6 +5008,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
/* Fall thru. */
if ((info->shared
+ && (h == NULL
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
&& (MUST_BE_DYN_RELOC (r_type)
|| (h != NULL
&& h->dynindx != -1
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 857b7a068b3..9475f60a669 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -383,6 +383,12 @@ elf_s390_is_local_label_name (abfd, name)
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
+/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
+ copying dynamic variables from a shared lib into an app's dynbss
+ section, and instead use a dynamic relocation to point into the
+ shared lib. */
+#define ELIMINATE_COPY_RELOCS 1
+
/* The size in bytes of the first entry in the procedure linkage table. */
#define PLT_FIRST_ENTRY_SIZE 32
/* The size in bytes of an entry in the procedure linkage table. */
@@ -828,7 +834,18 @@ elf_s390_copy_indirect_symbol (bed, dir, ind)
eind->tls_type = GOT_UNKNOWN;
}
- _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
+ if (ELIMINATE_COPY_RELOCS
+ && ind->root.type != bfd_link_hash_indirect
+ && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+ /* If called to transfer flags for a weakdef during processing
+ of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
+ We clear it ourselves for ELIMINATE_COPY_RELOCS. */
+ dir->elf_link_hash_flags |=
+ (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
+ | ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK));
+ else
+ _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
}
static int
@@ -1149,7 +1166,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
|| h->root.type == bfd_link_hash_defweak
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (!info->shared
+ || (ELIMINATE_COPY_RELOCS
+ && !info->shared
&& (sec->flags & SEC_ALLOC) != 0
&& h != NULL
&& (h->root.type == bfd_link_hash_defweak
@@ -1480,8 +1498,6 @@ elf_s390_adjust_dynamic_symbol (info, h)
struct elf_link_hash_entry *h;
{
struct elf_s390_link_hash_table *htab;
- struct elf_s390_link_hash_entry * eh;
- struct elf_s390_dyn_relocs *p;
asection *s;
unsigned int power_of_two;
@@ -1527,6 +1543,10 @@ elf_s390_adjust_dynamic_symbol (info, h)
|| h->weakdef->root.type == bfd_link_hash_defweak);
h->root.u.def.section = h->weakdef->root.u.def.section;
h->root.u.def.value = h->weakdef->root.u.def.value;
+ if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
+ h->elf_link_hash_flags
+ = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+ | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
return TRUE;
}
@@ -1552,20 +1572,26 @@ elf_s390_adjust_dynamic_symbol (info, h)
return TRUE;
}
- eh = (struct elf_s390_link_hash_entry *) h;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ if (ELIMINATE_COPY_RELOCS)
{
- s = p->sec->output_section;
- if (s != NULL && (s->flags & SEC_READONLY) != 0)
- break;
- }
+ struct elf_s390_link_hash_entry * eh;
+ struct elf_s390_dyn_relocs *p;
- /* If we didn't find any dynamic relocs in read-only sections, then
- we'll be keeping the dynamic relocs and avoiding the copy reloc. */
- if (p == NULL)
- {
- h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
- return TRUE;
+ eh = (struct elf_s390_link_hash_entry *) h;
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ {
+ s = p->sec->output_section;
+ if (s != NULL && (s->flags & SEC_READONLY) != 0)
+ break;
+ }
+
+ /* If we didn't find any dynamic relocs in read-only sections, then
+ we'll be keeping the dynamic relocs and avoiding the copy reloc. */
+ if (p == NULL)
+ {
+ h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
+ return TRUE;
+ }
}
/* We must allocate the symbol in our .dynbss section, which will
@@ -1618,9 +1644,9 @@ elf_s390_adjust_dynamic_symbol (info, h)
will be called from elflink.h. If elflink.h doesn't call our
finish_dynamic_symbol routine, we'll need to do something about
initializing any .plt and .got entries in elf_s390_relocate_section. */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \
+#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
((DYN) \
- && ((INFO)->shared \
+ && ((SHARED) \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \
&& ((H)->dynindx != -1 \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
@@ -1651,7 +1677,9 @@ allocate_dynrelocs (h, inf)
htab = elf_s390_hash_table (info);
if (htab->elf.dynamic_sections_created
- && h->plt.refcount > 0)
+ && h->plt.refcount > 0
+ && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
{
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
@@ -1662,7 +1690,8 @@ allocate_dynrelocs (h, inf)
return FALSE;
}
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
+ if (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h))
{
asection *s = htab->splt;
@@ -1758,7 +1787,10 @@ allocate_dynrelocs (h, inf)
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))
+ else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
+ && (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
}
else
@@ -1792,8 +1824,14 @@ allocate_dynrelocs (h, inf)
pp = &p->next;
}
}
+
+ /* Also discard relocs on undefined weak syms with non-default
+ visibility. */
+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ && h->root.type == bfd_link_hash_undefweak)
+ eh->dyn_relocs = NULL;
}
- else
+ else if (ELIMINATE_COPY_RELOCS)
{
/* For the non-shared case, discard space for relocs against
symbols which turn out to need copy relocs or are not
@@ -2301,12 +2339,14 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
off = h->got.offset;
dyn = htab->elf.dynamic_sections_created;
- if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
|| (info->shared
&& (info->symbolic
|| h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+ || (ELF_ST_VISIBILITY (h->other)
+ && h->root.type == bfd_link_hash_undefweak))
{
/* This is actually a static link, or it is a
-Bsymbolic link and the symbol is defined
@@ -2471,6 +2511,9 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
break;
if ((info->shared
+ && (h == NULL
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
&& ((r_type != R_390_PC16
&& r_type != R_390_PC16DBL
&& r_type != R_390_PC32DBL
@@ -2480,7 +2523,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
&& (! info->symbolic
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (!info->shared
+ || (ELIMINATE_COPY_RELOCS
+ && !info->shared
&& h != NULL
&& h->dynindx != -1
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 8eb9a49469c..8041f5e4c02 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -1,4 +1,4 @@
-/* Renesas SH specific support for 32-bit ELF
+/* Renesas / SuperH SH specific support for 32-bit ELF
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Contributed by Ian Lance Taylor, Cygnus Support.
@@ -90,6 +90,8 @@ static bfd_boolean sh_elf_create_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
static bfd_vma dtpoff_base
PARAMS ((struct bfd_link_info *));
+static bfd_vma tpoff
+ PARAMS ((struct bfd_link_info *, bfd_vma));
static asection * sh_elf_gc_mark_hook
PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
struct elf_link_hash_entry *, Elf_Internal_Sym *));
@@ -2052,7 +2054,7 @@ sh_elf_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -2734,7 +2736,7 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count)
/* We always cache the relocs. Perhaps, if info->keep_memory is
FALSE, we should free them, if we are permitted to, when we
leave sh_coff_relax_section. */
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(abfd, o, (PTR) NULL, (Elf_Internal_Rela *) NULL,
TRUE));
if (internal_relocs == NULL)
@@ -3525,9 +3527,6 @@ struct elf_sh_dyn_relocs
/* Number of pc-relative relocs copied for the input section. */
bfd_size_type pc_count;
-
- /* If TRUE, R_SH_TLS_TPOFF32 relocation is generated. */
- bfd_boolean tls_tpoff32;
};
/* sh ELF linker hash entry. */
@@ -4039,9 +4038,9 @@ sh_elf_adjust_dynamic_symbol (info, h)
will be called from elflink.h. If elflink.h doesn't call our
finish_dynamic_symbol routine, we'll need to do something about
initializing any .plt and .got entries in sh_elf_relocate_section. */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \
+#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
((DYN) \
- && ((INFO)->shared \
+ && ((SHARED) \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \
&& ((H)->dynindx != -1 \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
@@ -4095,7 +4094,8 @@ allocate_dynrelocs (h, inf)
return FALSE;
}
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
+ if (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h))
{
asection *s = htab->splt;
@@ -4162,14 +4162,15 @@ allocate_dynrelocs (h, inf)
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_IE_32 needs one dynamic relocation if dynamic,
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)
+ || (tls_type == GOT_TLS_IE && dyn))
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))
+ else if (info->shared ||
+ WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
}
else
@@ -4194,7 +4195,7 @@ allocate_dynrelocs (h, inf)
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))
+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h))
htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
}
else
@@ -4231,10 +4232,6 @@ allocate_dynrelocs (h, inf)
}
else
{
- for (p = eh->dyn_relocs; p; p = p->next)
- if (p->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. */
@@ -4752,7 +4749,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|| r_type == R_SH_GOT_MEDLOW16
|| r_type == R_SH_GOT_MEDHI16
|| r_type == R_SH_GOT_HI16)
- && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
&& (! info->shared
|| (! info->symbolic && h->dynindx != -1)
|| (h->elf_link_hash_flags
@@ -5052,7 +5049,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
BFD_ASSERT (off != (bfd_vma) -1);
dyn = htab->root.dynamic_sections_created;
- if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
|| (info->shared
&& (info->symbolic || h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
@@ -5280,17 +5277,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (! info->shared
&& (h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
- {
- struct elf_sh_dyn_relocs *p;
-
- /* If TPOFF32 relocation can be created, convert it. */
- for (p = sh_elf_hash_entry (h)->dyn_relocs; p; p = p->next)
- if (p->sec == input_section && p->tls_tpoff32)
- {
- r_type = R_SH_TLS_LE_32;
- break;
- }
- }
+ r_type = R_SH_TLS_LE_32;
}
if (r_type == R_SH_TLS_GD_32 && tls_type == GOT_TLS_IE)
@@ -5300,9 +5287,6 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{
bfd_vma offset;
unsigned short insn;
- int indx;
- Elf_Internal_Rela outrel;
- bfd_byte *loc;
if (ELF32_R_TYPE (rel->r_info) == R_SH_TLS_GD_32)
{
@@ -5379,45 +5363,8 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
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);
- }
-
- if (h == NULL
- || h->dynindx == -1
- || (! info->shared
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
- indx = 0;
- else
- indx = h->dynindx;
- 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;
-
- loc = sreloc->contents;
- loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
- bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ bfd_put_32 (output_bfd, tpoff (info, relocation),
+ contents + rel->r_offset);
continue;
}
@@ -5435,6 +5382,18 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
off = local_got_offsets[r_symndx];
}
+ /* Relocate R_SH_TLS_IE_32 directly when statically linking. */
+ if (r_type == R_SH_TLS_IE_32
+ && ! htab->root.dynamic_sections_created)
+ {
+ off &= ~1;
+ bfd_put_32 (output_bfd, tpoff (info, relocation),
+ sgot->contents + off);
+ bfd_put_32 (output_bfd, sgot->output_offset + off,
+ contents + rel->r_offset);
+ continue;
+ }
+
if ((off & 1) != 0)
off &= ~1;
else
@@ -5452,13 +5411,11 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
outrel.r_offset = (sgot->output_section->vma
+ sgot->output_offset + off);
- if (h == NULL
- || h->dynindx == -1
- || (! info->shared
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ if (h == NULL || h->dynindx == -1)
indx = 0;
else
indx = h->dynindx;
+
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)
@@ -5640,46 +5597,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
case R_SH_TLS_LDO_32:
if (! info->shared)
- {
- int indx;
- Elf_Internal_Rela outrel;
- bfd_byte *loc;
-
- 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;
-
- loc = sreloc->contents;
- loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
- bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
- continue;
- }
+ relocation = tpoff (info, relocation);
else
relocation -= dtpoff_base (info);
@@ -5692,6 +5610,13 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
Elf_Internal_Rela outrel;
bfd_byte *loc;
+ if (! info->shared)
+ {
+ relocation = tpoff (info, relocation);
+ addend = rel->r_addend;
+ goto final_link_relocate;
+ }
+
if (sreloc == NULL)
{
const char *name;
@@ -5712,7 +5637,11 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
BFD_ASSERT (sreloc != NULL);
}
- indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+ if (h == NULL || h->dynindx == -1)
+ indx = 0;
+ else
+ indx = h->dynindx;
+
outrel.r_offset = (input_section->output_section->vma
+ input_section->output_offset
+ rel->r_offset);
@@ -5806,7 +5735,7 @@ sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
Elf_Internal_Sym *isym, *isymend;
bfd_size_type amt;
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(input_bfd, input_section, (PTR) NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
@@ -5882,12 +5811,27 @@ 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;
+ /* 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;
}
+/* Return the relocation value for R_SH_TLS_TPOFF32.. */
+
+static bfd_vma
+tpoff (info, address)
+ struct bfd_link_info *info;
+ bfd_vma address;
+{
+ /* If tls_segment is NULL, we should have signalled an error already. */
+ if (elf_hash_table (info)->tls_segment == NULL)
+ return 0;
+ /* SH TLS ABI is variant I and static TLS block start just after tcbhead
+ structure which has 2 pointer fields. */
+ return (address - dtpoff_base (info) + 8);
+}
+
static asection *
sh_elf_gc_mark_hook (sec, info, rel, h, sym)
asection *sec;
@@ -6349,12 +6293,12 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
return FALSE;
break;
- force_got:
case R_SH_TLS_IE_32:
if (info->shared)
info->flags |= DF_STATIC_TLS;
/* FALLTHROUGH */
+ force_got:
case R_SH_TLS_GD_32:
case R_SH_GOT32:
#ifdef INCLUDE_SHMEDIA
@@ -6633,7 +6577,6 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
p->sec = sec;
p->count = 0;
p->pc_count = 0;
- p->tls_tpoff32 = FALSE;
}
p->count += 1;
@@ -6651,92 +6594,10 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
return FALSE;
}
- if (ELF32_R_TYPE (rel->r_info) == R_SH_TLS_LD_32)
- break;
+ 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->tls_tpoff32 = FALSE;
- }
-
- p->count += 1;
- p->tls_tpoff32 = TRUE;
- }
+ /* Nothing to do. */
break;
default:
diff --git a/bfd/elf32-sh64-com.c b/bfd/elf32-sh64-com.c
index f14a04279de..b7ae36489fb 100644
--- a/bfd/elf32-sh64-com.c
+++ b/bfd/elf32-sh64-com.c
@@ -1,4 +1,4 @@
-/* Renesas SH64-specific support for 32-bit ELF
+/* SuperH SH64-specific support for 32-bit ELF
Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c
index dc21b547474..1a2acc1c7c8 100644
--- a/bfd/elf32-sh64.c
+++ b/bfd/elf32-sh64.c
@@ -1,4 +1,4 @@
-/* Renesas SH64-specific support for 32-bit ELF
+/* SuperH SH64-specific support for 32-bit ELF
Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 26201f5e8ec..62bbbdacf21 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -1,5 +1,5 @@
/* V850-specific support for 32-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -2508,7 +2508,7 @@ v850_elf_relax_section (abfd, sec, link_info, again)
symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c
index 22ab8ef57cd..2964d343cb3 100644
--- a/bfd/elf32-xstormy16.c
+++ b/bfd/elf32-xstormy16.c
@@ -96,27 +96,27 @@ static reloc_howto_type xstormy16_elf_howto_table [] =
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_XSTORMY16_16", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
- 0xffffffff, /* dst_mask */
+ 0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* An 8 bit absolute relocation. */
- HOWTO (R_XSTORMY16_8, /* type */
+ HOWTO (R_XSTORMY16_8, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_unsigned, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_XSTORMY16_8", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
- 0xffffffff, /* dst_mask */
+ 0xff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A 32 bit pc-relative relocation. */
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index b991df4f792..b277540107c 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -3925,7 +3925,7 @@ retrieve_internal_relocs (abfd, sec, keep_memory)
internal_relocs = elf_section_data (sec)->relocs;
if (internal_relocs == NULL)
- internal_relocs = (_bfd_elf32_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
keep_memory));
return internal_relocs;
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index bf18e205c0d..9ce3bf3b56a 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -305,7 +305,9 @@ alpha_elf_dynamic_symbol_p (h, info)
if ((info->shared && !info->symbolic)
|| ((h->elf_link_hash_flags
- & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))
+ & (ELF_LINK_HASH_DEF_DYNAMIC
+ | ELF_LINK_HASH_DEF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR))
== (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)))
return TRUE;
@@ -1554,7 +1556,7 @@ elf64_alpha_relax_opt_call (info, symval)
}
else
{
- tsec_relocs = (_bfd_elf64_link_read_relocs
+ tsec_relocs = (_bfd_elf_link_read_relocs
(info->abfd, info->tsec, (PTR) NULL,
(Elf_Internal_Rela *) NULL,
info->link_info->keep_memory));
@@ -2070,7 +2072,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again)
local_got_entries = alpha_elf_tdata(abfd)->local_got_entries;
/* Load the relocations for this section. */
- internal_relocs = (_bfd_elf64_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -5554,7 +5556,7 @@ static const struct elf_size_info alpha_elf_size_info =
sizeof (Elf_External_Note),
8,
1,
- 64, 8,
+ 64, 3,
ELFCLASS64, EV_CURRENT,
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 4d3b8d40a7a..8ce5b20f3f7 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -606,7 +606,7 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
the special sections required for dynamic linking. */
if (! elf_hash_table (info)->dynamic_sections_created)
{
- if (! bfd_elf64_link_create_dynamic_sections (abfd, info))
+ if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
return FALSE;
}
@@ -2692,7 +2692,7 @@ const struct elf_size_info hppa64_elf_size_info =
sizeof (Elf_External_Note),
4,
1,
- 64, 8,
+ 64, 3,
ELFCLASS64, EV_CURRENT,
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index 39f21b3046d..6e7321cacc6 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -2782,7 +2782,7 @@ const struct elf_size_info mips_elf64_size_info =
4, /* hash-table entry size */
3, /* internal relocations per external relocations */
64, /* arch_size */
- 8, /* file_align */
+ 3, /* log_file_align */
ELFCLASS64,
EV_CURRENT,
bfd_elf64_write_out_phdrs,
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index bcf99626571..d0213e6a493 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -1854,9 +1854,9 @@ _bfd_mmix_check_all_relocs (abfd, info)
continue;
internal_relocs
- = _bfd_elf64_link_read_relocs (abfd, o, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (internal_relocs == NULL)
return FALSE;
@@ -2374,9 +2374,9 @@ mmix_elf_relax_section (abfd, sec, link_info, again)
/* Get a copy of the native relocations. */
internal_relocs
- = _bfd_elf64_link_read_relocs (abfd, sec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- link_info->keep_memory);
+ = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ link_info->keep_memory);
if (internal_relocs == NULL)
goto error_return;
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 29c90fe32e4..011e637b122 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -3272,6 +3272,7 @@ ppc64_elf_copy_indirect_symbol (bed, dir, ind)
struct elf_link_hash_entry *dir, *ind;
{
struct ppc_link_hash_entry *edir, *eind;
+ flagword mask;
edir = (struct ppc_link_hash_entry *) dir;
eind = (struct ppc_link_hash_entry *) ind;
@@ -3316,20 +3317,24 @@ ppc64_elf_copy_indirect_symbol (bed, dir, ind)
edir->is_entry |= eind->is_entry;
edir->tls_mask |= eind->tls_mask;
- /* Copy down any references that we may have already seen to the
- symbol which just became indirect. */
- edir->elf.elf_link_hash_flags |=
- (eind->elf.elf_link_hash_flags
- & (ELF_LINK_HASH_REF_DYNAMIC
- | ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_REF_REGULAR_NONWEAK
- | ELF_LINK_NON_GOT_REF));
+ mask = (ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK | ELF_LINK_NON_GOT_REF);
+ /* If called to transfer flags for a weakdef during processing
+ of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
+ We clear it ourselves for ELIMINATE_COPY_RELOCS. */
+ if (ELIMINATE_COPY_RELOCS
+ && eind->elf.root.type != bfd_link_hash_indirect
+ && (edir->elf.elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+ mask &= ~ELF_LINK_NON_GOT_REF;
+
+ edir->elf.elf_link_hash_flags |= eind->elf.elf_link_hash_flags & mask;
/* If we were called to copy over info for a weak sym, that's all. */
if (eind->elf.root.type != bfd_link_hash_indirect)
return;
- /* Copy over got entries. */
+ /* Copy over got entries that we may have already seen to the
+ symbol which just became indirect. */
if (eind->elf.got.glist != NULL)
{
if (edir->elf.got.glist != NULL)
@@ -3877,6 +3882,10 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs)
case R_PPC64_UADDR32:
case R_PPC64_UADDR64:
case R_PPC64_TOC:
+ if (h != NULL && !info->shared)
+ /* We may need a copy reloc. */
+ h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
+
/* Don't propagate .opd relocs. */
if (NO_OPD_RELOCS && opd_sym_map != NULL)
break;
@@ -4864,9 +4873,9 @@ ppc64_elf_edit_opd (obfd, info)
sym_hashes = elf_sym_hashes (ibfd);
/* Read the relocations. */
- relstart = _bfd_elf64_link_read_relocs (ibfd, sec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ relstart = _bfd_elf_link_read_relocs (ibfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (relstart == NULL)
return FALSE;
@@ -5187,9 +5196,9 @@ ppc64_elf_tls_optimize (obfd, info)
int expecting_tls_get_addr;
/* Read the relocations. */
- relstart = _bfd_elf64_link_read_relocs (ibfd, sec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ relstart = _bfd_elf_link_read_relocs (ibfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (relstart == NULL)
return FALSE;
@@ -5488,7 +5497,9 @@ allocate_dynrelocs (h, inf)
if (htab->elf.dynamic_sections_created
&& h->dynindx != -1
- && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h))
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h)
+ && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
{
struct plt_entry *pent;
bfd_boolean doneone = FALSE;
@@ -5588,8 +5599,10 @@ allocate_dynrelocs (h, inf)
s->_raw_size
+= (gent->tls_type & eh->tls_mask & (TLS_GD | TLS_LD)) ? 16 : 8;
dyn = htab->elf.dynamic_sections_created;
- if (info->shared
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
+ if ((info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
+ && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
htab->srelgot->_raw_size
+= (gent->tls_type & eh->tls_mask & TLS_GD
? 2 * sizeof (Elf64_External_Rela)
@@ -5625,6 +5638,12 @@ allocate_dynrelocs (h, inf)
pp = &p->next;
}
}
+
+ /* Also discard relocs on undefined weak syms with non-default
+ visibility. */
+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ && h->root.type == bfd_link_hash_undefweak)
+ eh->dyn_relocs = NULL;
}
else if (ELIMINATE_COPY_RELOCS)
{
@@ -6575,9 +6594,9 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size,
/* Get the relocs. */
internal_relocs
- = _bfd_elf64_link_read_relocs (input_bfd, section, NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ = _bfd_elf_link_read_relocs (input_bfd, section, NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (internal_relocs == NULL)
goto error_ret_free_local;
@@ -7631,7 +7650,10 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
the case of TLSLD where we'll use one entry per
module. */
*offp = off | 1;
- if (info->shared || indx != 0)
+ if ((info->shared || indx != 0)
+ && (h == NULL
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
{
outrel.r_offset = (htab->sgot->output_section->vma
+ htab->sgot->output_offset
@@ -7855,6 +7877,9 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
break;
if ((info->shared
+ && (h == NULL
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
&& (MUST_BE_DYN_RELOC (r_type)
|| (h != NULL
&& h->dynindx != -1
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index e3c7f22103a..98555f269bf 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -405,6 +405,12 @@ elf_s390_is_local_label_name (abfd, name)
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
+/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
+ copying dynamic variables from a shared lib into an app's dynbss
+ section, and instead use a dynamic relocation to point into the
+ shared lib. */
+#define ELIMINATE_COPY_RELOCS 1
+
/* The size in bytes of the first entry in the procedure linkage table. */
#define PLT_FIRST_ENTRY_SIZE 32
/* The size in bytes of an entry in the procedure linkage table. */
@@ -782,7 +788,18 @@ elf_s390_copy_indirect_symbol (bed, dir, ind)
eind->tls_type = GOT_UNKNOWN;
}
- _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
+ if (ELIMINATE_COPY_RELOCS
+ && ind->root.type != bfd_link_hash_indirect
+ && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+ /* If called to transfer flags for a weakdef during processing
+ of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
+ We clear it ourselves for ELIMINATE_COPY_RELOCS. */
+ dir->elf_link_hash_flags |=
+ (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
+ | ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK));
+ else
+ _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
}
static int
@@ -1114,7 +1131,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
|| h->root.type == bfd_link_hash_defweak
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (!info->shared
+ || (ELIMINATE_COPY_RELOCS
+ && !info->shared
&& (sec->flags & SEC_ALLOC) != 0
&& h != NULL
&& (h->root.type == bfd_link_hash_defweak
@@ -1452,8 +1470,6 @@ elf_s390_adjust_dynamic_symbol (info, h)
struct elf_link_hash_entry *h;
{
struct elf_s390_link_hash_table *htab;
- struct elf_s390_link_hash_entry * eh;
- struct elf_s390_dyn_relocs *p;
asection *s;
unsigned int power_of_two;
@@ -1499,6 +1515,10 @@ elf_s390_adjust_dynamic_symbol (info, h)
|| h->weakdef->root.type == bfd_link_hash_defweak);
h->root.u.def.section = h->weakdef->root.u.def.section;
h->root.u.def.value = h->weakdef->root.u.def.value;
+ if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
+ h->elf_link_hash_flags
+ = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+ | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
return TRUE;
}
@@ -1524,20 +1544,26 @@ elf_s390_adjust_dynamic_symbol (info, h)
return TRUE;
}
- eh = (struct elf_s390_link_hash_entry *) h;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ if (ELIMINATE_COPY_RELOCS)
{
- s = p->sec->output_section;
- if (s != NULL && (s->flags & SEC_READONLY) != 0)
- break;
- }
+ struct elf_s390_link_hash_entry * eh;
+ struct elf_s390_dyn_relocs *p;
- /* If we didn't find any dynamic relocs in read-only sections, then
- we'll be keeping the dynamic relocs and avoiding the copy reloc. */
- if (p == NULL)
- {
- h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
- return TRUE;
+ eh = (struct elf_s390_link_hash_entry *) h;
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ {
+ s = p->sec->output_section;
+ if (s != NULL && (s->flags & SEC_READONLY) != 0)
+ break;
+ }
+
+ /* If we didn't find any dynamic relocs in read-only sections, then
+ we'll be keeping the dynamic relocs and avoiding the copy reloc. */
+ if (p == NULL)
+ {
+ h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
+ return TRUE;
+ }
}
/* We must allocate the symbol in our .dynbss section, which will
@@ -1590,9 +1616,9 @@ elf_s390_adjust_dynamic_symbol (info, h)
will be called from elflink.h. If elflink.h doesn't call our
finish_dynamic_symbol routine, we'll need to do something about
initializing any .plt and .got entries in elf_s390_relocate_section. */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \
+#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
((DYN) \
- && ((INFO)->shared \
+ && ((SHARED) \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \
&& ((H)->dynindx != -1 \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
@@ -1623,7 +1649,9 @@ allocate_dynrelocs (h, inf)
htab = elf_s390_hash_table (info);
if (htab->elf.dynamic_sections_created
- && h->plt.refcount > 0)
+ && h->plt.refcount > 0
+ && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
{
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
@@ -1634,7 +1662,8 @@ allocate_dynrelocs (h, inf)
return FALSE;
}
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
+ if (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h))
{
asection *s = htab->splt;
@@ -1730,7 +1759,10 @@ allocate_dynrelocs (h, inf)
htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
else if (tls_type == GOT_TLS_GD)
htab->srelgot->_raw_size += 2 * sizeof (Elf64_External_Rela);
- else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
+ else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
+ && (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
}
else
@@ -1764,8 +1796,14 @@ allocate_dynrelocs (h, inf)
pp = &p->next;
}
}
+
+ /* Also discard relocs on undefined weak syms with non-default
+ visibility. */
+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ && h->root.type == bfd_link_hash_undefweak)
+ eh->dyn_relocs = NULL;
}
- else
+ else if (ELIMINATE_COPY_RELOCS)
{
/* For the non-shared case, discard space for relocs against
symbols which turn out to need copy relocs or are not
@@ -2274,12 +2312,14 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
off = h->got.offset;
dyn = htab->elf.dynamic_sections_created;
- if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
|| (info->shared
&& (info->symbolic
|| h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+ || (ELF_ST_VISIBILITY (h->other)
+ && h->root.type == bfd_link_hash_undefweak))
{
/* This is actually a static link, or it is a
-Bsymbolic link and the symbol is defined
@@ -2449,6 +2489,9 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
break;
if ((info->shared
+ && (h == NULL
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
&& ((r_type != R_390_PC16
&& r_type != R_390_PC16DBL
&& r_type != R_390_PC32
@@ -2459,7 +2502,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
&& (! info->symbolic
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (!info->shared
+ || (ELIMINATE_COPY_RELOCS
+ && !info->shared
&& h != NULL
&& h->dynindx != -1
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
@@ -3271,7 +3315,7 @@ const struct elf_size_info s390_elf64_size_info =
8, /* hash-table entry size. */
1, /* internal relocations per external relocations. */
64, /* arch_size. */
- 8, /* file_align. */
+ 3, /* log_file_align. */
ELFCLASS64, EV_CURRENT,
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index 5a2f89a3e78..d666fca9cbe 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -1,4 +1,4 @@
-/* Renesas SH64-specific support for 64-bit ELF
+/* SuperH SH64-specific support for 64-bit ELF
Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -2226,7 +2226,7 @@ sh_elf64_get_relocated_section_contents (output_bfd, link_info, link_order,
goto error_return;
}
- internal_relocs = (_bfd_elf64_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(input_bfd, input_section, (PTR) NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index bca09b73cef..d7ad1b725de 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -3170,7 +3170,7 @@ const struct elf_size_info sparc64_elf_size_info =
we use 2. */
1,
64, /* arch_size. */
- 8, /* file_align. */
+ 3, /* log_file_align. */
ELFCLASS64,
EV_CURRENT,
bfd_elf64_write_out_phdrs,
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index f13b4d2207c..c0ce57d708d 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -324,6 +324,12 @@ elf64_x86_64_grok_psinfo (abfd, note)
#define ELF_DYNAMIC_INTERPRETER "/lib/ld64.so.1"
+/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
+ copying dynamic variables from a shared lib into an app's dynbss
+ section, and instead use a dynamic relocation to point into the
+ shared lib. */
+#define ELIMINATE_COPY_RELOCS 1
+
/* The size in bytes of an entry in the global offset table. */
#define GOT_ENTRY_SIZE 8
@@ -616,7 +622,18 @@ elf64_x86_64_copy_indirect_symbol (bed, dir, ind)
eind->tls_type = GOT_UNKNOWN;
}
- _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
+ if (ELIMINATE_COPY_RELOCS
+ && ind->root.type != bfd_link_hash_indirect
+ && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+ /* If called to transfer flags for a weakdef during processing
+ of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
+ We clear it ourselves for ELIMINATE_COPY_RELOCS. */
+ dir->elf_link_hash_flags |=
+ (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
+ | ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK));
+ else
+ _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
}
static bfd_boolean
@@ -914,7 +931,8 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs)
|| h->root.type == bfd_link_hash_defweak
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (!info->shared
+ || (ELIMINATE_COPY_RELOCS
+ && !info->shared
&& (sec->flags & SEC_ALLOC) != 0
&& h != NULL
&& (h->root.type == bfd_link_hash_defweak
@@ -1189,8 +1207,6 @@ elf64_x86_64_adjust_dynamic_symbol (info, h)
struct elf_link_hash_entry *h;
{
struct elf64_x86_64_link_hash_table *htab;
- struct elf64_x86_64_link_hash_entry * eh;
- struct elf64_x86_64_dyn_relocs *p;
asection *s;
unsigned int power_of_two;
@@ -1235,6 +1251,10 @@ elf64_x86_64_adjust_dynamic_symbol (info, h)
|| h->weakdef->root.type == bfd_link_hash_defweak);
h->root.u.def.section = h->weakdef->root.u.def.section;
h->root.u.def.value = h->weakdef->root.u.def.value;
+ if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
+ h->elf_link_hash_flags
+ = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
+ | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
return TRUE;
}
@@ -1260,20 +1280,26 @@ elf64_x86_64_adjust_dynamic_symbol (info, h)
return TRUE;
}
- eh = (struct elf64_x86_64_link_hash_entry *) h;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ if (ELIMINATE_COPY_RELOCS)
{
- s = p->sec->output_section;
- if (s != NULL && (s->flags & SEC_READONLY) != 0)
- break;
- }
+ struct elf64_x86_64_link_hash_entry * eh;
+ struct elf64_x86_64_dyn_relocs *p;
- /* If we didn't find any dynamic relocs in read-only sections, then
- we'll be keeping the dynamic relocs and avoiding the copy reloc. */
- if (p == NULL)
- {
- h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
- return TRUE;
+ eh = (struct elf64_x86_64_link_hash_entry *) h;
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ {
+ s = p->sec->output_section;
+ if (s != NULL && (s->flags & SEC_READONLY) != 0)
+ break;
+ }
+
+ /* If we didn't find any dynamic relocs in read-only sections, then
+ we'll be keeping the dynamic relocs and avoiding the copy reloc. */
+ if (p == NULL)
+ {
+ h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
+ return TRUE;
+ }
}
/* We must allocate the symbol in our .dynbss section, which will
@@ -1359,7 +1385,9 @@ allocate_dynrelocs (h, inf)
htab = elf64_x86_64_hash_table (info);
if (htab->elf.dynamic_sections_created
- && h->plt.refcount > 0)
+ && h->plt.refcount > 0
+ && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
{
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
@@ -1452,7 +1480,9 @@ allocate_dynrelocs (h, inf)
htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
else if (tls_type == GOT_TLS_GD)
htab->srelgot->_raw_size += 2 * sizeof (Elf64_External_Rela);
- else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
+ else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
}
else
@@ -1486,8 +1516,14 @@ allocate_dynrelocs (h, inf)
pp = &p->next;
}
}
+
+ /* Also discard relocs on undefined weak syms with non-default
+ visibility. */
+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ && h->root.type == bfd_link_hash_undefweak)
+ eh->dyn_relocs = NULL;
}
- else
+ else if (ELIMINATE_COPY_RELOCS)
{
/* For the non-shared case, discard space for relocs against
symbols which turn out to need copy relocs or are not
@@ -1950,7 +1986,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
&& (info->symbolic
|| h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+ || (ELF_ST_VISIBILITY (h->other)
+ && h->root.type == bfd_link_hash_undefweak))
{
/* This is actually a static link, or it is a -Bsymbolic
link and the symbol is defined locally, or the symbol
@@ -2069,6 +2107,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
break;
if ((info->shared
+ && (h == NULL
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
&& ((r_type != R_X86_64_PC8
&& r_type != R_X86_64_PC16
&& r_type != R_X86_64_PC32)
@@ -2077,7 +2118,8 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
&& (! info->symbolic
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (!info->shared
+ || (ELIMINATE_COPY_RELOCS
+ && !info->shared
&& h != NULL
&& h->dynindx != -1
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
@@ -2351,7 +2393,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
{
if (indx == 0)
{
- BFD_ASSERT (! unresolved_reloc);
+ BFD_ASSERT (! unresolved_reloc);
bfd_put_64 (output_bfd,
relocation - dtpoff_base (info),
htab->sgot->contents + off + GOT_ENTRY_SIZE);
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 2a6f6bf20a4..0be8048a041 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -1,6 +1,6 @@
/* ELF executable support for BFD.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002 Free Software Foundation, Inc.
+ 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published
in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -121,8 +121,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define elf_write_out_phdrs NAME(bfd_elf,write_out_phdrs)
#define elf_write_relocs NAME(bfd_elf,write_relocs)
#define elf_slurp_reloc_table NAME(bfd_elf,slurp_reloc_table)
-#define elf_link_create_dynamic_sections \
- NAME(bfd_elf,link_create_dynamic_sections)
#define elf_bfd_discard_info NAME(bfd_elf,discard_info)
#define elf_reloc_symbol_deleted_p NAME(_bfd_elf,reloc_symbol_deleted_p)
#define elf_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol
@@ -1585,7 +1583,7 @@ const struct elf_size_info NAME(_bfd_elf,size_info) = {
sizeof (Elf_External_Note),
4,
1,
- ARCH_SIZE, FILE_ALIGN,
+ ARCH_SIZE, LOG_FILE_ALIGN,
ELFCLASS, EV_CURRENT,
elf_write_out_phdrs,
elf_write_shdrs_and_ehdr,
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 962c1044115..05194591b4a 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -25,6 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define ARCH_SIZE 0
#include "elf-bfd.h"
+static bfd_boolean elf_link_read_relocs_from_section
+ PARAMS ((bfd *, Elf_Internal_Shdr *, PTR, Elf_Internal_Rela *));
+
bfd_boolean
_bfd_elf_create_got_section (abfd, info)
bfd *abfd;
@@ -104,33 +107,159 @@ _bfd_elf_create_got_section (abfd, info)
return TRUE;
}
-/* Create dynamic sections when linking against a dynamic object. */
+/* Create some sections which will be filled in with dynamic linking
+ information. ABFD is an input file which requires dynamic sections
+ to be created. The dynamic sections take up virtual memory space
+ when the final executable is run, so we need to create them before
+ addresses are assigned to the output sections. We work out the
+ actual contents and size of these sections later. */
bfd_boolean
-_bfd_elf_create_dynamic_sections (abfd, info)
+_bfd_elf_link_create_dynamic_sections (abfd, info)
bfd *abfd;
struct bfd_link_info *info;
{
- flagword flags, pltflags;
- asection *s;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
- int ptralign;
+ flagword flags;
+ register asection *s;
+ struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *bh;
+ struct elf_backend_data *bed;
- switch (bed->s->arch_size)
+ if (! is_elf_hash_table (info))
+ return FALSE;
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ return TRUE;
+
+ /* Make sure that all dynamic sections use the same input BFD. */
+ if (elf_hash_table (info)->dynobj == NULL)
+ elf_hash_table (info)->dynobj = abfd;
+ else
+ abfd = elf_hash_table (info)->dynobj;
+
+ /* Note that we set the SEC_IN_MEMORY flag for all of these
+ sections. */
+ flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY | SEC_LINKER_CREATED);
+
+ /* A dynamically linked executable has a .interp section, but a
+ shared library does not. */
+ if (! info->shared)
{
- case 32:
- ptralign = 2;
- break;
+ s = bfd_make_section (abfd, ".interp");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY))
+ return FALSE;
+ }
- case 64:
- ptralign = 3;
- break;
+ if (! info->traditional_format
+ && info->hash->creator->flavour == bfd_target_elf_flavour)
+ {
+ s = bfd_make_section (abfd, ".eh_frame_hdr");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, 2))
+ return FALSE;
+ elf_hash_table (info)->eh_info.hdr_sec = s;
+ }
- default:
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
+ bed = get_elf_backend_data (abfd);
+
+ /* Create sections to hold version informations. These are removed
+ if they are not needed. */
+ s = bfd_make_section (abfd, ".gnu.version_d");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ return FALSE;
+
+ s = bfd_make_section (abfd, ".gnu.version");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, 1))
+ return FALSE;
+
+ s = bfd_make_section (abfd, ".gnu.version_r");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ return FALSE;
+
+ s = bfd_make_section (abfd, ".dynsym");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ return FALSE;
+
+ s = bfd_make_section (abfd, ".dynstr");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY))
+ return FALSE;
+
+ /* Create a strtab to hold the dynamic symbol names. */
+ if (elf_hash_table (info)->dynstr == NULL)
+ {
+ elf_hash_table (info)->dynstr = _bfd_elf_strtab_init ();
+ if (elf_hash_table (info)->dynstr == NULL)
+ return FALSE;
}
+ s = bfd_make_section (abfd, ".dynamic");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags)
+ || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ return FALSE;
+
+ /* The special symbol _DYNAMIC is always set to the start of the
+ .dynamic section. This call occurs before we have processed the
+ symbols for any dynamic object, so we don't have to worry about
+ overriding a dynamic definition. We could set _DYNAMIC in a
+ linker script, but we only want to define it if we are, in fact,
+ creating a .dynamic section. We don't want to define it if there
+ is no .dynamic section, since on some ELF platforms the start up
+ code examines it to decide how to initialize the process. */
+ bh = NULL;
+ if (! (_bfd_generic_link_add_one_symbol
+ (info, abfd, "_DYNAMIC", BSF_GLOBAL, s, (bfd_vma) 0,
+ (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;
+
+ if (info->shared
+ && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+
+ s = bfd_make_section (abfd, ".hash");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ return FALSE;
+ elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry;
+
+ /* Let the backend create the rest of the sections. This lets the
+ backend set the right flags. The backend will normally create
+ the .got and .plt sections. */
+ if (! (*bed->elf_backend_create_dynamic_sections) (abfd, info))
+ return FALSE;
+
+ elf_hash_table (info)->dynamic_sections_created = TRUE;
+
+ return TRUE;
+}
+
+/* Create dynamic sections when linking against a dynamic object. */
+
+bfd_boolean
+_bfd_elf_create_dynamic_sections (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ flagword flags, pltflags;
+ asection *s;
+ struct elf_backend_data *bed = get_elf_backend_data (abfd);
+
/* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and
.rel[a].bss sections. */
@@ -175,7 +304,7 @@ _bfd_elf_create_dynamic_sections (abfd, info)
bed->default_use_rela_p ? ".rela.plt" : ".rel.plt");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;
if (! _bfd_elf_create_got_section (abfd, info))
@@ -212,7 +341,7 @@ _bfd_elf_create_dynamic_sections (abfd, info)
? ".rela.bss" : ".rel.bss"));
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;
}
}
@@ -306,6 +435,70 @@ _bfd_elf_link_record_dynamic_symbol (info, h)
return TRUE;
}
+
+/* Record an assignment to a symbol made by a linker script. We need
+ this in case some dynamic object refers to this symbol. */
+
+bfd_boolean
+bfd_elf_record_link_assignment (output_bfd, info, name, provide)
+ bfd *output_bfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info;
+ const char *name;
+ bfd_boolean provide;
+{
+ struct elf_link_hash_entry *h;
+
+ if (info->hash->creator->flavour != bfd_target_elf_flavour)
+ return TRUE;
+
+ h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, TRUE, FALSE);
+ if (h == NULL)
+ return FALSE;
+
+ if (h->root.type == bfd_link_hash_new)
+ h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
+
+ /* If this symbol is being provided by the linker script, and it is
+ currently defined by a dynamic object, but not by a regular
+ object, then mark it as undefined so that the generic linker will
+ force the correct value. */
+ if (provide
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ h->root.type = bfd_link_hash_undefined;
+
+ /* If this symbol is not being provided by the linker script, and it is
+ currently defined by a dynamic object, but not by a regular object,
+ then clear out any version information because the symbol will not be
+ associated with the dynamic object any more. */
+ if (!provide
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ h->verinfo.verdef = NULL;
+
+ h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+
+ if (((h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_DYNAMIC
+ | ELF_LINK_HASH_REF_DYNAMIC)) != 0
+ || info->shared)
+ && h->dynindx == -1)
+ {
+ if (! _bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+
+ /* If this is a weak defined symbol, and we know a corresponding
+ real symbol from the same dynamic object, make sure the real
+ symbol is also made into a dynamic symbol. */
+ if (h->weakdef != NULL
+ && h->weakdef->dynindx == -1)
+ {
+ if (! _bfd_elf_link_record_dynamic_symbol (info, h->weakdef))
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
/* Record a new local dynamic symbol. Returns 0 on failure, 1 on
success, and 2 on a failure caused by attempting to record a symbol
@@ -477,6 +670,1230 @@ _bfd_elf_link_renumber_dynsyms (output_bfd, info)
return elf_hash_table (info)->dynsymcount = dynsymcount;
}
+
+/* This function is called when we want to define a new symbol. It
+ handles the various cases which arise when we find a definition in
+ a dynamic object, or when there is already a definition in a
+ dynamic object. The new symbol is described by NAME, SYM, PSEC,
+ and PVALUE. We set SYM_HASH to the hash table entry. We set
+ OVERRIDE if the old symbol is overriding a new definition. We set
+ TYPE_CHANGE_OK if it is OK for the type to change. We set
+ SIZE_CHANGE_OK if it is OK for the size to change. By OK to
+ change, we mean that we shouldn't warn if the type or size does
+ change. DT_NEEDED indicates if it comes from a DT_NEEDED entry of
+ a shared object. */
+
+bfd_boolean
+_bfd_elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, skip,
+ override, type_change_ok, size_change_ok, dt_needed)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ const char *name;
+ Elf_Internal_Sym *sym;
+ asection **psec;
+ bfd_vma *pvalue;
+ struct elf_link_hash_entry **sym_hash;
+ bfd_boolean *skip;
+ bfd_boolean *override;
+ bfd_boolean *type_change_ok;
+ bfd_boolean *size_change_ok;
+ bfd_boolean dt_needed;
+{
+ asection *sec;
+ struct elf_link_hash_entry *h;
+ struct elf_link_hash_entry *flip;
+ int bind;
+ bfd *oldbfd;
+ bfd_boolean newdyn, olddyn, olddef, newdef, newdyncommon, olddyncommon;
+ bfd_boolean newweakdef, oldweakdef, newweakundef, oldweakundef;
+
+ *skip = FALSE;
+ *override = FALSE;
+
+ sec = *psec;
+ bind = ELF_ST_BIND (sym->st_info);
+
+ if (! bfd_is_und_section (sec))
+ h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, FALSE, FALSE);
+ else
+ h = ((struct elf_link_hash_entry *)
+ bfd_wrapped_link_hash_lookup (abfd, info, name, TRUE, FALSE, FALSE));
+ if (h == NULL)
+ return FALSE;
+ *sym_hash = h;
+
+ /* This code is for coping with dynamic objects, and is only useful
+ if we are doing an ELF link. */
+ if (info->hash->creator != abfd->xvec)
+ return TRUE;
+
+ /* For merging, we only care about real symbols. */
+
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ /* If we just created the symbol, mark it as being an ELF symbol.
+ Other than that, there is nothing to do--there is no merge issue
+ with a newly defined symbol--so we just return. */
+
+ if (h->root.type == bfd_link_hash_new)
+ {
+ h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
+ return TRUE;
+ }
+
+ /* OLDBFD is a BFD associated with the existing symbol. */
+
+ switch (h->root.type)
+ {
+ default:
+ oldbfd = NULL;
+ break;
+
+ case bfd_link_hash_undefined:
+ case bfd_link_hash_undefweak:
+ oldbfd = h->root.u.undef.abfd;
+ break;
+
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ oldbfd = h->root.u.def.section->owner;
+ break;
+
+ case bfd_link_hash_common:
+ oldbfd = h->root.u.c.p->section->owner;
+ break;
+ }
+
+ /* In cases involving weak versioned symbols, we may wind up trying
+ to merge a symbol with itself. Catch that here, to avoid the
+ confusion that results if we try to override a symbol with
+ itself. The additional tests catch cases like
+ _GLOBAL_OFFSET_TABLE_, which are regular symbols defined in a
+ dynamic object, which we do want to handle here. */
+ if (abfd == oldbfd
+ && ((abfd->flags & DYNAMIC) == 0
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))
+ return TRUE;
+
+ /* NEWDYN and OLDDYN indicate whether the new or old symbol,
+ respectively, is from a dynamic object. */
+
+ if ((abfd->flags & DYNAMIC) != 0)
+ newdyn = TRUE;
+ else
+ newdyn = FALSE;
+
+ if (oldbfd != NULL)
+ olddyn = (oldbfd->flags & DYNAMIC) != 0;
+ else
+ {
+ asection *hsec;
+
+ /* This code handles the special SHN_MIPS_{TEXT,DATA} section
+ indices used by MIPS ELF. */
+ switch (h->root.type)
+ {
+ default:
+ hsec = NULL;
+ break;
+
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ hsec = h->root.u.def.section;
+ break;
+
+ case bfd_link_hash_common:
+ hsec = h->root.u.c.p->section;
+ break;
+ }
+
+ if (hsec == NULL)
+ olddyn = FALSE;
+ else
+ olddyn = (hsec->symbol->flags & BSF_DYNAMIC) != 0;
+ }
+
+ /* NEWDEF and OLDDEF indicate whether the new or old symbol,
+ respectively, appear to be a definition rather than reference. */
+
+ if (bfd_is_und_section (sec) || bfd_is_com_section (sec))
+ newdef = FALSE;
+ else
+ newdef = TRUE;
+
+ if (h->root.type == bfd_link_hash_undefined
+ || h->root.type == bfd_link_hash_undefweak
+ || h->root.type == bfd_link_hash_common)
+ olddef = FALSE;
+ else
+ olddef = TRUE;
+
+ /* We need to rememeber if a symbol has a definition in a dynamic
+ object or is weak in all dynamic objects. Internal and hidden
+ visibility will make it unavailable to dynamic objects. */
+ if (newdyn && (h->elf_link_hash_flags & ELF_LINK_DYNAMIC_DEF) == 0)
+ {
+ if (!bfd_is_und_section (sec))
+ h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_DEF;
+ else
+ {
+ /* Check if this symbol is weak in all dynamic objects. If it
+ is the first time we see it in a dynamic object, we mark
+ if it is weak. Otherwise, we clear it. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)
+ {
+ if (bind == STB_WEAK)
+ h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_WEAK;
+ }
+ else if (bind != STB_WEAK)
+ h->elf_link_hash_flags &= ~ELF_LINK_DYNAMIC_WEAK;
+ }
+ }
+
+ /* If the old symbol has non-default visibility, we ignore the new
+ definition from a dynamic object. */
+ if (newdyn
+ && ELF_ST_VISIBILITY (h->other)
+ && !bfd_is_und_section (sec))
+ {
+ *skip = TRUE;
+ /* Make sure this symbol is dynamic. */
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ /* A protected symbol has external availability. Make sure it is
+ recorded as dynamic.
+
+ FIXME: Should we check type and size for protected symbol? */
+ if (ELF_ST_VISIBILITY (h->other) == STV_PROTECTED)
+ return _bfd_elf_link_record_dynamic_symbol (info, h);
+ else
+ return TRUE;
+ }
+ else if (!newdyn
+ && ELF_ST_VISIBILITY (sym->st_other)
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
+ {
+ /* If the new symbol with non-default visibility comes from a
+ relocatable file and the old definition comes from a dynamic
+ object, we remove the old definition. */
+ if ((*sym_hash)->root.type == bfd_link_hash_indirect)
+ h = *sym_hash;
+ h->root.type = bfd_link_hash_new;
+ h->root.u.undef.abfd = NULL;
+ if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
+ {
+ h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC;
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ }
+ /* FIXME: Should we check type and size for protected symbol? */
+ h->size = 0;
+ h->type = 0;
+ return TRUE;
+ }
+
+ /* We need to treat weak definiton right, depending on if there is a
+ definition from a dynamic object. */
+ if (bind == STB_WEAK)
+ {
+ if (olddef)
+ {
+ newweakdef = TRUE;
+ newweakundef = FALSE;
+ }
+ else
+ {
+ newweakdef = FALSE;
+ newweakundef = TRUE;
+ }
+ }
+ else
+ newweakdef = newweakundef = FALSE;
+
+ /* If the new weak definition comes from a relocatable file and the
+ old symbol comes from a dynamic object, we treat the new one as
+ strong. */
+ if (newweakdef && !newdyn && olddyn)
+ newweakdef = FALSE;
+
+ if (h->root.type == bfd_link_hash_defweak)
+ {
+ oldweakdef = TRUE;
+ oldweakundef = FALSE;
+ }
+ else if (h->root.type == bfd_link_hash_undefweak)
+ {
+ oldweakdef = FALSE;
+ oldweakundef = TRUE;
+ }
+ else
+ oldweakdef = oldweakundef = FALSE;
+
+ /* If the old weak definition comes from a relocatable file and the
+ new symbol comes from a dynamic object, we treat the old one as
+ strong. */
+ if (oldweakdef && !olddyn && newdyn)
+ oldweakdef = FALSE;
+
+ /* NEWDYNCOMMON and OLDDYNCOMMON indicate whether the new or old
+ symbol, respectively, appears to be a common symbol in a dynamic
+ object. If a symbol appears in an uninitialized section, and is
+ not weak, and is not a function, then it may be a common symbol
+ which was resolved when the dynamic object was created. We want
+ to treat such symbols specially, because they raise special
+ considerations when setting the symbol size: if the symbol
+ appears as a common symbol in a regular object, and the size in
+ the regular object is larger, we must make sure that we use the
+ larger size. This problematic case can always be avoided in C,
+ but it must be handled correctly when using Fortran shared
+ libraries.
+
+ Note that if NEWDYNCOMMON is set, NEWDEF will be set, and
+ likewise for OLDDYNCOMMON and OLDDEF.
+
+ Note that this test is just a heuristic, and that it is quite
+ possible to have an uninitialized symbol in a shared object which
+ is really a definition, rather than a common symbol. This could
+ lead to some minor confusion when the symbol really is a common
+ symbol in some regular object. However, I think it will be
+ harmless. */
+
+ if (newdyn
+ && newdef
+ && (sec->flags & SEC_ALLOC) != 0
+ && (sec->flags & SEC_LOAD) == 0
+ && sym->st_size > 0
+ && !newweakdef
+ && !newweakundef
+ && ELF_ST_TYPE (sym->st_info) != STT_FUNC)
+ newdyncommon = TRUE;
+ else
+ newdyncommon = FALSE;
+
+ if (olddyn
+ && olddef
+ && h->root.type == bfd_link_hash_defined
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->root.u.def.section->flags & SEC_ALLOC) != 0
+ && (h->root.u.def.section->flags & SEC_LOAD) == 0
+ && h->size > 0
+ && h->type != STT_FUNC)
+ olddyncommon = TRUE;
+ else
+ olddyncommon = FALSE;
+
+ /* It's OK to change the type if either the existing symbol or the
+ new symbol is weak unless it comes from a DT_NEEDED entry of
+ a shared object, in which case, the DT_NEEDED entry may not be
+ required at the run time. */
+
+ if ((! dt_needed && oldweakdef)
+ || oldweakundef
+ || newweakdef
+ || newweakundef)
+ *type_change_ok = TRUE;
+
+ /* It's OK to change the size if either the existing symbol or the
+ new symbol is weak, or if the old symbol is undefined. */
+
+ if (*type_change_ok
+ || h->root.type == bfd_link_hash_undefined)
+ *size_change_ok = TRUE;
+
+ /* If both the old and the new symbols look like common symbols in a
+ dynamic object, set the size of the symbol to the larger of the
+ two. */
+
+ if (olddyncommon
+ && newdyncommon
+ && sym->st_size != h->size)
+ {
+ /* Since we think we have two common symbols, issue a multiple
+ common warning if desired. Note that we only warn if the
+ size is different. If the size is the same, we simply let
+ the old symbol override the new one as normally happens with
+ symbols defined in dynamic objects. */
+
+ if (! ((*info->callbacks->multiple_common)
+ (info, h->root.root.string, oldbfd, bfd_link_hash_common,
+ h->size, abfd, bfd_link_hash_common, sym->st_size)))
+ return FALSE;
+
+ if (sym->st_size > h->size)
+ h->size = sym->st_size;
+
+ *size_change_ok = TRUE;
+ }
+
+ /* If we are looking at a dynamic object, and we have found a
+ definition, we need to see if the symbol was already defined by
+ some other object. If so, we want to use the existing
+ definition, and we do not want to report a multiple symbol
+ definition error; we do this by clobbering *PSEC to be
+ bfd_und_section_ptr.
+
+ We treat a common symbol as a definition if the symbol in the
+ shared library is a function, since common symbols always
+ represent variables; this can cause confusion in principle, but
+ any such confusion would seem to indicate an erroneous program or
+ shared library. We also permit a common symbol in a regular
+ object to override a weak symbol in a shared object.
+
+ We prefer a non-weak definition in a shared library to a weak
+ definition in the executable unless it comes from a DT_NEEDED
+ entry of a shared object, in which case, the DT_NEEDED entry
+ may not be required at the run time. */
+
+ if (newdyn
+ && newdef
+ && (olddef
+ || (h->root.type == bfd_link_hash_common
+ && (newweakdef
+ || newweakundef
+ || ELF_ST_TYPE (sym->st_info) == STT_FUNC)))
+ && (!oldweakdef
+ || dt_needed
+ || newweakdef
+ || newweakundef))
+ {
+ *override = TRUE;
+ newdef = FALSE;
+ newdyncommon = FALSE;
+
+ *psec = sec = bfd_und_section_ptr;
+ *size_change_ok = TRUE;
+
+ /* If we get here when the old symbol is a common symbol, then
+ we are explicitly letting it override a weak symbol or
+ function in a dynamic object, and we don't want to warn about
+ a type change. If the old symbol is a defined symbol, a type
+ change warning may still be appropriate. */
+
+ if (h->root.type == bfd_link_hash_common)
+ *type_change_ok = TRUE;
+ }
+
+ /* Handle the special case of an old common symbol merging with a
+ new symbol which looks like a common symbol in a shared object.
+ We change *PSEC and *PVALUE to make the new symbol look like a
+ common symbol, and let _bfd_generic_link_add_one_symbol will do
+ the right thing. */
+
+ if (newdyncommon
+ && h->root.type == bfd_link_hash_common)
+ {
+ *override = TRUE;
+ newdef = FALSE;
+ newdyncommon = FALSE;
+ *pvalue = sym->st_size;
+ *psec = sec = bfd_com_section_ptr;
+ *size_change_ok = TRUE;
+ }
+
+ /* If the old symbol is from a dynamic object, and the new symbol is
+ a definition which is not from a dynamic object, then the new
+ symbol overrides the old symbol. Symbols from regular files
+ always take precedence over symbols from dynamic objects, even if
+ they are defined after the dynamic object in the link.
+
+ As above, we again permit a common symbol in a regular object to
+ override a definition in a shared object if the shared object
+ symbol is a function or is weak.
+
+ As above, we permit a non-weak definition in a shared object to
+ override a weak definition in a regular object. */
+
+ flip = NULL;
+ if (! newdyn
+ && (newdef
+ || (bfd_is_com_section (sec)
+ && (oldweakdef || h->type == STT_FUNC)))
+ && olddyn
+ && olddef
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && ((!newweakdef && !newweakundef) || oldweakdef))
+ {
+ /* Change the hash table entry to undefined, and let
+ _bfd_generic_link_add_one_symbol do the right thing with the
+ new definition. */
+
+ h->root.type = bfd_link_hash_undefined;
+ h->root.u.undef.abfd = h->root.u.def.section->owner;
+ *size_change_ok = TRUE;
+
+ olddef = FALSE;
+ olddyncommon = FALSE;
+
+ /* We again permit a type change when a common symbol may be
+ overriding a function. */
+
+ if (bfd_is_com_section (sec))
+ *type_change_ok = TRUE;
+
+ if ((*sym_hash)->root.type == bfd_link_hash_indirect)
+ flip = *sym_hash;
+ else
+ /* This union may have been set to be non-NULL when this symbol
+ was seen in a dynamic object. We must force the union to be
+ NULL, so that it is correct for a regular symbol. */
+ h->verinfo.vertree = NULL;
+ }
+
+ /* Handle the special case of a new common symbol merging with an
+ old symbol that looks like it might be a common symbol defined in
+ a shared object. Note that we have already handled the case in
+ which a new common symbol should simply override the definition
+ in the shared library. */
+
+ if (! newdyn
+ && bfd_is_com_section (sec)
+ && olddyncommon)
+ {
+ /* It would be best if we could set the hash table entry to a
+ common symbol, but we don't know what to use for the section
+ or the alignment. */
+ if (! ((*info->callbacks->multiple_common)
+ (info, h->root.root.string, oldbfd, bfd_link_hash_common,
+ h->size, abfd, bfd_link_hash_common, sym->st_size)))
+ return FALSE;
+
+ /* If the predumed common symbol in the dynamic object is
+ larger, pretend that the new symbol has its size. */
+
+ if (h->size > *pvalue)
+ *pvalue = h->size;
+
+ /* FIXME: We no longer know the alignment required by the symbol
+ in the dynamic object, so we just wind up using the one from
+ the regular object. */
+
+ olddef = FALSE;
+ olddyncommon = FALSE;
+
+ h->root.type = bfd_link_hash_undefined;
+ h->root.u.undef.abfd = h->root.u.def.section->owner;
+
+ *size_change_ok = TRUE;
+ *type_change_ok = TRUE;
+
+ if ((*sym_hash)->root.type == bfd_link_hash_indirect)
+ flip = *sym_hash;
+ else
+ h->verinfo.vertree = NULL;
+ }
+
+ if (flip != NULL)
+ {
+ /* Handle the case where we had a versioned symbol in a dynamic
+ library and now find a definition in a normal object. In this
+ case, we make the versioned symbol point to the normal one. */
+ struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ flip->root.type = h->root.type;
+ h->root.type = bfd_link_hash_indirect;
+ h->root.u.i.link = (struct bfd_link_hash_entry *) flip;
+ (*bed->elf_backend_copy_indirect_symbol) (bed, flip, h);
+ flip->root.u.undef.abfd = h->root.u.undef.abfd;
+ if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
+ {
+ h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC;
+ flip->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ }
+ }
+
+ /* Handle the special case of a weak definition in a regular object
+ followed by a non-weak definition in a shared object. In this
+ case, we prefer the definition in the shared object unless it
+ comes from a DT_NEEDED entry of a shared object, in which case,
+ the DT_NEEDED entry may not be required at the run time. */
+ if (olddef
+ && ! dt_needed
+ && oldweakdef
+ && newdef
+ && newdyn
+ && !newweakdef
+ && !newweakundef)
+ {
+ /* To make this work we have to frob the flags so that the rest
+ of the code does not think we are using the regular
+ definition. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+ else if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ h->elf_link_hash_flags &= ~ (ELF_LINK_HASH_DEF_REGULAR
+ | ELF_LINK_HASH_DEF_DYNAMIC);
+
+ /* If H is the target of an indirection, we want the caller to
+ use H rather than the indirect symbol. Otherwise if we are
+ defining a new indirect symbol we will wind up attaching it
+ to the entry we are overriding. */
+ *sym_hash = h;
+ }
+
+ /* Handle the special case of a non-weak definition in a shared
+ object followed by a weak definition in a regular object. In
+ this case we prefer the definition in the shared object. To make
+ this work we have to tell the caller to not treat the new symbol
+ as a definition. */
+ if (olddef
+ && olddyn
+ && !oldweakdef
+ && newdef
+ && ! newdyn
+ && (newweakdef || newweakundef))
+ *override = TRUE;
+
+ return TRUE;
+}
+
+/* This function is called to create an indirect symbol from the
+ default for the symbol with the default version if needed. The
+ symbol is described by H, NAME, SYM, PSEC, VALUE, and OVERRIDE. We
+ set DYNSYM if the new indirect symbol is dynamic. DT_NEEDED
+ indicates if it comes from a DT_NEEDED entry of a shared object. */
+
+bfd_boolean
+_bfd_elf_add_default_symbol (abfd, info, h, name, sym, psec, value,
+ dynsym, override, dt_needed)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ struct elf_link_hash_entry *h;
+ const char *name;
+ Elf_Internal_Sym *sym;
+ asection **psec;
+ bfd_vma *value;
+ bfd_boolean *dynsym;
+ bfd_boolean override;
+ bfd_boolean dt_needed;
+{
+ bfd_boolean type_change_ok;
+ bfd_boolean size_change_ok;
+ bfd_boolean skip;
+ char *shortname;
+ struct elf_link_hash_entry *hi;
+ struct bfd_link_hash_entry *bh;
+ struct elf_backend_data *bed;
+ bfd_boolean collect;
+ bfd_boolean dynamic;
+ char *p;
+ size_t len, shortlen;
+ asection *sec;
+
+ /* If this symbol has a version, and it is the default version, we
+ create an indirect symbol from the default name to the fully
+ decorated name. This will cause external references which do not
+ specify a version to be bound to this version of the symbol. */
+ p = strchr (name, ELF_VER_CHR);
+ if (p == NULL || p[1] != ELF_VER_CHR)
+ return TRUE;
+
+ if (override)
+ {
+ /* We are overridden by an old defition. We need to check if we
+ need to create the indirect symbol from the default name. */
+ hi = elf_link_hash_lookup (elf_hash_table (info), name, TRUE,
+ FALSE, FALSE);
+ BFD_ASSERT (hi != NULL);
+ if (hi == h)
+ return TRUE;
+ while (hi->root.type == bfd_link_hash_indirect
+ || hi->root.type == bfd_link_hash_warning)
+ {
+ hi = (struct elf_link_hash_entry *) hi->root.u.i.link;
+ if (hi == h)
+ return TRUE;
+ }
+ }
+
+ bed = get_elf_backend_data (abfd);
+ collect = bed->collect;
+ dynamic = (abfd->flags & DYNAMIC) != 0;
+
+ shortlen = p - name;
+ shortname = bfd_hash_allocate (&info->hash->table, shortlen + 1);
+ if (shortname == NULL)
+ return FALSE;
+ memcpy (shortname, name, shortlen);
+ shortname[shortlen] = '\0';
+
+ /* We are going to create a new symbol. Merge it with any existing
+ symbol with this name. For the purposes of the merge, act as
+ though we were defining the symbol we just defined, although we
+ actually going to define an indirect symbol. */
+ type_change_ok = FALSE;
+ size_change_ok = FALSE;
+ sec = *psec;
+ if (!_bfd_elf_merge_symbol (abfd, info, shortname, sym, &sec, value,
+ &hi, &skip, &override, &type_change_ok,
+ &size_change_ok, dt_needed))
+ return FALSE;
+
+ if (skip)
+ goto nondefault;
+
+ if (! override)
+ {
+ bh = &hi->root;
+ if (! (_bfd_generic_link_add_one_symbol
+ (info, abfd, shortname, BSF_INDIRECT, bfd_ind_section_ptr,
+ (bfd_vma) 0, name, FALSE, collect, &bh)))
+ return FALSE;
+ hi = (struct elf_link_hash_entry *) bh;
+ }
+ else
+ {
+ /* In this case the symbol named SHORTNAME is overriding the
+ indirect symbol we want to add. We were planning on making
+ SHORTNAME an indirect symbol referring to NAME. SHORTNAME
+ is the name without a version. NAME is the fully versioned
+ name, and it is the default version.
+
+ Overriding means that we already saw a definition for the
+ symbol SHORTNAME in a regular object, and it is overriding
+ the symbol defined in the dynamic object.
+
+ When this happens, we actually want to change NAME, the
+ symbol we just added, to refer to SHORTNAME. This will cause
+ references to NAME in the shared object to become references
+ to SHORTNAME in the regular object. This is what we expect
+ when we override a function in a shared object: that the
+ references in the shared object will be mapped to the
+ definition in the regular object. */
+
+ while (hi->root.type == bfd_link_hash_indirect
+ || hi->root.type == bfd_link_hash_warning)
+ hi = (struct elf_link_hash_entry *) hi->root.u.i.link;
+
+ h->root.type = bfd_link_hash_indirect;
+ h->root.u.i.link = (struct bfd_link_hash_entry *) hi;
+ if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
+ {
+ h->elf_link_hash_flags &=~ ELF_LINK_HASH_DEF_DYNAMIC;
+ hi->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ if (hi->elf_link_hash_flags
+ & (ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_DEF_REGULAR))
+ {
+ if (! _bfd_elf_link_record_dynamic_symbol (info, hi))
+ return FALSE;
+ }
+ }
+
+ /* Now set HI to H, so that the following code will set the
+ other fields correctly. */
+ hi = h;
+ }
+
+ /* If there is a duplicate definition somewhere, then HI may not
+ point to an indirect symbol. We will have reported an error to
+ the user in that case. */
+
+ if (hi->root.type == bfd_link_hash_indirect)
+ {
+ struct elf_link_hash_entry *ht;
+
+ /* If the symbol became indirect, then we assume that we have
+ not seen a definition before. */
+ BFD_ASSERT ((hi->elf_link_hash_flags
+ & (ELF_LINK_HASH_DEF_DYNAMIC
+ | ELF_LINK_HASH_DEF_REGULAR)) == 0);
+
+ ht = (struct elf_link_hash_entry *) hi->root.u.i.link;
+ (*bed->elf_backend_copy_indirect_symbol) (bed, ht, hi);
+
+ /* See if the new flags lead us to realize that the symbol must
+ be dynamic. */
+ if (! *dynsym)
+ {
+ if (! dynamic)
+ {
+ if (info->shared
+ || ((hi->elf_link_hash_flags
+ & ELF_LINK_HASH_REF_DYNAMIC) != 0))
+ *dynsym = TRUE;
+ }
+ else
+ {
+ if ((hi->elf_link_hash_flags
+ & ELF_LINK_HASH_REF_REGULAR) != 0)
+ *dynsym = TRUE;
+ }
+ }
+ }
+
+ /* We also need to define an indirection from the nondefault version
+ of the symbol. */
+
+nondefault:
+ len = strlen (name);
+ shortname = bfd_hash_allocate (&info->hash->table, len);
+ if (shortname == NULL)
+ return FALSE;
+ memcpy (shortname, name, shortlen);
+ memcpy (shortname + shortlen, p + 1, len - shortlen);
+
+ /* Once again, merge with any existing symbol. */
+ type_change_ok = FALSE;
+ size_change_ok = FALSE;
+ sec = *psec;
+ if (!_bfd_elf_merge_symbol (abfd, info, shortname, sym, &sec, value,
+ &hi, &skip, &override, &type_change_ok,
+ &size_change_ok, dt_needed))
+ return FALSE;
+
+ if (skip)
+ return TRUE;
+
+ if (override)
+ {
+ /* Here SHORTNAME is a versioned name, so we don't expect to see
+ the type of override we do in the case above unless it is
+ overridden by a versioned definiton. */
+ if (hi->root.type != bfd_link_hash_defined
+ && hi->root.type != bfd_link_hash_defweak)
+ (*_bfd_error_handler)
+ (_("%s: warning: unexpected redefinition of indirect versioned symbol `%s'"),
+ bfd_archive_filename (abfd), shortname);
+ }
+ else
+ {
+ 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, &bh)))
+ return FALSE;
+ hi = (struct elf_link_hash_entry *) bh;
+
+ /* If there is a duplicate definition somewhere, then HI may not
+ point to an indirect symbol. We will have reported an error
+ to the user in that case. */
+
+ if (hi->root.type == bfd_link_hash_indirect)
+ {
+ /* If the symbol became indirect, then we assume that we have
+ not seen a definition before. */
+ BFD_ASSERT ((hi->elf_link_hash_flags
+ & (ELF_LINK_HASH_DEF_DYNAMIC
+ | ELF_LINK_HASH_DEF_REGULAR)) == 0);
+
+ (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi);
+
+ /* See if the new flags lead us to realize that the symbol
+ must be dynamic. */
+ if (! *dynsym)
+ {
+ if (! dynamic)
+ {
+ if (info->shared
+ || ((hi->elf_link_hash_flags
+ & ELF_LINK_HASH_REF_DYNAMIC) != 0))
+ *dynsym = TRUE;
+ }
+ else
+ {
+ if ((hi->elf_link_hash_flags
+ & ELF_LINK_HASH_REF_REGULAR) != 0)
+ *dynsym = TRUE;
+ }
+ }
+ }
+ }
+
+ return TRUE;
+}
+
+/* This routine is used to export all defined symbols into the dynamic
+ symbol table. It is called via elf_link_hash_traverse. */
+
+bfd_boolean
+_bfd_elf_export_symbol (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ struct elf_info_failed *eif = (struct elf_info_failed *) data;
+
+ /* Ignore indirect symbols. These are added by the versioning code. */
+ if (h->root.type == bfd_link_hash_indirect)
+ return TRUE;
+
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ if (h->dynindx == -1
+ && (h->elf_link_hash_flags
+ & (ELF_LINK_HASH_DEF_REGULAR | ELF_LINK_HASH_REF_REGULAR)) != 0)
+ {
+ struct bfd_elf_version_tree *t;
+ struct bfd_elf_version_expr *d;
+
+ for (t = eif->verdefs; t != NULL; t = t->next)
+ {
+ if (t->globals != NULL)
+ {
+ for (d = t->globals; d != NULL; d = d->next)
+ {
+ if ((*d->match) (d, h->root.root.string))
+ goto doit;
+ }
+ }
+
+ if (t->locals != NULL)
+ {
+ for (d = t->locals ; d != NULL; d = d->next)
+ {
+ if ((*d->match) (d, h->root.root.string))
+ return TRUE;
+ }
+ }
+ }
+
+ if (!eif->verdefs)
+ {
+ doit:
+ if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
+ {
+ eif->failed = TRUE;
+ return FALSE;
+ }
+ }
+ }
+
+ return TRUE;
+}
+
+/* Look through the symbols which are defined in other shared
+ libraries and referenced here. Update the list of version
+ dependencies. This will be put into the .gnu.version_r section.
+ This function is called via elf_link_hash_traverse. */
+
+bfd_boolean
+_bfd_elf_link_find_version_dependencies (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ struct elf_find_verdep_info *rinfo = (struct elf_find_verdep_info *) data;
+ Elf_Internal_Verneed *t;
+ Elf_Internal_Vernaux *a;
+ bfd_size_type amt;
+
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ /* We only care about symbols defined in shared objects with version
+ information. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
+ || h->dynindx == -1
+ || h->verinfo.verdef == NULL)
+ return TRUE;
+
+ /* See if we already know about this version. */
+ for (t = elf_tdata (rinfo->output_bfd)->verref; t != NULL; t = t->vn_nextref)
+ {
+ if (t->vn_bfd != h->verinfo.verdef->vd_bfd)
+ continue;
+
+ for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
+ if (a->vna_nodename == h->verinfo.verdef->vd_nodename)
+ return TRUE;
+
+ break;
+ }
+
+ /* This is a new version. Add it to tree we are building. */
+
+ if (t == NULL)
+ {
+ amt = sizeof *t;
+ t = (Elf_Internal_Verneed *) bfd_zalloc (rinfo->output_bfd, amt);
+ if (t == NULL)
+ {
+ rinfo->failed = TRUE;
+ return FALSE;
+ }
+
+ t->vn_bfd = h->verinfo.verdef->vd_bfd;
+ t->vn_nextref = elf_tdata (rinfo->output_bfd)->verref;
+ elf_tdata (rinfo->output_bfd)->verref = t;
+ }
+
+ amt = sizeof *a;
+ a = (Elf_Internal_Vernaux *) bfd_zalloc (rinfo->output_bfd, amt);
+
+ /* Note that we are copying a string pointer here, and testing it
+ above. If bfd_elf_string_from_elf_section is ever changed to
+ discard the string data when low in memory, this will have to be
+ fixed. */
+ a->vna_nodename = h->verinfo.verdef->vd_nodename;
+
+ a->vna_flags = h->verinfo.verdef->vd_flags;
+ a->vna_nextptr = t->vn_auxptr;
+
+ h->verinfo.verdef->vd_exp_refno = rinfo->vers;
+ ++rinfo->vers;
+
+ a->vna_other = h->verinfo.verdef->vd_exp_refno + 1;
+
+ t->vn_auxptr = a;
+
+ return TRUE;
+}
+
+/* Figure out appropriate versions for all the symbols. We may not
+ have the version number script until we have read all of the input
+ files, so until that point we don't know which symbols should be
+ local. This function is called via elf_link_hash_traverse. */
+
+bfd_boolean
+_bfd_elf_link_assign_sym_version (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ struct elf_assign_sym_version_info *sinfo;
+ struct bfd_link_info *info;
+ struct elf_backend_data *bed;
+ struct elf_info_failed eif;
+ char *p;
+ bfd_size_type amt;
+
+ sinfo = (struct elf_assign_sym_version_info *) data;
+ info = sinfo->info;
+
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ /* Fix the symbol flags. */
+ eif.failed = FALSE;
+ eif.info = info;
+ if (! _bfd_elf_fix_symbol_flags (h, &eif))
+ {
+ if (eif.failed)
+ sinfo->failed = TRUE;
+ return FALSE;
+ }
+
+ /* We only need version numbers for symbols defined in regular
+ objects. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ return TRUE;
+
+ bed = get_elf_backend_data (sinfo->output_bfd);
+ p = strchr (h->root.root.string, ELF_VER_CHR);
+ if (p != NULL && h->verinfo.vertree == NULL)
+ {
+ struct bfd_elf_version_tree *t;
+ bfd_boolean hidden;
+
+ hidden = TRUE;
+
+ /* There are two consecutive ELF_VER_CHR characters if this is
+ not a hidden symbol. */
+ ++p;
+ if (*p == ELF_VER_CHR)
+ {
+ hidden = FALSE;
+ ++p;
+ }
+
+ /* If there is no version string, we can just return out. */
+ if (*p == '\0')
+ {
+ if (hidden)
+ h->elf_link_hash_flags |= ELF_LINK_HIDDEN;
+ return TRUE;
+ }
+
+ /* Look for the version. If we find it, it is no longer weak. */
+ for (t = sinfo->verdefs; t != NULL; t = t->next)
+ {
+ if (strcmp (t->name, p) == 0)
+ {
+ size_t len;
+ char *alc;
+ struct bfd_elf_version_expr *d;
+
+ len = p - h->root.root.string;
+ alc = bfd_malloc ((bfd_size_type) len);
+ if (alc == NULL)
+ return FALSE;
+ memcpy (alc, h->root.root.string, len - 1);
+ alc[len - 1] = '\0';
+ if (alc[len - 2] == ELF_VER_CHR)
+ alc[len - 2] = '\0';
+
+ h->verinfo.vertree = t;
+ t->used = TRUE;
+ d = NULL;
+
+ if (t->globals != NULL)
+ {
+ for (d = t->globals; d != NULL; d = d->next)
+ if ((*d->match) (d, alc))
+ break;
+ }
+
+ /* See if there is anything to force this symbol to
+ local scope. */
+ if (d == NULL && t->locals != NULL)
+ {
+ for (d = t->locals; d != NULL; d = d->next)
+ {
+ if ((*d->match) (d, alc))
+ {
+ if (h->dynindx != -1
+ && info->shared
+ && ! info->export_dynamic)
+ {
+ (*bed->elf_backend_hide_symbol) (info, h, TRUE);
+ }
+
+ break;
+ }
+ }
+ }
+
+ free (alc);
+ break;
+ }
+ }
+
+ /* If we are building an application, we need to create a
+ version node for this version. */
+ if (t == NULL && ! info->shared)
+ {
+ struct bfd_elf_version_tree **pp;
+ int version_index;
+
+ /* If we aren't going to export this symbol, we don't need
+ to worry about it. */
+ if (h->dynindx == -1)
+ return TRUE;
+
+ amt = sizeof *t;
+ t = ((struct bfd_elf_version_tree *)
+ bfd_alloc (sinfo->output_bfd, amt));
+ if (t == NULL)
+ {
+ sinfo->failed = TRUE;
+ return FALSE;
+ }
+
+ t->next = NULL;
+ t->name = p;
+ t->globals = NULL;
+ t->locals = NULL;
+ t->deps = NULL;
+ t->name_indx = (unsigned int) -1;
+ t->used = TRUE;
+
+ version_index = 1;
+ /* Don't count anonymous version tag. */
+ if (sinfo->verdefs != NULL && sinfo->verdefs->vernum == 0)
+ version_index = 0;
+ for (pp = &sinfo->verdefs; *pp != NULL; pp = &(*pp)->next)
+ ++version_index;
+ t->vernum = version_index;
+
+ *pp = t;
+
+ h->verinfo.vertree = t;
+ }
+ else if (t == NULL)
+ {
+ /* We could not find the version for a symbol when
+ generating a shared archive. Return an error. */
+ (*_bfd_error_handler)
+ (_("%s: undefined versioned symbol name %s"),
+ bfd_get_filename (sinfo->output_bfd), h->root.root.string);
+ bfd_set_error (bfd_error_bad_value);
+ sinfo->failed = TRUE;
+ return FALSE;
+ }
+
+ if (hidden)
+ h->elf_link_hash_flags |= ELF_LINK_HIDDEN;
+ }
+
+ /* If we don't have a version for this symbol, see if we can find
+ something. */
+ if (h->verinfo.vertree == NULL && sinfo->verdefs != NULL)
+ {
+ struct bfd_elf_version_tree *t;
+ struct bfd_elf_version_tree *local_ver;
+ struct bfd_elf_version_expr *d;
+
+ /* See if can find what version this symbol is in. If the
+ symbol is supposed to be local, then don't actually register
+ it. */
+ local_ver = NULL;
+ for (t = sinfo->verdefs; t != NULL; t = t->next)
+ {
+ if (t->globals != NULL)
+ {
+ bfd_boolean matched;
+
+ matched = FALSE;
+ for (d = t->globals; d != NULL; d = d->next)
+ {
+ if ((*d->match) (d, h->root.root.string))
+ {
+ if (d->symver)
+ matched = TRUE;
+ else
+ {
+ /* There is a version without definition. Make
+ the symbol the default definition for this
+ version. */
+ h->verinfo.vertree = t;
+ local_ver = NULL;
+ d->script = 1;
+ break;
+ }
+ }
+ }
+
+ if (d != NULL)
+ break;
+ else if (matched)
+ /* There is no undefined version for this symbol. Hide the
+ default one. */
+ (*bed->elf_backend_hide_symbol) (info, h, TRUE);
+ }
+
+ if (t->locals != NULL)
+ {
+ for (d = t->locals; d != NULL; d = d->next)
+ {
+ /* If the match is "*", keep looking for a more
+ explicit, perhaps even global, match. */
+ if (d->pattern[0] == '*' && d->pattern[1] == '\0')
+ local_ver = t;
+ else if ((*d->match) (d, h->root.root.string))
+ {
+ local_ver = t;
+ break;
+ }
+ }
+
+ if (d != NULL)
+ break;
+ }
+ }
+
+ if (local_ver != NULL)
+ {
+ h->verinfo.vertree = local_ver;
+ if (h->dynindx != -1
+ && info->shared
+ && ! info->export_dynamic)
+ {
+ (*bed->elf_backend_hide_symbol) (info, h, TRUE);
+ }
+ }
+ }
+
+ return TRUE;
+}
/* Create a special linker section, or return a pointer to a linker
section already created */
@@ -650,3 +2067,585 @@ _bfd_elf_make_linker_section_rela (dynobj, lsect, alignment)
return TRUE;
}
+
+/* Read and swap the relocs from the section indicated by SHDR. This
+ may be either a REL or a RELA section. The relocations are
+ translated into RELA relocations and stored in INTERNAL_RELOCS,
+ which should have already been allocated to contain enough space.
+ The EXTERNAL_RELOCS are a buffer where the external form of the
+ relocations should be stored.
+
+ Returns FALSE if something goes wrong. */
+
+static bfd_boolean
+elf_link_read_relocs_from_section (abfd, shdr, external_relocs,
+ internal_relocs)
+ bfd *abfd;
+ Elf_Internal_Shdr *shdr;
+ PTR external_relocs;
+ Elf_Internal_Rela *internal_relocs;
+{
+ struct elf_backend_data *bed;
+ void (*swap_in) PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
+ const bfd_byte *erela;
+ const bfd_byte *erelaend;
+ Elf_Internal_Rela *irela;
+
+ /* If there aren't any relocations, that's OK. */
+ if (!shdr)
+ return TRUE;
+
+ /* Position ourselves at the start of the section. */
+ if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0)
+ return FALSE;
+
+ /* Read the relocations. */
+ if (bfd_bread (external_relocs, shdr->sh_size, abfd) != shdr->sh_size)
+ return FALSE;
+
+ bed = get_elf_backend_data (abfd);
+
+ /* Convert the external relocations to the internal format. */
+ if (shdr->sh_entsize == bed->s->sizeof_rel)
+ swap_in = bed->s->swap_reloc_in;
+ else if (shdr->sh_entsize == bed->s->sizeof_rela)
+ swap_in = bed->s->swap_reloca_in;
+ else
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return FALSE;
+ }
+
+ erela = external_relocs;
+ erelaend = erela + NUM_SHDR_ENTRIES (shdr) * shdr->sh_entsize;
+ irela = internal_relocs;
+ while (erela < erelaend)
+ {
+ (*swap_in) (abfd, erela, irela);
+ irela += bed->s->int_rels_per_ext_rel;
+ erela += shdr->sh_entsize;
+ }
+
+ return TRUE;
+}
+
+/* Read and swap the relocs for a section O. They may have been
+ cached. If the EXTERNAL_RELOCS and INTERNAL_RELOCS arguments are
+ not NULL, they are used as buffers to read into. They are known to
+ be large enough. If the INTERNAL_RELOCS relocs argument is NULL,
+ the return value is allocated using either malloc or bfd_alloc,
+ according to the KEEP_MEMORY argument. If O has two relocation
+ sections (both REL and RELA relocations), then the REL_HDR
+ relocations will appear first in INTERNAL_RELOCS, followed by the
+ REL_HDR2 relocations. */
+
+Elf_Internal_Rela *
+_bfd_elf_link_read_relocs (abfd, o, external_relocs, internal_relocs,
+ keep_memory)
+ bfd *abfd;
+ asection *o;
+ PTR external_relocs;
+ Elf_Internal_Rela *internal_relocs;
+ bfd_boolean keep_memory;
+{
+ Elf_Internal_Shdr *rel_hdr;
+ PTR alloc1 = NULL;
+ Elf_Internal_Rela *alloc2 = NULL;
+ struct elf_backend_data *bed = get_elf_backend_data (abfd);
+
+ if (elf_section_data (o)->relocs != NULL)
+ return elf_section_data (o)->relocs;
+
+ if (o->reloc_count == 0)
+ return NULL;
+
+ rel_hdr = &elf_section_data (o)->rel_hdr;
+
+ if (internal_relocs == NULL)
+ {
+ bfd_size_type size;
+
+ size = o->reloc_count;
+ size *= bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela);
+ if (keep_memory)
+ internal_relocs = (Elf_Internal_Rela *) bfd_alloc (abfd, size);
+ else
+ internal_relocs = alloc2 = (Elf_Internal_Rela *) bfd_malloc (size);
+ if (internal_relocs == NULL)
+ goto error_return;
+ }
+
+ if (external_relocs == NULL)
+ {
+ bfd_size_type size = rel_hdr->sh_size;
+
+ if (elf_section_data (o)->rel_hdr2)
+ size += elf_section_data (o)->rel_hdr2->sh_size;
+ alloc1 = (PTR) bfd_malloc (size);
+ if (alloc1 == NULL)
+ goto error_return;
+ external_relocs = alloc1;
+ }
+
+ if (!elf_link_read_relocs_from_section (abfd, rel_hdr,
+ external_relocs,
+ internal_relocs))
+ goto error_return;
+ if (!elf_link_read_relocs_from_section
+ (abfd,
+ elf_section_data (o)->rel_hdr2,
+ ((bfd_byte *) external_relocs) + rel_hdr->sh_size,
+ internal_relocs + (NUM_SHDR_ENTRIES (rel_hdr)
+ * bed->s->int_rels_per_ext_rel)))
+ goto error_return;
+
+ /* Cache the results for next time, if we can. */
+ if (keep_memory)
+ elf_section_data (o)->relocs = internal_relocs;
+
+ if (alloc1 != NULL)
+ free (alloc1);
+
+ /* Don't free alloc2, since if it was allocated we are passing it
+ back (under the name of internal_relocs). */
+
+ return internal_relocs;
+
+ error_return:
+ if (alloc1 != NULL)
+ free (alloc1);
+ if (alloc2 != NULL)
+ free (alloc2);
+ return NULL;
+}
+
+/* Compute the size of, and allocate space for, REL_HDR which is the
+ section header for a section containing relocations for O. */
+
+bfd_boolean
+_bfd_elf_link_size_reloc_section (abfd, rel_hdr, o)
+ bfd *abfd;
+ Elf_Internal_Shdr *rel_hdr;
+ asection *o;
+{
+ bfd_size_type reloc_count;
+ bfd_size_type num_rel_hashes;
+
+ /* Figure out how many relocations there will be. */
+ if (rel_hdr == &elf_section_data (o)->rel_hdr)
+ reloc_count = elf_section_data (o)->rel_count;
+ else
+ reloc_count = elf_section_data (o)->rel_count2;
+
+ num_rel_hashes = o->reloc_count;
+ if (num_rel_hashes < reloc_count)
+ num_rel_hashes = reloc_count;
+
+ /* That allows us to calculate the size of the section. */
+ rel_hdr->sh_size = rel_hdr->sh_entsize * reloc_count;
+
+ /* The contents field must last into write_object_contents, so we
+ allocate it with bfd_alloc rather than malloc. Also since we
+ cannot be sure that the contents will actually be filled in,
+ we zero the allocated space. */
+ rel_hdr->contents = (PTR) bfd_zalloc (abfd, rel_hdr->sh_size);
+ if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0)
+ return FALSE;
+
+ /* We only allocate one set of hash entries, so we only do it the
+ first time we are called. */
+ if (elf_section_data (o)->rel_hashes == NULL
+ && num_rel_hashes)
+ {
+ struct elf_link_hash_entry **p;
+
+ p = ((struct elf_link_hash_entry **)
+ bfd_zmalloc (num_rel_hashes
+ * sizeof (struct elf_link_hash_entry *)));
+ if (p == NULL)
+ return FALSE;
+
+ elf_section_data (o)->rel_hashes = p;
+ }
+
+ return TRUE;
+}
+
+/* Copy the relocations indicated by the INTERNAL_RELOCS (which
+ originated from the section given by INPUT_REL_HDR) to the
+ OUTPUT_BFD. */
+
+bfd_boolean
+_bfd_elf_link_output_relocs (output_bfd, input_section, input_rel_hdr,
+ internal_relocs)
+ bfd *output_bfd;
+ asection *input_section;
+ Elf_Internal_Shdr *input_rel_hdr;
+ Elf_Internal_Rela *internal_relocs;
+{
+ Elf_Internal_Rela *irela;
+ Elf_Internal_Rela *irelaend;
+ bfd_byte *erel;
+ Elf_Internal_Shdr *output_rel_hdr;
+ asection *output_section;
+ unsigned int *rel_countp = NULL;
+ struct elf_backend_data *bed;
+ void (*swap_out) PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
+
+ output_section = input_section->output_section;
+ output_rel_hdr = NULL;
+
+ if (elf_section_data (output_section)->rel_hdr.sh_entsize
+ == input_rel_hdr->sh_entsize)
+ {
+ output_rel_hdr = &elf_section_data (output_section)->rel_hdr;
+ rel_countp = &elf_section_data (output_section)->rel_count;
+ }
+ else if (elf_section_data (output_section)->rel_hdr2
+ && (elf_section_data (output_section)->rel_hdr2->sh_entsize
+ == input_rel_hdr->sh_entsize))
+ {
+ output_rel_hdr = elf_section_data (output_section)->rel_hdr2;
+ rel_countp = &elf_section_data (output_section)->rel_count2;
+ }
+ else
+ {
+ (*_bfd_error_handler)
+ (_("%s: relocation size mismatch in %s section %s"),
+ bfd_get_filename (output_bfd),
+ bfd_archive_filename (input_section->owner),
+ input_section->name);
+ bfd_set_error (bfd_error_wrong_object_format);
+ return FALSE;
+ }
+
+ bed = get_elf_backend_data (output_bfd);
+ if (input_rel_hdr->sh_entsize == bed->s->sizeof_rel)
+ swap_out = bed->s->swap_reloc_out;
+ else if (input_rel_hdr->sh_entsize == bed->s->sizeof_rela)
+ swap_out = bed->s->swap_reloca_out;
+ else
+ abort ();
+
+ erel = output_rel_hdr->contents;
+ erel += *rel_countp * input_rel_hdr->sh_entsize;
+ irela = internal_relocs;
+ irelaend = irela + (NUM_SHDR_ENTRIES (input_rel_hdr)
+ * bed->s->int_rels_per_ext_rel);
+ while (irela < irelaend)
+ {
+ (*swap_out) (output_bfd, irela, erel);
+ irela += bed->s->int_rels_per_ext_rel;
+ erel += input_rel_hdr->sh_entsize;
+ }
+
+ /* Bump the counter, so that we know where to add the next set of
+ relocations. */
+ *rel_countp += NUM_SHDR_ENTRIES (input_rel_hdr);
+
+ return TRUE;
+}
+
+/* Fix up the flags for a symbol. This handles various cases which
+ can only be fixed after all the input files are seen. This is
+ currently called by both adjust_dynamic_symbol and
+ assign_sym_version, which is unnecessary but perhaps more robust in
+ the face of future changes. */
+
+bfd_boolean
+_bfd_elf_fix_symbol_flags (h, eif)
+ struct elf_link_hash_entry *h;
+ struct elf_info_failed *eif;
+{
+ /* If this symbol was mentioned in a non-ELF file, try to set
+ DEF_REGULAR and REF_REGULAR correctly. This is the only way to
+ permit a non-ELF file to correctly refer to a symbol defined in
+ an ELF dynamic object. */
+ if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) != 0)
+ {
+ while (h->root.type == bfd_link_hash_indirect)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ if (h->root.type != bfd_link_hash_defined
+ && h->root.type != bfd_link_hash_defweak)
+ h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK);
+ else
+ {
+ if (h->root.u.def.section->owner != NULL
+ && (bfd_get_flavour (h->root.u.def.section->owner)
+ == bfd_target_elf_flavour))
+ h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK);
+ else
+ h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+ }
+
+ if (h->dynindx == -1
+ && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0))
+ {
+ if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
+ {
+ eif->failed = TRUE;
+ return FALSE;
+ }
+ }
+ }
+ else
+ {
+ /* Unfortunately, ELF_LINK_NON_ELF is only correct if the symbol
+ was first seen in a non-ELF file. Fortunately, if the symbol
+ was first seen in an ELF file, we're probably OK unless the
+ symbol was defined in a non-ELF file. Catch that case here.
+ FIXME: We're still in trouble if the symbol was first seen in
+ a dynamic object, and then later in a non-ELF regular object. */
+ if ((h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+ && (h->root.u.def.section->owner != NULL
+ ? (bfd_get_flavour (h->root.u.def.section->owner)
+ != bfd_target_elf_flavour)
+ : (bfd_is_abs_section (h->root.u.def.section)
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC) == 0)))
+ h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+ }
+
+ /* If this is a final link, and the symbol was defined as a common
+ symbol in a regular object file, and there was no definition in
+ any dynamic object, then the linker will have allocated space for
+ the symbol in a common section but the ELF_LINK_HASH_DEF_REGULAR
+ flag will not have been set. */
+ if (h->root.type == bfd_link_hash_defined
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+ && (h->root.u.def.section->owner->flags & DYNAMIC) == 0)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+
+ /* If -Bsymbolic was used (which means to bind references to global
+ symbols to the definition within the shared object), and this
+ symbol was defined in a regular object, then it actually doesn't
+ need a PLT entry, and we can accomplish that by forcing it local.
+ Likewise, if the symbol has hidden or internal visibility.
+ FIXME: It might be that we also do not need a PLT for other
+ non-hidden visibilities, but we would have to tell that to the
+ backend specifically; we can't just clear PLT-related data here. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
+ && eif->info->shared
+ && is_elf_hash_table (eif->info)
+ && (eif->info->symbolic
+ || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
+ || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
+ {
+ struct elf_backend_data *bed;
+ bfd_boolean force_local;
+
+ bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
+
+ force_local = (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
+ || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN);
+ (*bed->elf_backend_hide_symbol) (eif->info, h, force_local);
+ }
+
+ /* If a weak undefined symbol has non-default visibility, we also
+ hide it from the dynamic linker. */
+ if (ELF_ST_VISIBILITY (h->other)
+ && h->root.type == bfd_link_hash_undefweak)
+ {
+ struct elf_backend_data *bed;
+ bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
+ (*bed->elf_backend_hide_symbol) (eif->info, h, TRUE);
+ }
+
+ /* If this is a weak defined symbol in a dynamic object, and we know
+ the real definition in the dynamic object, copy interesting flags
+ over to the real definition. */
+ if (h->weakdef != NULL)
+ {
+ struct elf_link_hash_entry *weakdef;
+
+ weakdef = h->weakdef;
+ if (h->root.type == bfd_link_hash_indirect)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ BFD_ASSERT (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak);
+ BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined
+ || weakdef->root.type == bfd_link_hash_defweak);
+ BFD_ASSERT (weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC);
+
+ /* If the real definition is defined by a regular object file,
+ don't do anything special. See the longer description in
+ _bfd_elf_adjust_dynamic_symbol, below. */
+ if ((weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
+ h->weakdef = NULL;
+ else
+ {
+ struct elf_backend_data *bed;
+
+ bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
+ (*bed->elf_backend_copy_indirect_symbol) (bed, weakdef, h);
+ }
+ }
+
+ return TRUE;
+}
+
+/* Make the backend pick a good value for a dynamic symbol. This is
+ called via elf_link_hash_traverse, and also calls itself
+ recursively. */
+
+bfd_boolean
+_bfd_elf_adjust_dynamic_symbol (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ struct elf_info_failed *eif = (struct elf_info_failed *) data;
+ bfd *dynobj;
+ struct elf_backend_data *bed;
+
+ if (! is_elf_hash_table (eif->info))
+ return FALSE;
+
+ if (h->root.type == bfd_link_hash_warning)
+ {
+ h->plt = elf_hash_table (eif->info)->init_offset;
+ h->got = elf_hash_table (eif->info)->init_offset;
+
+ /* When warning symbols are created, they **replace** the "real"
+ entry in the hash table, thus we never get to see the real
+ symbol in a hash traversal. So look at it now. */
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ }
+
+ /* Ignore indirect symbols. These are added by the versioning code. */
+ if (h->root.type == bfd_link_hash_indirect)
+ return TRUE;
+
+ /* Fix the symbol flags. */
+ if (! _bfd_elf_fix_symbol_flags (h, eif))
+ return FALSE;
+
+ /* If this symbol does not require a PLT entry, and it is not
+ defined by a dynamic object, or is not referenced by a regular
+ object, ignore it. We do have to handle a weak defined symbol,
+ even if no regular object refers to it, if we decided to add it
+ to the dynamic symbol table. FIXME: Do we normally need to worry
+ about symbols which are defined by one dynamic object and
+ referenced by another one? */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0
+ && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+ || ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
+ && (h->weakdef == NULL || h->weakdef->dynindx == -1))))
+ {
+ h->plt = elf_hash_table (eif->info)->init_offset;
+ return TRUE;
+ }
+
+ /* If we've already adjusted this symbol, don't do it again. This
+ can happen via a recursive call. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+ return TRUE;
+
+ /* Don't look at this symbol again. Note that we must set this
+ after checking the above conditions, because we may look at a
+ symbol once, decide not to do anything, and then get called
+ recursively later after REF_REGULAR is set below. */
+ h->elf_link_hash_flags |= ELF_LINK_HASH_DYNAMIC_ADJUSTED;
+
+ /* If this is a weak definition, and we know a real definition, and
+ the real symbol is not itself defined by a regular object file,
+ then get a good value for the real definition. We handle the
+ real symbol first, for the convenience of the backend routine.
+
+ Note that there is a confusing case here. If the real definition
+ is defined by a regular object file, we don't get the real symbol
+ from the dynamic object, but we do get the weak symbol. If the
+ processor backend uses a COPY reloc, then if some routine in the
+ dynamic object changes the real symbol, we will not see that
+ change in the corresponding weak symbol. This is the way other
+ ELF linkers work as well, and seems to be a result of the shared
+ library model.
+
+ I will clarify this issue. Most SVR4 shared libraries define the
+ variable _timezone and define timezone as a weak synonym. The
+ tzset call changes _timezone. If you write
+ extern int timezone;
+ int _timezone = 5;
+ int main () { tzset (); printf ("%d %d\n", timezone, _timezone); }
+ you might expect that, since timezone is a synonym for _timezone,
+ the same number will print both times. However, if the processor
+ backend uses a COPY reloc, then actually timezone will be copied
+ into your process image, and, since you define _timezone
+ yourself, _timezone will not. Thus timezone and _timezone will
+ wind up at different memory locations. The tzset call will set
+ _timezone, leaving timezone unchanged. */
+
+ if (h->weakdef != NULL)
+ {
+ /* If we get to this point, we know there is an implicit
+ reference by a regular object file via the weak symbol H.
+ FIXME: Is this really true? What if the traversal finds
+ H->WEAKDEF before it finds H? */
+ h->weakdef->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+
+ if (! _bfd_elf_adjust_dynamic_symbol (h->weakdef, (PTR) eif))
+ return FALSE;
+ }
+
+ /* If a symbol has no type and no size and does not require a PLT
+ entry, then we are probably about to do the wrong thing here: we
+ are probably going to create a COPY reloc for an empty object.
+ This case can arise when a shared object is built with assembly
+ code, and the assembly code fails to set the symbol type. */
+ if (h->size == 0
+ && h->type == STT_NOTYPE
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0)
+ (*_bfd_error_handler)
+ (_("warning: type and size of dynamic symbol `%s' are not defined"),
+ h->root.root.string);
+
+ dynobj = elf_hash_table (eif->info)->dynobj;
+ bed = get_elf_backend_data (dynobj);
+ if (! (*bed->elf_backend_adjust_dynamic_symbol) (eif->info, h))
+ {
+ eif->failed = TRUE;
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* Adjust all external symbols pointing into SEC_MERGE sections
+ to reflect the object merging within the sections. */
+
+bfd_boolean
+_bfd_elf_link_sec_merge_syms (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ asection *sec;
+
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ if ((h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && ((sec = h->root.u.def.section)->flags & SEC_MERGE)
+ && sec->sec_info_type == ELF_INFO_TYPE_MERGE)
+ {
+ bfd *output_bfd = (bfd *) data;
+
+ h->root.u.def.value =
+ _bfd_merged_section_offset (output_bfd,
+ &h->root.u.def.section,
+ elf_section_data (sec)->sec_info,
+ h->root.u.def.value, (bfd_vma) 0);
+ }
+
+ return TRUE;
+}
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 12f91ef4ef5..2c025edceee 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -20,16 +20,6 @@
/* ELF linker code. */
-/* This struct is used to pass information to routines called via
- elf_link_hash_traverse which must return failure. */
-
-struct elf_info_failed
-{
- bfd_boolean failed;
- struct bfd_link_info *info;
- struct bfd_elf_version_tree *verdefs;
-};
-
static bfd_boolean is_global_data_symbol_definition
PARAMS ((bfd *, Elf_Internal_Sym *));
static bfd_boolean elf_link_is_defined_archive_symbol
@@ -38,37 +28,12 @@ static bfd_boolean elf_link_add_object_symbols
PARAMS ((bfd *, struct bfd_link_info *));
static bfd_boolean elf_link_add_archive_symbols
PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean elf_merge_symbol
- PARAMS ((bfd *, struct bfd_link_info *, const char *,
- Elf_Internal_Sym *, asection **, bfd_vma *,
- struct elf_link_hash_entry **, bfd_boolean *, bfd_boolean *,
- bfd_boolean *, bfd_boolean));
-static bfd_boolean elf_add_default_symbol
- PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
- const char *, Elf_Internal_Sym *, asection **, bfd_vma *,
- bfd_boolean *, bfd_boolean, bfd_boolean));
-static bfd_boolean elf_export_symbol
- PARAMS ((struct elf_link_hash_entry *, PTR));
static bfd_boolean elf_finalize_dynstr
PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean elf_fix_symbol_flags
- PARAMS ((struct elf_link_hash_entry *, struct elf_info_failed *));
-static bfd_boolean elf_adjust_dynamic_symbol
- PARAMS ((struct elf_link_hash_entry *, PTR));
-static bfd_boolean elf_link_find_version_dependencies
- PARAMS ((struct elf_link_hash_entry *, PTR));
-static bfd_boolean elf_link_assign_sym_version
- PARAMS ((struct elf_link_hash_entry *, PTR));
static bfd_boolean elf_collect_hash_codes
PARAMS ((struct elf_link_hash_entry *, PTR));
-static bfd_boolean elf_link_read_relocs_from_section
- PARAMS ((bfd *, Elf_Internal_Shdr *, PTR, Elf_Internal_Rela *));
static size_t compute_bucket_count
PARAMS ((struct bfd_link_info *));
-static bfd_boolean elf_link_output_relocs
- PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *));
-static bfd_boolean elf_link_size_reloc_section
- PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
static void elf_link_adjust_relocs
PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned int,
struct elf_link_hash_entry **));
@@ -450,701 +415,6 @@ elf_link_add_archive_symbols (abfd, info)
return FALSE;
}
-/* This function is called when we want to define a new symbol. It
- handles the various cases which arise when we find a definition in
- a dynamic object, or when there is already a definition in a
- dynamic object. The new symbol is described by NAME, SYM, PSEC,
- and PVALUE. We set SYM_HASH to the hash table entry. We set
- OVERRIDE if the old symbol is overriding a new definition. We set
- TYPE_CHANGE_OK if it is OK for the type to change. We set
- SIZE_CHANGE_OK if it is OK for the size to change. By OK to
- change, we mean that we shouldn't warn if the type or size does
- change. DT_NEEDED indicates if it comes from a DT_NEEDED entry of
- a shared object. */
-
-static bfd_boolean
-elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
- override, type_change_ok, size_change_ok, dt_needed)
- bfd *abfd;
- struct bfd_link_info *info;
- const char *name;
- Elf_Internal_Sym *sym;
- asection **psec;
- bfd_vma *pvalue;
- struct elf_link_hash_entry **sym_hash;
- bfd_boolean *override;
- bfd_boolean *type_change_ok;
- bfd_boolean *size_change_ok;
- bfd_boolean dt_needed;
-{
- asection *sec;
- struct elf_link_hash_entry *h;
- int bind;
- bfd *oldbfd;
- bfd_boolean newdyn, olddyn, olddef, newdef, newdyncommon, olddyncommon;
-
- *override = FALSE;
-
- sec = *psec;
- bind = ELF_ST_BIND (sym->st_info);
-
- if (! bfd_is_und_section (sec))
- h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, FALSE, FALSE);
- else
- h = ((struct elf_link_hash_entry *)
- bfd_wrapped_link_hash_lookup (abfd, info, name, TRUE, FALSE, FALSE));
- if (h == NULL)
- return FALSE;
- *sym_hash = h;
-
- /* This code is for coping with dynamic objects, and is only useful
- if we are doing an ELF link. */
- if (info->hash->creator != abfd->xvec)
- return TRUE;
-
- /* For merging, we only care about real symbols. */
-
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- /* If we just created the symbol, mark it as being an ELF symbol.
- Other than that, there is nothing to do--there is no merge issue
- with a newly defined symbol--so we just return. */
-
- if (h->root.type == bfd_link_hash_new)
- {
- h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
- return TRUE;
- }
-
- /* OLDBFD is a BFD associated with the existing symbol. */
-
- switch (h->root.type)
- {
- default:
- oldbfd = NULL;
- break;
-
- case bfd_link_hash_undefined:
- case bfd_link_hash_undefweak:
- oldbfd = h->root.u.undef.abfd;
- break;
-
- case bfd_link_hash_defined:
- case bfd_link_hash_defweak:
- oldbfd = h->root.u.def.section->owner;
- break;
-
- case bfd_link_hash_common:
- oldbfd = h->root.u.c.p->section->owner;
- break;
- }
-
- /* In cases involving weak versioned symbols, we may wind up trying
- to merge a symbol with itself. Catch that here, to avoid the
- confusion that results if we try to override a symbol with
- itself. The additional tests catch cases like
- _GLOBAL_OFFSET_TABLE_, which are regular symbols defined in a
- dynamic object, which we do want to handle here. */
- if (abfd == oldbfd
- && ((abfd->flags & DYNAMIC) == 0
- || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))
- return TRUE;
-
- /* NEWDYN and OLDDYN indicate whether the new or old symbol,
- respectively, is from a dynamic object. */
-
- if ((abfd->flags & DYNAMIC) != 0)
- newdyn = TRUE;
- else
- newdyn = FALSE;
-
- if (oldbfd != NULL)
- olddyn = (oldbfd->flags & DYNAMIC) != 0;
- else
- {
- asection *hsec;
-
- /* This code handles the special SHN_MIPS_{TEXT,DATA} section
- indices used by MIPS ELF. */
- switch (h->root.type)
- {
- default:
- hsec = NULL;
- break;
-
- case bfd_link_hash_defined:
- case bfd_link_hash_defweak:
- hsec = h->root.u.def.section;
- break;
-
- case bfd_link_hash_common:
- hsec = h->root.u.c.p->section;
- break;
- }
-
- if (hsec == NULL)
- olddyn = FALSE;
- else
- olddyn = (hsec->symbol->flags & BSF_DYNAMIC) != 0;
- }
-
- /* NEWDEF and OLDDEF indicate whether the new or old symbol,
- respectively, appear to be a definition rather than reference. */
-
- if (bfd_is_und_section (sec) || bfd_is_com_section (sec))
- newdef = FALSE;
- else
- newdef = TRUE;
-
- if (h->root.type == bfd_link_hash_undefined
- || h->root.type == bfd_link_hash_undefweak
- || h->root.type == bfd_link_hash_common)
- olddef = FALSE;
- else
- olddef = TRUE;
-
- /* NEWDYNCOMMON and OLDDYNCOMMON indicate whether the new or old
- symbol, respectively, appears to be a common symbol in a dynamic
- object. If a symbol appears in an uninitialized section, and is
- not weak, and is not a function, then it may be a common symbol
- which was resolved when the dynamic object was created. We want
- to treat such symbols specially, because they raise special
- considerations when setting the symbol size: if the symbol
- appears as a common symbol in a regular object, and the size in
- the regular object is larger, we must make sure that we use the
- larger size. This problematic case can always be avoided in C,
- but it must be handled correctly when using Fortran shared
- libraries.
-
- Note that if NEWDYNCOMMON is set, NEWDEF will be set, and
- likewise for OLDDYNCOMMON and OLDDEF.
-
- Note that this test is just a heuristic, and that it is quite
- possible to have an uninitialized symbol in a shared object which
- is really a definition, rather than a common symbol. This could
- lead to some minor confusion when the symbol really is a common
- symbol in some regular object. However, I think it will be
- harmless. */
-
- if (newdyn
- && newdef
- && (sec->flags & SEC_ALLOC) != 0
- && (sec->flags & SEC_LOAD) == 0
- && sym->st_size > 0
- && bind != STB_WEAK
- && ELF_ST_TYPE (sym->st_info) != STT_FUNC)
- newdyncommon = TRUE;
- else
- newdyncommon = FALSE;
-
- if (olddyn
- && olddef
- && h->root.type == bfd_link_hash_defined
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && (h->root.u.def.section->flags & SEC_ALLOC) != 0
- && (h->root.u.def.section->flags & SEC_LOAD) == 0
- && h->size > 0
- && h->type != STT_FUNC)
- olddyncommon = TRUE;
- else
- olddyncommon = FALSE;
-
- /* It's OK to change the type if either the existing symbol or the
- new symbol is weak unless it comes from a DT_NEEDED entry of
- a shared object, in which case, the DT_NEEDED entry may not be
- required at the run time. */
-
- if ((! dt_needed && h->root.type == bfd_link_hash_defweak)
- || h->root.type == bfd_link_hash_undefweak
- || bind == STB_WEAK)
- *type_change_ok = TRUE;
-
- /* It's OK to change the size if either the existing symbol or the
- new symbol is weak, or if the old symbol is undefined. */
-
- if (*type_change_ok
- || h->root.type == bfd_link_hash_undefined)
- *size_change_ok = TRUE;
-
- /* If both the old and the new symbols look like common symbols in a
- dynamic object, set the size of the symbol to the larger of the
- two. */
-
- if (olddyncommon
- && newdyncommon
- && sym->st_size != h->size)
- {
- /* Since we think we have two common symbols, issue a multiple
- common warning if desired. Note that we only warn if the
- size is different. If the size is the same, we simply let
- the old symbol override the new one as normally happens with
- symbols defined in dynamic objects. */
-
- if (! ((*info->callbacks->multiple_common)
- (info, h->root.root.string, oldbfd, bfd_link_hash_common,
- h->size, abfd, bfd_link_hash_common, sym->st_size)))
- return FALSE;
-
- if (sym->st_size > h->size)
- h->size = sym->st_size;
-
- *size_change_ok = TRUE;
- }
-
- /* If we are looking at a dynamic object, and we have found a
- definition, we need to see if the symbol was already defined by
- some other object. If so, we want to use the existing
- definition, and we do not want to report a multiple symbol
- definition error; we do this by clobbering *PSEC to be
- bfd_und_section_ptr.
-
- We treat a common symbol as a definition if the symbol in the
- shared library is a function, since common symbols always
- represent variables; this can cause confusion in principle, but
- any such confusion would seem to indicate an erroneous program or
- shared library. We also permit a common symbol in a regular
- object to override a weak symbol in a shared object.
-
- We prefer a non-weak definition in a shared library to a weak
- definition in the executable unless it comes from a DT_NEEDED
- entry of a shared object, in which case, the DT_NEEDED entry
- may not be required at the run time. */
-
- if (newdyn
- && newdef
- && (olddef
- || (h->root.type == bfd_link_hash_common
- && (bind == STB_WEAK
- || ELF_ST_TYPE (sym->st_info) == STT_FUNC)))
- && (h->root.type != bfd_link_hash_defweak
- || dt_needed
- || bind == STB_WEAK))
- {
- *override = TRUE;
- newdef = FALSE;
- newdyncommon = FALSE;
-
- *psec = sec = bfd_und_section_ptr;
- *size_change_ok = TRUE;
-
- /* If we get here when the old symbol is a common symbol, then
- we are explicitly letting it override a weak symbol or
- function in a dynamic object, and we don't want to warn about
- a type change. If the old symbol is a defined symbol, a type
- change warning may still be appropriate. */
-
- if (h->root.type == bfd_link_hash_common)
- *type_change_ok = TRUE;
- }
-
- /* Handle the special case of an old common symbol merging with a
- new symbol which looks like a common symbol in a shared object.
- We change *PSEC and *PVALUE to make the new symbol look like a
- common symbol, and let _bfd_generic_link_add_one_symbol will do
- the right thing. */
-
- if (newdyncommon
- && h->root.type == bfd_link_hash_common)
- {
- *override = TRUE;
- newdef = FALSE;
- newdyncommon = FALSE;
- *pvalue = sym->st_size;
- *psec = sec = bfd_com_section_ptr;
- *size_change_ok = TRUE;
- }
-
- /* If the old symbol is from a dynamic object, and the new symbol is
- a definition which is not from a dynamic object, then the new
- symbol overrides the old symbol. Symbols from regular files
- always take precedence over symbols from dynamic objects, even if
- they are defined after the dynamic object in the link.
-
- As above, we again permit a common symbol in a regular object to
- override a definition in a shared object if the shared object
- symbol is a function or is weak.
-
- As above, we permit a non-weak definition in a shared object to
- override a weak definition in a regular object. */
-
- if (! newdyn
- && (newdef
- || (bfd_is_com_section (sec)
- && (h->root.type == bfd_link_hash_defweak
- || h->type == STT_FUNC)))
- && olddyn
- && olddef
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && (bind != STB_WEAK
- || h->root.type == bfd_link_hash_defweak))
- {
- /* Change the hash table entry to undefined, and let
- _bfd_generic_link_add_one_symbol do the right thing with the
- new definition. */
-
- h->root.type = bfd_link_hash_undefined;
- h->root.u.undef.abfd = h->root.u.def.section->owner;
- *size_change_ok = TRUE;
-
- olddef = FALSE;
- olddyncommon = FALSE;
-
- /* We again permit a type change when a common symbol may be
- overriding a function. */
-
- if (bfd_is_com_section (sec))
- *type_change_ok = TRUE;
-
- /* This union may have been set to be non-NULL when this symbol
- was seen in a dynamic object. We must force the union to be
- NULL, so that it is correct for a regular symbol. */
-
- h->verinfo.vertree = NULL;
-
- /* In this special case, if H is the target of an indirection,
- we want the caller to frob with H rather than with the
- indirect symbol. That will permit the caller to redefine the
- target of the indirection, rather than the indirect symbol
- itself. FIXME: This will break the -y option if we store a
- symbol with a different name. */
- *sym_hash = h;
- }
-
- /* Handle the special case of a new common symbol merging with an
- old symbol that looks like it might be a common symbol defined in
- a shared object. Note that we have already handled the case in
- which a new common symbol should simply override the definition
- in the shared library. */
-
- if (! newdyn
- && bfd_is_com_section (sec)
- && olddyncommon)
- {
- /* It would be best if we could set the hash table entry to a
- common symbol, but we don't know what to use for the section
- or the alignment. */
- if (! ((*info->callbacks->multiple_common)
- (info, h->root.root.string, oldbfd, bfd_link_hash_common,
- h->size, abfd, bfd_link_hash_common, sym->st_size)))
- return FALSE;
-
- /* If the predumed common symbol in the dynamic object is
- larger, pretend that the new symbol has its size. */
-
- if (h->size > *pvalue)
- *pvalue = h->size;
-
- /* FIXME: We no longer know the alignment required by the symbol
- in the dynamic object, so we just wind up using the one from
- the regular object. */
-
- olddef = FALSE;
- olddyncommon = FALSE;
-
- h->root.type = bfd_link_hash_undefined;
- h->root.u.undef.abfd = h->root.u.def.section->owner;
-
- *size_change_ok = TRUE;
- *type_change_ok = TRUE;
-
- h->verinfo.vertree = NULL;
- }
-
- /* Handle the special case of a weak definition in a regular object
- followed by a non-weak definition in a shared object. In this
- case, we prefer the definition in the shared object unless it
- comes from a DT_NEEDED entry of a shared object, in which case,
- the DT_NEEDED entry may not be required at the run time. */
- if (olddef
- && ! dt_needed
- && h->root.type == bfd_link_hash_defweak
- && newdef
- && newdyn
- && bind != STB_WEAK)
- {
- /* To make this work we have to frob the flags so that the rest
- of the code does not think we are using the regular
- definition. */
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
- h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
- else if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
- h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
- h->elf_link_hash_flags &= ~ (ELF_LINK_HASH_DEF_REGULAR
- | ELF_LINK_HASH_DEF_DYNAMIC);
-
- /* If H is the target of an indirection, we want the caller to
- use H rather than the indirect symbol. Otherwise if we are
- defining a new indirect symbol we will wind up attaching it
- to the entry we are overriding. */
- *sym_hash = h;
- }
-
- /* Handle the special case of a non-weak definition in a shared
- object followed by a weak definition in a regular object. In
- this case we prefer to definition in the shared object. To make
- this work we have to tell the caller to not treat the new symbol
- as a definition. */
- if (olddef
- && olddyn
- && h->root.type != bfd_link_hash_defweak
- && newdef
- && ! newdyn
- && bind == STB_WEAK)
- *override = TRUE;
-
- return TRUE;
-}
-
-/* This function is called to create an indirect symbol from the
- default for the symbol with the default version if needed. The
- symbol is described by H, NAME, SYM, PSEC, VALUE, and OVERRIDE. We
- set DYNSYM if the new indirect symbol is dynamic. DT_NEEDED
- indicates if it comes from a DT_NEEDED entry of a shared object. */
-
-static bfd_boolean
-elf_add_default_symbol (abfd, info, h, name, sym, psec, value,
- dynsym, override, dt_needed)
- bfd *abfd;
- struct bfd_link_info *info;
- struct elf_link_hash_entry *h;
- const char *name;
- Elf_Internal_Sym *sym;
- asection **psec;
- bfd_vma *value;
- bfd_boolean *dynsym;
- bfd_boolean override;
- bfd_boolean dt_needed;
-{
- bfd_boolean type_change_ok;
- bfd_boolean size_change_ok;
- char *shortname;
- struct elf_link_hash_entry *hi;
- struct bfd_link_hash_entry *bh;
- struct elf_backend_data *bed;
- bfd_boolean collect;
- bfd_boolean dynamic;
- char *p;
- size_t len, shortlen;
- asection *sec;
-
- /* If this symbol has a version, and it is the default version, we
- create an indirect symbol from the default name to the fully
- decorated name. This will cause external references which do not
- specify a version to be bound to this version of the symbol. */
- p = strchr (name, ELF_VER_CHR);
- if (p == NULL || p[1] != ELF_VER_CHR)
- return TRUE;
-
- if (override)
- {
- /* We are overridden by an old defition. We need to check if we
- need to create the indirect symbol from the default name. */
- hi = elf_link_hash_lookup (elf_hash_table (info), name, TRUE,
- FALSE, FALSE);
- BFD_ASSERT (hi != NULL);
- if (hi == h)
- return TRUE;
- while (hi->root.type == bfd_link_hash_indirect
- || hi->root.type == bfd_link_hash_warning)
- {
- hi = (struct elf_link_hash_entry *) hi->root.u.i.link;
- if (hi == h)
- return TRUE;
- }
- }
-
- bed = get_elf_backend_data (abfd);
- collect = bed->collect;
- dynamic = (abfd->flags & DYNAMIC) != 0;
-
- shortlen = p - name;
- shortname = bfd_hash_allocate (&info->hash->table, shortlen + 1);
- if (shortname == NULL)
- return FALSE;
- memcpy (shortname, name, shortlen);
- shortname[shortlen] = '\0';
-
- /* We are going to create a new symbol. Merge it with any existing
- symbol with this name. For the purposes of the merge, act as
- though we were defining the symbol we just defined, although we
- actually going to define an indirect symbol. */
- type_change_ok = FALSE;
- size_change_ok = FALSE;
- sec = *psec;
- if (! elf_merge_symbol (abfd, info, shortname, sym, &sec, value,
- &hi, &override, &type_change_ok,
- &size_change_ok, dt_needed))
- return FALSE;
-
- 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, &bh)))
- return FALSE;
- hi = (struct elf_link_hash_entry *) bh;
- }
- else
- {
- /* In this case the symbol named SHORTNAME is overriding the
- indirect symbol we want to add. We were planning on making
- SHORTNAME an indirect symbol referring to NAME. SHORTNAME
- is the name without a version. NAME is the fully versioned
- name, and it is the default version.
-
- Overriding means that we already saw a definition for the
- symbol SHORTNAME in a regular object, and it is overriding
- the symbol defined in the dynamic object.
-
- When this happens, we actually want to change NAME, the
- symbol we just added, to refer to SHORTNAME. This will cause
- references to NAME in the shared object to become references
- to SHORTNAME in the regular object. This is what we expect
- when we override a function in a shared object: that the
- references in the shared object will be mapped to the
- definition in the regular object. */
-
- while (hi->root.type == bfd_link_hash_indirect
- || hi->root.type == bfd_link_hash_warning)
- hi = (struct elf_link_hash_entry *) hi->root.u.i.link;
-
- h->root.type = bfd_link_hash_indirect;
- h->root.u.i.link = (struct bfd_link_hash_entry *) hi;
- if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
- {
- h->elf_link_hash_flags &=~ ELF_LINK_HASH_DEF_DYNAMIC;
- hi->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
- if (hi->elf_link_hash_flags
- & (ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_DEF_REGULAR))
- {
- if (! _bfd_elf_link_record_dynamic_symbol (info, hi))
- return FALSE;
- }
- }
-
- /* Now set HI to H, so that the following code will set the
- other fields correctly. */
- hi = h;
- }
-
- /* If there is a duplicate definition somewhere, then HI may not
- point to an indirect symbol. We will have reported an error to
- the user in that case. */
-
- if (hi->root.type == bfd_link_hash_indirect)
- {
- struct elf_link_hash_entry *ht;
-
- /* If the symbol became indirect, then we assume that we have
- not seen a definition before. */
- BFD_ASSERT ((hi->elf_link_hash_flags
- & (ELF_LINK_HASH_DEF_DYNAMIC
- | ELF_LINK_HASH_DEF_REGULAR)) == 0);
-
- ht = (struct elf_link_hash_entry *) hi->root.u.i.link;
- (*bed->elf_backend_copy_indirect_symbol) (bed, ht, hi);
-
- /* See if the new flags lead us to realize that the symbol must
- be dynamic. */
- if (! *dynsym)
- {
- if (! dynamic)
- {
- if (info->shared
- || ((hi->elf_link_hash_flags
- & ELF_LINK_HASH_REF_DYNAMIC) != 0))
- *dynsym = TRUE;
- }
- else
- {
- if ((hi->elf_link_hash_flags
- & ELF_LINK_HASH_REF_REGULAR) != 0)
- *dynsym = TRUE;
- }
- }
- }
-
- /* We also need to define an indirection from the nondefault version
- of the symbol. */
-
- len = strlen (name);
- shortname = bfd_hash_allocate (&info->hash->table, len);
- if (shortname == NULL)
- return FALSE;
- memcpy (shortname, name, shortlen);
- memcpy (shortname + shortlen, p + 1, len - shortlen);
-
- /* Once again, merge with any existing symbol. */
- type_change_ok = FALSE;
- size_change_ok = FALSE;
- sec = *psec;
- if (! elf_merge_symbol (abfd, info, shortname, sym, &sec, value,
- &hi, &override, &type_change_ok,
- &size_change_ok, dt_needed))
- return FALSE;
-
- if (override)
- {
- /* Here SHORTNAME is a versioned name, so we don't expect to see
- the type of override we do in the case above unless it is
- overridden by a versioned definiton. */
- if (hi->root.type != bfd_link_hash_defined
- && hi->root.type != bfd_link_hash_defweak)
- (*_bfd_error_handler)
- (_("%s: warning: unexpected redefinition of indirect versioned symbol `%s'"),
- bfd_archive_filename (abfd), shortname);
- }
- else
- {
- 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, &bh)))
- return FALSE;
- hi = (struct elf_link_hash_entry *) bh;
-
- /* If there is a duplicate definition somewhere, then HI may not
- point to an indirect symbol. We will have reported an error
- to the user in that case. */
-
- if (hi->root.type == bfd_link_hash_indirect)
- {
- /* If the symbol became indirect, then we assume that we have
- not seen a definition before. */
- BFD_ASSERT ((hi->elf_link_hash_flags
- & (ELF_LINK_HASH_DEF_DYNAMIC
- | ELF_LINK_HASH_DEF_REGULAR)) == 0);
-
- (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi);
-
- /* See if the new flags lead us to realize that the symbol
- must be dynamic. */
- if (! *dynsym)
- {
- if (! dynamic)
- {
- if (info->shared
- || ((hi->elf_link_hash_flags
- & ELF_LINK_HASH_REF_DYNAMIC) != 0))
- *dynsym = TRUE;
- }
- else
- {
- if ((hi->elf_link_hash_flags
- & ELF_LINK_HASH_REF_REGULAR) != 0)
- *dynsym = TRUE;
- }
- }
- }
- }
-
- return TRUE;
-}
-
/* Add symbols from an ELF object file to the linker hash table. */
static bfd_boolean
@@ -1287,7 +557,7 @@ elf_link_add_object_symbols (abfd, info)
&& ! hash_table->dynamic_sections_created
&& abfd->xvec == info->hash->creator)
{
- if (! elf_link_create_dynamic_sections (abfd, info))
+ if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
goto error_return;
}
}
@@ -1477,7 +747,7 @@ elf_link_add_object_symbols (abfd, info)
/* If this is the first dynamic object found in the link, create
the special sections required for dynamic linking. */
if (! hash_table->dynamic_sections_created)
- if (! elf_link_create_dynamic_sections (abfd, info))
+ if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
goto error_return;
if (add_needed)
@@ -1725,6 +995,7 @@ elf_link_add_object_symbols (abfd, info)
{
Elf_Internal_Versym iver;
unsigned int vernum = 0;
+ bfd_boolean skip;
if (ever != NULL)
{
@@ -1821,11 +1092,15 @@ elf_link_add_object_symbols (abfd, info)
}
}
- if (! elf_merge_symbol (abfd, info, name, isym, &sec, &value,
- sym_hash, &override, &type_change_ok,
- &size_change_ok, dt_needed))
+ if (!_bfd_elf_merge_symbol (abfd, info, name, isym, &sec, &value,
+ sym_hash, &skip, &override,
+ &type_change_ok, &size_change_ok,
+ dt_needed))
goto error_free_vers;
+ if (skip)
+ continue;
+
if (override)
definition = FALSE;
@@ -2005,9 +1280,10 @@ elf_link_add_object_symbols (abfd, info)
h->type = ELF_ST_TYPE (isym->st_info);
}
- /* If st_other has a processor-specific meaning, specific code
- might be needed here. */
- if (isym->st_other != 0)
+ /* If st_other has a processor-specific meaning, specific
+ code might be needed here. We never merge the visibility
+ attribute with the one from a dynamic object. */
+ if (isym->st_other != 0 && !dynamic)
{
unsigned char hvis, symvis, other, nvis;
@@ -2069,12 +1345,12 @@ elf_link_add_object_symbols (abfd, info)
/* Check to see if we need to add an indirect symbol for
the default name. */
if (definition || h->root.type == bfd_link_hash_common)
- if (! elf_add_default_symbol (abfd, info, h, name, isym,
- &sec, &value, &dynsym,
- override, dt_needed))
+ if (!_bfd_elf_add_default_symbol (abfd, info, h, name, isym,
+ &sec, &value, &dynsym,
+ override, dt_needed))
goto error_free_vers;
- if (definition && (abfd->flags & DYNAMIC) == 0)
+ if (definition && !dynamic)
{
char *p = strchr (name, ELF_VER_CHR);
if (p != NULL && p[1] != ELF_VER_CHR)
@@ -2332,10 +1608,10 @@ elf_link_add_object_symbols (abfd, info)
|| bfd_is_abs_section (o->output_section))
continue;
- internal_relocs = (NAME(_bfd_elf,link_read_relocs)
- (abfd, o, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory));
+ internal_relocs
+ = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (internal_relocs == NULL)
goto error_return;
@@ -2431,148 +1707,6 @@ elf_link_add_object_symbols (abfd, info)
return FALSE;
}
-/* Create some sections which will be filled in with dynamic linking
- information. ABFD is an input file which requires dynamic sections
- to be created. The dynamic sections take up virtual memory space
- when the final executable is run, so we need to create them before
- addresses are assigned to the output sections. We work out the
- actual contents and size of these sections later. */
-
-bfd_boolean
-elf_link_create_dynamic_sections (abfd, info)
- bfd *abfd;
- struct bfd_link_info *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))
- return FALSE;
-
- if (elf_hash_table (info)->dynamic_sections_created)
- return TRUE;
-
- /* Make sure that all dynamic sections use the same input BFD. */
- if (elf_hash_table (info)->dynobj == NULL)
- elf_hash_table (info)->dynobj = abfd;
- else
- abfd = elf_hash_table (info)->dynobj;
-
- /* Note that we set the SEC_IN_MEMORY flag for all of these
- sections. */
- flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY | SEC_LINKER_CREATED);
-
- /* A dynamically linked executable has a .interp section, but a
- shared library does not. */
- if (! info->shared)
- {
- s = bfd_make_section (abfd, ".interp");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY))
- return FALSE;
- }
-
- if (! info->traditional_format
- && info->hash->creator->flavour == bfd_target_elf_flavour)
- {
- s = bfd_make_section (abfd, ".eh_frame_hdr");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, 2))
- return FALSE;
- elf_hash_table (info)->eh_info.hdr_sec = s;
- }
-
- /* Create sections to hold version informations. These are removed
- if they are not needed. */
- s = bfd_make_section (abfd, ".gnu.version_d");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
- return FALSE;
-
- s = bfd_make_section (abfd, ".gnu.version");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, 1))
- return FALSE;
-
- s = bfd_make_section (abfd, ".gnu.version_r");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
- return FALSE;
-
- s = bfd_make_section (abfd, ".dynsym");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
- return FALSE;
-
- s = bfd_make_section (abfd, ".dynstr");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY))
- return FALSE;
-
- /* Create a strtab to hold the dynamic symbol names. */
- if (elf_hash_table (info)->dynstr == NULL)
- {
- elf_hash_table (info)->dynstr = _bfd_elf_strtab_init ();
- if (elf_hash_table (info)->dynstr == NULL)
- return FALSE;
- }
-
- s = bfd_make_section (abfd, ".dynamic");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags)
- || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
- return FALSE;
-
- /* The special symbol _DYNAMIC is always set to the start of the
- .dynamic section. This call occurs before we have processed the
- symbols for any dynamic object, so we don't have to worry about
- overriding a dynamic definition. We could set _DYNAMIC in a
- linker script, but we only want to define it if we are, in fact,
- creating a .dynamic section. We don't want to define it if there
- is no .dynamic section, since on some ELF platforms the start up
- code examines it to decide how to initialize the process. */
- bh = NULL;
- if (! (_bfd_generic_link_add_one_symbol
- (info, abfd, "_DYNAMIC", BSF_GLOBAL, s, (bfd_vma) 0,
- (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;
-
- if (info->shared
- && ! _bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
-
- bed = get_elf_backend_data (abfd);
-
- s = bfd_make_section (abfd, ".hash");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
- return FALSE;
- elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry;
-
- /* Let the backend create the rest of the sections. This lets the
- backend set the right flags. The backend will normally create
- the .got and .plt sections. */
- if (! (*bed->elf_backend_create_dynamic_sections) (abfd, info))
- return FALSE;
-
- elf_hash_table (info)->dynamic_sections_created = TRUE;
-
- return TRUE;
-}
-
/* Add an entry to the .dynamic table. */
bfd_boolean
@@ -2611,251 +1745,6 @@ elf_add_dynamic_entry (info, tag, val)
return TRUE;
}
-/* Read and swap the relocs from the section indicated by SHDR. This
- may be either a REL or a RELA section. The relocations are
- translated into RELA relocations and stored in INTERNAL_RELOCS,
- which should have already been allocated to contain enough space.
- The EXTERNAL_RELOCS are a buffer where the external form of the
- relocations should be stored.
-
- Returns FALSE if something goes wrong. */
-
-static bfd_boolean
-elf_link_read_relocs_from_section (abfd, shdr, external_relocs,
- internal_relocs)
- bfd *abfd;
- Elf_Internal_Shdr *shdr;
- PTR external_relocs;
- Elf_Internal_Rela *internal_relocs;
-{
- struct elf_backend_data *bed;
- void (*swap_in) PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
- const bfd_byte *erela;
- const bfd_byte *erelaend;
- Elf_Internal_Rela *irela;
-
- /* If there aren't any relocations, that's OK. */
- if (!shdr)
- return TRUE;
-
- /* Position ourselves at the start of the section. */
- if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0)
- return FALSE;
-
- /* Read the relocations. */
- if (bfd_bread (external_relocs, shdr->sh_size, abfd) != shdr->sh_size)
- return FALSE;
-
- bed = get_elf_backend_data (abfd);
-
- /* Convert the external relocations to the internal format. */
- if (shdr->sh_entsize == sizeof (Elf_External_Rel))
- swap_in = bed->s->swap_reloc_in;
- else if (shdr->sh_entsize == sizeof (Elf_External_Rela))
- swap_in = bed->s->swap_reloca_in;
- else
- {
- bfd_set_error (bfd_error_wrong_format);
- return FALSE;
- }
-
- erela = external_relocs;
- erelaend = erela + NUM_SHDR_ENTRIES (shdr) * shdr->sh_entsize;
- irela = internal_relocs;
- while (erela < erelaend)
- {
- (*swap_in) (abfd, erela, irela);
- irela += bed->s->int_rels_per_ext_rel;
- erela += shdr->sh_entsize;
- }
-
- return TRUE;
-}
-
-/* Read and swap the relocs for a section O. They may have been
- cached. If the EXTERNAL_RELOCS and INTERNAL_RELOCS arguments are
- not NULL, they are used as buffers to read into. They are known to
- be large enough. If the INTERNAL_RELOCS relocs argument is NULL,
- the return value is allocated using either malloc or bfd_alloc,
- according to the KEEP_MEMORY argument. If O has two relocation
- sections (both REL and RELA relocations), then the REL_HDR
- relocations will appear first in INTERNAL_RELOCS, followed by the
- REL_HDR2 relocations. */
-
-Elf_Internal_Rela *
-NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs,
- keep_memory)
- bfd *abfd;
- asection *o;
- PTR external_relocs;
- Elf_Internal_Rela *internal_relocs;
- bfd_boolean keep_memory;
-{
- Elf_Internal_Shdr *rel_hdr;
- PTR alloc1 = NULL;
- Elf_Internal_Rela *alloc2 = NULL;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
-
- if (elf_section_data (o)->relocs != NULL)
- return elf_section_data (o)->relocs;
-
- if (o->reloc_count == 0)
- return NULL;
-
- rel_hdr = &elf_section_data (o)->rel_hdr;
-
- if (internal_relocs == NULL)
- {
- bfd_size_type size;
-
- size = o->reloc_count;
- size *= bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela);
- if (keep_memory)
- internal_relocs = (Elf_Internal_Rela *) bfd_alloc (abfd, size);
- else
- internal_relocs = alloc2 = (Elf_Internal_Rela *) bfd_malloc (size);
- if (internal_relocs == NULL)
- goto error_return;
- }
-
- if (external_relocs == NULL)
- {
- bfd_size_type size = rel_hdr->sh_size;
-
- if (elf_section_data (o)->rel_hdr2)
- size += elf_section_data (o)->rel_hdr2->sh_size;
- alloc1 = (PTR) bfd_malloc (size);
- if (alloc1 == NULL)
- goto error_return;
- external_relocs = alloc1;
- }
-
- if (!elf_link_read_relocs_from_section (abfd, rel_hdr,
- external_relocs,
- internal_relocs))
- goto error_return;
- if (!elf_link_read_relocs_from_section
- (abfd,
- elf_section_data (o)->rel_hdr2,
- ((bfd_byte *) external_relocs) + rel_hdr->sh_size,
- internal_relocs + (NUM_SHDR_ENTRIES (rel_hdr)
- * bed->s->int_rels_per_ext_rel)))
- goto error_return;
-
- /* Cache the results for next time, if we can. */
- if (keep_memory)
- elf_section_data (o)->relocs = internal_relocs;
-
- if (alloc1 != NULL)
- free (alloc1);
-
- /* Don't free alloc2, since if it was allocated we are passing it
- back (under the name of internal_relocs). */
-
- return internal_relocs;
-
- error_return:
- if (alloc1 != NULL)
- free (alloc1);
- if (alloc2 != NULL)
- free (alloc2);
- return NULL;
-}
-
-/* Record an assignment to a symbol made by a linker script. We need
- this in case some dynamic object refers to this symbol. */
-
-bfd_boolean
-NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
- const char *name;
- bfd_boolean provide;
-{
- struct elf_link_hash_entry *h;
-
- if (info->hash->creator->flavour != bfd_target_elf_flavour)
- return TRUE;
-
- h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, TRUE, FALSE);
- if (h == NULL)
- return FALSE;
-
- if (h->root.type == bfd_link_hash_new)
- h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
-
- /* If this symbol is being provided by the linker script, and it is
- currently defined by a dynamic object, but not by a regular
- object, then mark it as undefined so that the generic linker will
- force the correct value. */
- if (provide
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
- h->root.type = bfd_link_hash_undefined;
-
- /* If this symbol is not being provided by the linker script, and it is
- currently defined by a dynamic object, but not by a regular object,
- then clear out any version information because the symbol will not be
- associated with the dynamic object any more. */
- if (!provide
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
- h->verinfo.verdef = NULL;
-
- h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
-
- if (((h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_DYNAMIC
- | ELF_LINK_HASH_REF_DYNAMIC)) != 0
- || info->shared)
- && h->dynindx == -1)
- {
- if (! _bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
-
- /* If this is a weak defined symbol, and we know a corresponding
- real symbol from the same dynamic object, make sure the real
- symbol is also made into a dynamic symbol. */
- if (h->weakdef != NULL
- && h->weakdef->dynindx == -1)
- {
- if (! _bfd_elf_link_record_dynamic_symbol (info, h->weakdef))
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-/* This structure is used to pass information to
- elf_link_assign_sym_version. */
-
-struct elf_assign_sym_version_info
-{
- /* Output BFD. */
- bfd *output_bfd;
- /* General link information. */
- struct bfd_link_info *info;
- /* Version tree. */
- struct bfd_elf_version_tree *verdefs;
- /* Whether we had a failure. */
- bfd_boolean failed;
-};
-
-/* This structure is used to pass information to
- elf_link_find_version_dependencies. */
-
-struct elf_find_verdep_info
-{
- /* Output BFD. */
- bfd *output_bfd;
- /* General link information. */
- struct bfd_link_info *info;
- /* The number of dependencies. */
- unsigned int vers;
- /* Whether we had a failure. */
- bfd_boolean failed;
-};
-
/* Array used to determine the number of hash table buckets to use
based on the number of symbols there are. If there are fewer than
3 symbols we use 1 bucket, fewer than 17 symbols we use 3 buckets,
@@ -3151,7 +2040,8 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
table (this is not the normal case), then do so. */
if (info->export_dynamic)
{
- elf_link_hash_traverse (elf_hash_table (info), elf_export_symbol,
+ elf_link_hash_traverse (elf_hash_table (info),
+ _bfd_elf_export_symbol,
(PTR) &eif);
if (eif.failed)
return FALSE;
@@ -3215,7 +2105,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
asvinfo.failed = FALSE;
elf_link_hash_traverse (elf_hash_table (info),
- elf_link_assign_sym_version,
+ _bfd_elf_link_assign_sym_version,
(PTR) &asvinfo);
if (asvinfo.failed)
return FALSE;
@@ -3245,7 +2135,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
/* Find all symbols which were defined in a dynamic object and make
the backend pick a reasonable value for them. */
elf_link_hash_traverse (elf_hash_table (info),
- elf_adjust_dynamic_symbol,
+ _bfd_elf_adjust_dynamic_symbol,
(PTR) &eif);
if (eif.failed)
return FALSE;
@@ -3574,7 +2464,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
sinfo.failed = FALSE;
elf_link_hash_traverse (elf_hash_table (info),
- elf_link_find_version_dependencies,
+ _bfd_elf_link_find_version_dependencies,
(PTR) &sinfo);
if (elf_tdata (output_bfd)->verref == NULL)
@@ -3905,663 +2795,6 @@ elf_finalize_dynstr (output_bfd, info)
return TRUE;
}
-
-/* Fix up the flags for a symbol. This handles various cases which
- can only be fixed after all the input files are seen. This is
- currently called by both adjust_dynamic_symbol and
- assign_sym_version, which is unnecessary but perhaps more robust in
- the face of future changes. */
-
-static bfd_boolean
-elf_fix_symbol_flags (h, eif)
- struct elf_link_hash_entry *h;
- struct elf_info_failed *eif;
-{
- /* If this symbol was mentioned in a non-ELF file, try to set
- DEF_REGULAR and REF_REGULAR correctly. This is the only way to
- permit a non-ELF file to correctly refer to a symbol defined in
- an ELF dynamic object. */
- if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) != 0)
- {
- while (h->root.type == bfd_link_hash_indirect)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- if (h->root.type != bfd_link_hash_defined
- && h->root.type != bfd_link_hash_defweak)
- h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_REF_REGULAR_NONWEAK);
- else
- {
- if (h->root.u.def.section->owner != NULL
- && (bfd_get_flavour (h->root.u.def.section->owner)
- == bfd_target_elf_flavour))
- h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_REF_REGULAR_NONWEAK);
- else
- h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
- }
-
- if (h->dynindx == -1
- && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0))
- {
- if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
- {
- eif->failed = TRUE;
- return FALSE;
- }
- }
- }
- else
- {
- /* Unfortunately, ELF_LINK_NON_ELF is only correct if the symbol
- was first seen in a non-ELF file. Fortunately, if the symbol
- was first seen in an ELF file, we're probably OK unless the
- symbol was defined in a non-ELF file. Catch that case here.
- FIXME: We're still in trouble if the symbol was first seen in
- a dynamic object, and then later in a non-ELF regular object. */
- if ((h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
- && (h->root.u.def.section->owner != NULL
- ? (bfd_get_flavour (h->root.u.def.section->owner)
- != bfd_target_elf_flavour)
- : (bfd_is_abs_section (h->root.u.def.section)
- && (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) == 0)))
- h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
- }
-
- /* If this is a final link, and the symbol was defined as a common
- symbol in a regular object file, and there was no definition in
- any dynamic object, then the linker will have allocated space for
- the symbol in a common section but the ELF_LINK_HASH_DEF_REGULAR
- flag will not have been set. */
- if (h->root.type == bfd_link_hash_defined
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
- && (h->root.u.def.section->owner->flags & DYNAMIC) == 0)
- h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
-
- /* If -Bsymbolic was used (which means to bind references to global
- symbols to the definition within the shared object), and this
- symbol was defined in a regular object, then it actually doesn't
- need a PLT entry, and we can accomplish that by forcing it local.
- Likewise, if the symbol has hidden or internal visibility.
- FIXME: It might be that we also do not need a PLT for other
- non-hidden visibilities, but we would have to tell that to the
- backend specifically; we can't just clear PLT-related data here. */
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
- && eif->info->shared
- && is_elf_hash_table (eif->info)
- && (eif->info->symbolic
- || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
- || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
- {
- struct elf_backend_data *bed;
- bfd_boolean force_local;
-
- bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
-
- force_local = (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
- || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN);
- (*bed->elf_backend_hide_symbol) (eif->info, h, force_local);
- }
-
- /* If this is a weak defined symbol in a dynamic object, and we know
- the real definition in the dynamic object, copy interesting flags
- over to the real definition. */
- if (h->weakdef != NULL)
- {
- struct elf_link_hash_entry *weakdef;
-
- weakdef = h->weakdef;
- if (h->root.type == bfd_link_hash_indirect)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- BFD_ASSERT (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak);
- BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined
- || weakdef->root.type == bfd_link_hash_defweak);
- BFD_ASSERT (weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC);
-
- /* If the real definition is defined by a regular object file,
- don't do anything special. See the longer description in
- elf_adjust_dynamic_symbol, below. */
- if ((weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
- h->weakdef = NULL;
- else
- {
- struct elf_backend_data *bed;
-
- bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
- (*bed->elf_backend_copy_indirect_symbol) (bed, weakdef, h);
- }
- }
-
- return TRUE;
-}
-
-/* Make the backend pick a good value for a dynamic symbol. This is
- called via elf_link_hash_traverse, and also calls itself
- recursively. */
-
-static bfd_boolean
-elf_adjust_dynamic_symbol (h, data)
- struct elf_link_hash_entry *h;
- PTR data;
-{
- struct elf_info_failed *eif = (struct elf_info_failed *) data;
- bfd *dynobj;
- struct elf_backend_data *bed;
-
- if (! is_elf_hash_table (eif->info))
- return FALSE;
-
- if (h->root.type == bfd_link_hash_warning)
- {
- h->plt = elf_hash_table (eif->info)->init_offset;
- h->got = elf_hash_table (eif->info)->init_offset;
-
- /* When warning symbols are created, they **replace** the "real"
- entry in the hash table, thus we never get to see the real
- symbol in a hash traversal. So look at it now. */
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
- }
-
- /* Ignore indirect symbols. These are added by the versioning code. */
- if (h->root.type == bfd_link_hash_indirect)
- return TRUE;
-
- /* Fix the symbol flags. */
- if (! elf_fix_symbol_flags (h, eif))
- return FALSE;
-
- /* If this symbol does not require a PLT entry, and it is not
- defined by a dynamic object, or is not referenced by a regular
- object, ignore it. We do have to handle a weak defined symbol,
- even if no regular object refers to it, if we decided to add it
- to the dynamic symbol table. FIXME: Do we normally need to worry
- about symbols which are defined by one dynamic object and
- referenced by another one? */
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0
- && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
- || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
- || ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
- && (h->weakdef == NULL || h->weakdef->dynindx == -1))))
- {
- h->plt = elf_hash_table (eif->info)->init_offset;
- return TRUE;
- }
-
- /* If we've already adjusted this symbol, don't do it again. This
- can happen via a recursive call. */
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
- return TRUE;
-
- /* Don't look at this symbol again. Note that we must set this
- after checking the above conditions, because we may look at a
- symbol once, decide not to do anything, and then get called
- recursively later after REF_REGULAR is set below. */
- h->elf_link_hash_flags |= ELF_LINK_HASH_DYNAMIC_ADJUSTED;
-
- /* If this is a weak definition, and we know a real definition, and
- the real symbol is not itself defined by a regular object file,
- then get a good value for the real definition. We handle the
- real symbol first, for the convenience of the backend routine.
-
- Note that there is a confusing case here. If the real definition
- is defined by a regular object file, we don't get the real symbol
- from the dynamic object, but we do get the weak symbol. If the
- processor backend uses a COPY reloc, then if some routine in the
- dynamic object changes the real symbol, we will not see that
- change in the corresponding weak symbol. This is the way other
- ELF linkers work as well, and seems to be a result of the shared
- library model.
-
- I will clarify this issue. Most SVR4 shared libraries define the
- variable _timezone and define timezone as a weak synonym. The
- tzset call changes _timezone. If you write
- extern int timezone;
- int _timezone = 5;
- int main () { tzset (); printf ("%d %d\n", timezone, _timezone); }
- you might expect that, since timezone is a synonym for _timezone,
- the same number will print both times. However, if the processor
- backend uses a COPY reloc, then actually timezone will be copied
- into your process image, and, since you define _timezone
- yourself, _timezone will not. Thus timezone and _timezone will
- wind up at different memory locations. The tzset call will set
- _timezone, leaving timezone unchanged. */
-
- if (h->weakdef != NULL)
- {
- /* If we get to this point, we know there is an implicit
- reference by a regular object file via the weak symbol H.
- FIXME: Is this really true? What if the traversal finds
- H->WEAKDEF before it finds H? */
- h->weakdef->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
-
- if (! elf_adjust_dynamic_symbol (h->weakdef, (PTR) eif))
- return FALSE;
- }
-
- /* If a symbol has no type and no size and does not require a PLT
- entry, then we are probably about to do the wrong thing here: we
- are probably going to create a COPY reloc for an empty object.
- This case can arise when a shared object is built with assembly
- code, and the assembly code fails to set the symbol type. */
- if (h->size == 0
- && h->type == STT_NOTYPE
- && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0)
- (*_bfd_error_handler)
- (_("warning: type and size of dynamic symbol `%s' are not defined"),
- h->root.root.string);
-
- dynobj = elf_hash_table (eif->info)->dynobj;
- bed = get_elf_backend_data (dynobj);
- if (! (*bed->elf_backend_adjust_dynamic_symbol) (eif->info, h))
- {
- eif->failed = TRUE;
- return FALSE;
- }
-
- return TRUE;
-}
-
-/* This routine is used to export all defined symbols into the dynamic
- symbol table. It is called via elf_link_hash_traverse. */
-
-static bfd_boolean
-elf_export_symbol (h, data)
- struct elf_link_hash_entry *h;
- PTR data;
-{
- struct elf_info_failed *eif = (struct elf_info_failed *) data;
-
- /* Ignore indirect symbols. These are added by the versioning code. */
- if (h->root.type == bfd_link_hash_indirect)
- return TRUE;
-
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- if (h->dynindx == -1
- && (h->elf_link_hash_flags
- & (ELF_LINK_HASH_DEF_REGULAR | ELF_LINK_HASH_REF_REGULAR)) != 0)
- {
- struct bfd_elf_version_tree *t;
- struct bfd_elf_version_expr *d;
-
- for (t = eif->verdefs; t != NULL; t = t->next)
- {
- if (t->globals != NULL)
- {
- for (d = t->globals; d != NULL; d = d->next)
- {
- if ((*d->match) (d, h->root.root.string))
- goto doit;
- }
- }
-
- if (t->locals != NULL)
- {
- for (d = t->locals ; d != NULL; d = d->next)
- {
- if ((*d->match) (d, h->root.root.string))
- return TRUE;
- }
- }
- }
-
- if (!eif->verdefs)
- {
- doit:
- if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
- {
- eif->failed = TRUE;
- return FALSE;
- }
- }
- }
-
- return TRUE;
-}
-
-/* Look through the symbols which are defined in other shared
- libraries and referenced here. Update the list of version
- dependencies. This will be put into the .gnu.version_r section.
- This function is called via elf_link_hash_traverse. */
-
-static bfd_boolean
-elf_link_find_version_dependencies (h, data)
- struct elf_link_hash_entry *h;
- PTR data;
-{
- struct elf_find_verdep_info *rinfo = (struct elf_find_verdep_info *) data;
- Elf_Internal_Verneed *t;
- Elf_Internal_Vernaux *a;
- bfd_size_type amt;
-
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- /* We only care about symbols defined in shared objects with version
- information. */
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
- || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
- || h->dynindx == -1
- || h->verinfo.verdef == NULL)
- return TRUE;
-
- /* See if we already know about this version. */
- for (t = elf_tdata (rinfo->output_bfd)->verref; t != NULL; t = t->vn_nextref)
- {
- if (t->vn_bfd != h->verinfo.verdef->vd_bfd)
- continue;
-
- for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
- if (a->vna_nodename == h->verinfo.verdef->vd_nodename)
- return TRUE;
-
- break;
- }
-
- /* This is a new version. Add it to tree we are building. */
-
- if (t == NULL)
- {
- amt = sizeof *t;
- t = (Elf_Internal_Verneed *) bfd_zalloc (rinfo->output_bfd, amt);
- if (t == NULL)
- {
- rinfo->failed = TRUE;
- return FALSE;
- }
-
- t->vn_bfd = h->verinfo.verdef->vd_bfd;
- t->vn_nextref = elf_tdata (rinfo->output_bfd)->verref;
- elf_tdata (rinfo->output_bfd)->verref = t;
- }
-
- amt = sizeof *a;
- a = (Elf_Internal_Vernaux *) bfd_zalloc (rinfo->output_bfd, amt);
-
- /* Note that we are copying a string pointer here, and testing it
- above. If bfd_elf_string_from_elf_section is ever changed to
- discard the string data when low in memory, this will have to be
- fixed. */
- a->vna_nodename = h->verinfo.verdef->vd_nodename;
-
- a->vna_flags = h->verinfo.verdef->vd_flags;
- a->vna_nextptr = t->vn_auxptr;
-
- h->verinfo.verdef->vd_exp_refno = rinfo->vers;
- ++rinfo->vers;
-
- a->vna_other = h->verinfo.verdef->vd_exp_refno + 1;
-
- t->vn_auxptr = a;
-
- return TRUE;
-}
-
-/* Figure out appropriate versions for all the symbols. We may not
- have the version number script until we have read all of the input
- files, so until that point we don't know which symbols should be
- local. This function is called via elf_link_hash_traverse. */
-
-static bfd_boolean
-elf_link_assign_sym_version (h, data)
- struct elf_link_hash_entry *h;
- PTR data;
-{
- struct elf_assign_sym_version_info *sinfo;
- struct bfd_link_info *info;
- struct elf_backend_data *bed;
- struct elf_info_failed eif;
- char *p;
- bfd_size_type amt;
-
- sinfo = (struct elf_assign_sym_version_info *) data;
- info = sinfo->info;
-
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- /* Fix the symbol flags. */
- eif.failed = FALSE;
- eif.info = info;
- if (! elf_fix_symbol_flags (h, &eif))
- {
- if (eif.failed)
- sinfo->failed = TRUE;
- return FALSE;
- }
-
- /* We only need version numbers for symbols defined in regular
- objects. */
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
- return TRUE;
-
- bed = get_elf_backend_data (sinfo->output_bfd);
- p = strchr (h->root.root.string, ELF_VER_CHR);
- if (p != NULL && h->verinfo.vertree == NULL)
- {
- struct bfd_elf_version_tree *t;
- bfd_boolean hidden;
-
- hidden = TRUE;
-
- /* There are two consecutive ELF_VER_CHR characters if this is
- not a hidden symbol. */
- ++p;
- if (*p == ELF_VER_CHR)
- {
- hidden = FALSE;
- ++p;
- }
-
- /* If there is no version string, we can just return out. */
- if (*p == '\0')
- {
- if (hidden)
- h->elf_link_hash_flags |= ELF_LINK_HIDDEN;
- return TRUE;
- }
-
- /* Look for the version. If we find it, it is no longer weak. */
- for (t = sinfo->verdefs; t != NULL; t = t->next)
- {
- if (strcmp (t->name, p) == 0)
- {
- size_t len;
- char *alc;
- struct bfd_elf_version_expr *d;
-
- len = p - h->root.root.string;
- alc = bfd_malloc ((bfd_size_type) len);
- if (alc == NULL)
- return FALSE;
- memcpy (alc, h->root.root.string, len - 1);
- alc[len - 1] = '\0';
- if (alc[len - 2] == ELF_VER_CHR)
- alc[len - 2] = '\0';
-
- h->verinfo.vertree = t;
- t->used = TRUE;
- d = NULL;
-
- if (t->globals != NULL)
- {
- for (d = t->globals; d != NULL; d = d->next)
- if ((*d->match) (d, alc))
- break;
- }
-
- /* See if there is anything to force this symbol to
- local scope. */
- if (d == NULL && t->locals != NULL)
- {
- for (d = t->locals; d != NULL; d = d->next)
- {
- if ((*d->match) (d, alc))
- {
- if (h->dynindx != -1
- && info->shared
- && ! info->export_dynamic)
- {
- (*bed->elf_backend_hide_symbol) (info, h, TRUE);
- }
-
- break;
- }
- }
- }
-
- free (alc);
- break;
- }
- }
-
- /* If we are building an application, we need to create a
- version node for this version. */
- if (t == NULL && ! info->shared)
- {
- struct bfd_elf_version_tree **pp;
- int version_index;
-
- /* If we aren't going to export this symbol, we don't need
- to worry about it. */
- if (h->dynindx == -1)
- return TRUE;
-
- amt = sizeof *t;
- t = ((struct bfd_elf_version_tree *)
- bfd_alloc (sinfo->output_bfd, amt));
- if (t == NULL)
- {
- sinfo->failed = TRUE;
- return FALSE;
- }
-
- t->next = NULL;
- t->name = p;
- t->globals = NULL;
- t->locals = NULL;
- t->deps = NULL;
- t->name_indx = (unsigned int) -1;
- t->used = TRUE;
-
- version_index = 1;
- /* Don't count anonymous version tag. */
- if (sinfo->verdefs != NULL && sinfo->verdefs->vernum == 0)
- version_index = 0;
- for (pp = &sinfo->verdefs; *pp != NULL; pp = &(*pp)->next)
- ++version_index;
- t->vernum = version_index;
-
- *pp = t;
-
- h->verinfo.vertree = t;
- }
- else if (t == NULL)
- {
- /* We could not find the version for a symbol when
- generating a shared archive. Return an error. */
- (*_bfd_error_handler)
- (_("%s: undefined versioned symbol name %s"),
- bfd_get_filename (sinfo->output_bfd), h->root.root.string);
- bfd_set_error (bfd_error_bad_value);
- sinfo->failed = TRUE;
- return FALSE;
- }
-
- if (hidden)
- h->elf_link_hash_flags |= ELF_LINK_HIDDEN;
- }
-
- /* If we don't have a version for this symbol, see if we can find
- something. */
- if (h->verinfo.vertree == NULL && sinfo->verdefs != NULL)
- {
- struct bfd_elf_version_tree *t;
- struct bfd_elf_version_tree *local_ver;
- struct bfd_elf_version_expr *d;
-
- /* See if can find what version this symbol is in. If the
- symbol is supposed to be local, then don't actually register
- it. */
- local_ver = NULL;
- for (t = sinfo->verdefs; t != NULL; t = t->next)
- {
- if (t->globals != NULL)
- {
- bfd_boolean matched;
-
- matched = FALSE;
- for (d = t->globals; d != NULL; d = d->next)
- {
- if ((*d->match) (d, h->root.root.string))
- {
- if (d->symver)
- matched = TRUE;
- else
- {
- /* There is a version without definition. Make
- the symbol the default definition for this
- version. */
- h->verinfo.vertree = t;
- local_ver = NULL;
- d->script = 1;
- break;
- }
- }
- }
-
- if (d != NULL)
- break;
- else if (matched)
- /* There is no undefined version for this symbol. Hide the
- default one. */
- (*bed->elf_backend_hide_symbol) (info, h, TRUE);
- }
-
- if (t->locals != NULL)
- {
- for (d = t->locals; d != NULL; d = d->next)
- {
- /* If the match is "*", keep looking for a more
- explicit, perhaps even global, match. */
- if (d->pattern[0] == '*' && d->pattern[1] == '\0')
- local_ver = t;
- else if ((*d->match) (d, h->root.root.string))
- {
- local_ver = t;
- break;
- }
- }
-
- if (d != NULL)
- break;
- }
- }
-
- if (local_ver != NULL)
- {
- h->verinfo.vertree = local_ver;
- if (h->dynindx != -1
- && info->shared
- && ! info->export_dynamic)
- {
- (*bed->elf_backend_hide_symbol) (info, h, TRUE);
- }
- }
- }
-
- return TRUE;
-}
/* Final phase of ELF linker. */
@@ -4622,8 +2855,6 @@ static bfd_boolean elf_link_flush_output_syms
PARAMS ((struct elf_final_link_info *));
static bfd_boolean elf_link_output_extsym
PARAMS ((struct elf_link_hash_entry *, PTR));
-static bfd_boolean elf_link_sec_merge_syms
- PARAMS ((struct elf_link_hash_entry *, PTR));
static bfd_boolean elf_link_check_versioned_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
static bfd_boolean elf_link_input_bfd
@@ -4641,58 +2872,6 @@ struct elf_outext_info
struct elf_final_link_info *finfo;
};
-/* Compute the size of, and allocate space for, REL_HDR which is the
- section header for a section containing relocations for O. */
-
-static bfd_boolean
-elf_link_size_reloc_section (abfd, rel_hdr, o)
- bfd *abfd;
- Elf_Internal_Shdr *rel_hdr;
- asection *o;
-{
- bfd_size_type reloc_count;
- bfd_size_type num_rel_hashes;
-
- /* Figure out how many relocations there will be. */
- if (rel_hdr == &elf_section_data (o)->rel_hdr)
- reloc_count = elf_section_data (o)->rel_count;
- else
- reloc_count = elf_section_data (o)->rel_count2;
-
- num_rel_hashes = o->reloc_count;
- if (num_rel_hashes < reloc_count)
- num_rel_hashes = reloc_count;
-
- /* That allows us to calculate the size of the section. */
- rel_hdr->sh_size = rel_hdr->sh_entsize * reloc_count;
-
- /* The contents field must last into write_object_contents, so we
- allocate it with bfd_alloc rather than malloc. Also since we
- cannot be sure that the contents will actually be filled in,
- we zero the allocated space. */
- rel_hdr->contents = (PTR) bfd_zalloc (abfd, rel_hdr->sh_size);
- if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0)
- return FALSE;
-
- /* We only allocate one set of hash entries, so we only do it the
- first time we are called. */
- if (elf_section_data (o)->rel_hashes == NULL
- && num_rel_hashes)
- {
- struct elf_link_hash_entry **p;
-
- p = ((struct elf_link_hash_entry **)
- bfd_zmalloc (num_rel_hashes
- * sizeof (struct elf_link_hash_entry *)));
- if (p == NULL)
- return FALSE;
-
- elf_section_data (o)->rel_hashes = p;
- }
-
- return TRUE;
-}
-
/* When performing a relocateable link, the input relocations are
preserved. But, if they reference global symbols, the indices
referenced must be updated. Update all the relocations in
@@ -5061,9 +3240,10 @@ elf_bfd_final_link (abfd, info)
{
Elf_Internal_Rela * relocs;
- relocs = (NAME(_bfd_elf,link_read_relocs)
- (abfd, sec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL, info->keep_memory));
+ relocs
+ = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
reloc_count = (*bed->elf_backend_count_relocs) (sec, relocs);
@@ -5181,7 +3361,7 @@ elf_bfd_final_link (abfd, info)
if (! info->relocateable && merged)
elf_link_hash_traverse (elf_hash_table (info),
- elf_link_sec_merge_syms, (PTR) abfd);
+ _bfd_elf_link_sec_merge_syms, (PTR) abfd);
/* Figure out the file positions for everything but the symbol table
and the relocs. We set symcount to force assign_section_numbers
@@ -5197,15 +3377,13 @@ elf_bfd_final_link (abfd, info)
{
if ((o->flags & SEC_RELOC) != 0)
{
- if (!elf_link_size_reloc_section (abfd,
- &elf_section_data (o)->rel_hdr,
- o))
+ if (!(_bfd_elf_link_size_reloc_section
+ (abfd, &elf_section_data (o)->rel_hdr, o)))
goto error_return;
if (elf_section_data (o)->rel_hdr2
- && !elf_link_size_reloc_section (abfd,
- elf_section_data (o)->rel_hdr2,
- o))
+ && !(_bfd_elf_link_size_reloc_section
+ (abfd, elf_section_data (o)->rel_hdr2, o)))
goto error_return;
}
@@ -5230,7 +3408,7 @@ elf_bfd_final_link (abfd, info)
/* sh_link is set in assign_section_numbers. */
/* sh_info is set below. */
/* sh_offset is set just below. */
- symtab_hdr->sh_addralign = bed->s->file_align;
+ symtab_hdr->sh_addralign = 1 << bed->s->log_file_align;
off = elf_tdata (abfd)->next_file_pos;
off = _bfd_elf_assign_file_position_for_section (symtab_hdr, off, TRUE);
@@ -5840,7 +4018,7 @@ elf_bfd_final_link (abfd, info)
if ((o->flags & SEC_LINKER_CREATED) == 0)
{
/* At this point, we are only interested in sections
- created by elf_link_create_dynamic_sections. */
+ created by _bfd_elf_link_create_dynamic_sections. */
continue;
}
if ((elf_section_data (o->output_section)->this_hdr.sh_type
@@ -6047,53 +4225,47 @@ elf_link_flush_output_syms (finfo)
return TRUE;
}
-/* Adjust all external symbols pointing into SEC_MERGE sections
- to reflect the object merging within the sections. */
-
-static bfd_boolean
-elf_link_sec_merge_syms (h, data)
- struct elf_link_hash_entry *h;
- PTR data;
-{
- asection *sec;
-
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- if ((h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- && ((sec = h->root.u.def.section)->flags & SEC_MERGE)
- && sec->sec_info_type == ELF_INFO_TYPE_MERGE)
- {
- bfd *output_bfd = (bfd *) data;
-
- h->root.u.def.value =
- _bfd_merged_section_offset (output_bfd,
- &h->root.u.def.section,
- elf_section_data (sec)->sec_info,
- h->root.u.def.value, (bfd_vma) 0);
- }
-
- return TRUE;
-}
-
/* For DSOs loaded in via a DT_NEEDED entry, emulate ld.so in
allowing an unsatisfied unversioned symbol in the DSO to match a
- versioned symbol that would normally require an explicit version. */
+ versioned symbol that would normally require an explicit version.
+ We also handle the case that a DSO references a hidden symbol
+ which may be satisfied by a versioned symbol in another DSO. */
static bfd_boolean
elf_link_check_versioned_symbol (info, h)
struct bfd_link_info *info;
struct elf_link_hash_entry *h;
{
- bfd *undef_bfd = h->root.u.undef.abfd;
+ bfd *abfd;
struct elf_link_loaded_list *loaded;
- if ((undef_bfd->flags & DYNAMIC) == 0
- || info->hash->creator->flavour != bfd_target_elf_flavour
- || elf_dt_soname (h->root.u.undef.abfd) == NULL)
+ if (info->hash->creator->flavour != bfd_target_elf_flavour)
return FALSE;
+ switch (h->root.type)
+ {
+ default:
+ abfd = NULL;
+ break;
+
+ case bfd_link_hash_undefined:
+ case bfd_link_hash_undefweak:
+ abfd = h->root.u.undef.abfd;
+ if ((abfd->flags & DYNAMIC) == 0 || elf_dt_soname (abfd) == NULL)
+ return FALSE;
+ break;
+
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ abfd = h->root.u.def.section->owner;
+ break;
+
+ case bfd_link_hash_common:
+ abfd = h->root.u.c.p->section->owner;
+ break;
+ }
+ BFD_ASSERT (abfd != NULL);
+
for (loaded = elf_hash_table (info)->loaded;
loaded != NULL;
loaded = loaded->next)
@@ -6113,7 +4285,7 @@ elf_link_check_versioned_symbol (info, h)
input = loaded->abfd;
/* We check each DSO for a possible hidden versioned definition. */
- if (input == undef_bfd
+ if (input == abfd
|| (input->flags & DYNAMIC) == 0
|| elf_dynversym (input) == 0)
continue;
@@ -6258,6 +4430,29 @@ elf_link_output_extsym (h, data)
}
}
+ /* We should also warn if a forced local symbol is referenced from
+ shared libraries. */
+ if (! finfo->info->relocateable
+ && (! finfo->info->shared || ! finfo->info->allow_shlib_undefined)
+ && (h->elf_link_hash_flags
+ & (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC
+ | ELF_LINK_DYNAMIC_DEF | ELF_LINK_DYNAMIC_WEAK))
+ == (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC)
+ && ! elf_link_check_versioned_symbol (finfo->info, h))
+ {
+ (*_bfd_error_handler)
+ (_("%s: %s symbol `%s' in %s is referenced by DSO"),
+ bfd_get_filename (finfo->output_bfd),
+ ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
+ ? "internal"
+ : ELF_ST_VISIBILITY (h->other) == STV_HIDDEN
+ ? "hidden" : "local",
+ h->root.root.string,
+ bfd_archive_filename (h->root.u.def.section->owner));
+ eoinfo->failed = TRUE;
+ return FALSE;
+ }
+
/* We don't want to output symbols that have never been mentioned by
a regular file, or that we have been told to strip. However, if
h->indx is set to -2, the symbol is used by a reloc and we must
@@ -6383,7 +4578,9 @@ elf_link_output_extsym (h, data)
forced local syms when non-shared is due to a historical quirk. */
if ((h->dynindx != -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
- && (finfo->info->shared
+ && ((finfo->info->shared
+ && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
&& elf_hash_table (finfo->info)->dynamic_sections_created)
{
@@ -6418,10 +4615,25 @@ elf_link_output_extsym (h, data)
sym.st_info = ELF_ST_INFO (bindtype, ELF_ST_TYPE (sym.st_info));
}
- /* If a symbol is not defined locally, we clear the visibility field. */
+ /* If a non-weak symbol with non-default visibility is not defined
+ locally, it is a fatal error. */
if (! finfo->info->relocateable
+ && ELF_ST_VISIBILITY (sym.st_other)
+ && ELF_ST_BIND (sym.st_info) != STB_WEAK
+ && h->root.type != bfd_link_hash_undefweak
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
- sym.st_other &= ~ ELF_ST_VISIBILITY (-1);
+ {
+ (*_bfd_error_handler)
+ (_("%s: %s symbol `%s' isn't defined"),
+ bfd_get_filename (finfo->output_bfd),
+ ELF_ST_VISIBILITY (sym.st_other) == STV_PROTECTED
+ ? "protected"
+ : ELF_ST_VISIBILITY (sym.st_other) == STV_INTERNAL
+ ? "internal" : "hidden",
+ h->root.root.string);
+ eoinfo->failed = TRUE;
+ return FALSE;
+ }
/* If this symbol should be put in the .dynsym section, then put it
there now. We already know the symbol index. We also fill in
@@ -6498,81 +4710,6 @@ elf_link_output_extsym (h, data)
return TRUE;
}
-/* Copy the relocations indicated by the INTERNAL_RELOCS (which
- originated from the section given by INPUT_REL_HDR) to the
- OUTPUT_BFD. */
-
-static bfd_boolean
-elf_link_output_relocs (output_bfd, input_section, input_rel_hdr,
- internal_relocs)
- bfd *output_bfd;
- asection *input_section;
- Elf_Internal_Shdr *input_rel_hdr;
- Elf_Internal_Rela *internal_relocs;
-{
- Elf_Internal_Rela *irela;
- Elf_Internal_Rela *irelaend;
- bfd_byte *erel;
- Elf_Internal_Shdr *output_rel_hdr;
- asection *output_section;
- unsigned int *rel_countp = NULL;
- struct elf_backend_data *bed;
- void (*swap_out) PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
-
- output_section = input_section->output_section;
- output_rel_hdr = NULL;
-
- if (elf_section_data (output_section)->rel_hdr.sh_entsize
- == input_rel_hdr->sh_entsize)
- {
- output_rel_hdr = &elf_section_data (output_section)->rel_hdr;
- rel_countp = &elf_section_data (output_section)->rel_count;
- }
- else if (elf_section_data (output_section)->rel_hdr2
- && (elf_section_data (output_section)->rel_hdr2->sh_entsize
- == input_rel_hdr->sh_entsize))
- {
- output_rel_hdr = elf_section_data (output_section)->rel_hdr2;
- rel_countp = &elf_section_data (output_section)->rel_count2;
- }
- else
- {
- (*_bfd_error_handler)
- (_("%s: relocation size mismatch in %s section %s"),
- bfd_get_filename (output_bfd),
- bfd_archive_filename (input_section->owner),
- input_section->name);
- bfd_set_error (bfd_error_wrong_object_format);
- return FALSE;
- }
-
- bed = get_elf_backend_data (output_bfd);
- if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
- swap_out = bed->s->swap_reloc_out;
- else if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rela))
- swap_out = bed->s->swap_reloca_out;
- else
- abort ();
-
- erel = output_rel_hdr->contents;
- erel += *rel_countp * input_rel_hdr->sh_entsize;
- irela = internal_relocs;
- irelaend = irela + (NUM_SHDR_ENTRIES (input_rel_hdr)
- * bed->s->int_rels_per_ext_rel);
- while (irela < irelaend)
- {
- (*swap_out) (output_bfd, irela, erel);
- irela += bed->s->int_rels_per_ext_rel;
- erel += input_rel_hdr->sh_entsize;
- }
-
- /* Bump the counter, so that we know where to add the next set of
- relocations. */
- *rel_countp += NUM_SHDR_ENTRIES (input_rel_hdr);
-
- return TRUE;
-}
-
/* Link an input file into the linker output file. This function
handles all the sections and relocations of the input file at once.
This is so that we only have to read the local symbols once, and
@@ -6793,7 +4930,7 @@ elf_link_input_bfd (finfo, input_bfd)
if ((o->flags & SEC_LINKER_CREATED) != 0)
{
- /* Section was created by elf_link_create_dynamic_sections
+ /* Section was created by _bfd_elf_link_create_dynamic_sections
or somesuch. */
continue;
}
@@ -6817,9 +4954,9 @@ elf_link_input_bfd (finfo, input_bfd)
Elf_Internal_Rela *internal_relocs;
/* Get the swapped relocs. */
- internal_relocs = (NAME(_bfd_elf,link_read_relocs)
- (input_bfd, o, finfo->external_relocs,
- finfo->internal_relocs, FALSE));
+ internal_relocs
+ = _bfd_elf_link_read_relocs (input_bfd, o, finfo->external_relocs,
+ finfo->internal_relocs, FALSE);
if (internal_relocs == NULL
&& o->reloc_count > 0)
return FALSE;
@@ -7136,7 +5273,7 @@ elf_link_input_bfd (finfo, input_bfd)
|| finfo->info->emitrelocations))
reloc_emitter = bed->elf_backend_emit_relocs;
else
- reloc_emitter = elf_link_output_relocs;
+ reloc_emitter = _bfd_elf_link_output_relocs;
if (input_rel_hdr->sh_size != 0
&& ! (*reloc_emitter) (output_bfd, o, input_rel_hdr,
@@ -7710,9 +5847,9 @@ elf_gc_mark (info, sec, gc_mark_hook)
}
/* Read the relocations. */
- relstart = (NAME(_bfd_elf,link_read_relocs)
- (input_bfd, sec, NULL, (Elf_Internal_Rela *) NULL,
- info->keep_memory));
+ relstart = _bfd_elf_link_read_relocs (input_bfd, sec, NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (relstart == NULL)
{
ret = FALSE;
@@ -7815,8 +5952,10 @@ elf_gc_sweep (info, gc_sweep_hook)
Elf_Internal_Rela *internal_relocs;
bfd_boolean r;
- internal_relocs = (NAME(_bfd_elf,link_read_relocs)
- (o->owner, o, NULL, NULL, info->keep_memory));
+ internal_relocs
+ = _bfd_elf_link_read_relocs (o->owner, o, NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (internal_relocs == NULL)
return FALSE;
@@ -7914,9 +6053,9 @@ elf_gc_propagate_vtable_entries_used (h, okp)
{
asection *sec = h->root.u.def.section;
struct elf_backend_data *bed = get_elf_backend_data (sec->owner);
- int file_align = bed->s->file_align;
+ unsigned int log_file_align = bed->s->log_file_align;
- n = h->vtable_parent->vtable_entries_size / file_align;
+ n = h->vtable_parent->vtable_entries_size >> log_file_align;
while (n--)
{
if (*pu)
@@ -7939,7 +6078,7 @@ elf_gc_smash_unused_vtentry_relocs (h, okp)
bfd_vma hstart, hend;
Elf_Internal_Rela *relstart, *relend, *rel;
struct elf_backend_data *bed;
- int file_align;
+ unsigned int log_file_align;
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
@@ -7956,12 +6095,12 @@ elf_gc_smash_unused_vtentry_relocs (h, okp)
hstart = h->root.u.def.value;
hend = hstart + h->size;
- relstart = (NAME(_bfd_elf,link_read_relocs)
- (sec->owner, sec, NULL, (Elf_Internal_Rela *) NULL, TRUE));
+ relstart = _bfd_elf_link_read_relocs (sec->owner, sec, NULL,
+ (Elf_Internal_Rela *) NULL, TRUE);
if (!relstart)
return *(bfd_boolean *) okp = FALSE;
bed = get_elf_backend_data (sec->owner);
- file_align = bed->s->file_align;
+ log_file_align = bed->s->log_file_align;
relend = relstart + sec->reloc_count * bed->s->int_rels_per_ext_rel;
@@ -7972,7 +6111,7 @@ elf_gc_smash_unused_vtentry_relocs (h, okp)
if (h->vtable_entries_used
&& (rel->r_offset - hstart) < h->vtable_entries_size)
{
- bfd_vma entry = (rel->r_offset - hstart) / file_align;
+ bfd_vma entry = (rel->r_offset - hstart) >> log_file_align;
if (h->vtable_entries_used[entry])
continue;
}
@@ -8107,7 +6246,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend)
bfd_vma addend;
{
struct elf_backend_data *bed = get_elf_backend_data (abfd);
- int file_align = bed->s->file_align;
+ unsigned int log_file_align = bed->s->log_file_align;
if (addend >= h->vtable_entries_size)
{
@@ -8131,7 +6270,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend)
/* Allocate one extra entry for use as a "done" flag for the
consolidation pass. */
- bytes = (size / file_align + 1) * sizeof (bfd_boolean);
+ bytes = ((size >> log_file_align) + 1) * sizeof (bfd_boolean);
if (ptr)
{
@@ -8141,7 +6280,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend)
{
size_t oldbytes;
- oldbytes = ((h->vtable_entries_size / file_align + 1)
+ oldbytes = (((h->vtable_entries_size >> log_file_align) + 1)
* sizeof (bfd_boolean));
memset (((char *) ptr) + oldbytes, 0, bytes - oldbytes);
}
@@ -8157,7 +6296,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend)
h->vtable_entries_size = size;
}
- h->vtable_entries_used[addend / file_align] = TRUE;
+ h->vtable_entries_used[addend >> log_file_align] = TRUE;
return TRUE;
}
@@ -8453,9 +6592,10 @@ elf_bfd_discard_info (output_bfd, info)
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));
+ cookie.rels
+ = _bfd_elf_link_read_relocs (abfd, stab, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (cookie.rels != NULL)
{
cookie.rel = cookie.rels;
@@ -8476,9 +6616,10 @@ elf_bfd_discard_info (output_bfd, info)
cookie.rels = NULL;
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));
+ cookie.rels
+ = _bfd_elf_link_read_relocs (abfd, eh, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
cookie.rel = cookie.rels;
cookie.relend = cookie.rels;
if (cookie.rels != NULL)
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index bff78c84345..ab2ff21c887 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -704,9 +704,12 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
if (link_info->hash->creator->flavour != bfd_target_elf_flavour)
return FALSE;
- /* Nothing to do if there are no relocations. */
+ /* Nothing to do if there are no relocations or there is no need for
+ the relax finalize pass. */
if ((sec->flags & SEC_RELOC) == 0
- || sec->reloc_count == 0)
+ || sec->reloc_count == 0
+ || (link_info->relax_finalizing
+ && sec->need_finalize_relax == 0))
return TRUE;
/* If this is the first time we have been called for this section,
@@ -717,7 +720,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Load the relocations for this section. */
- internal_relocs = (_bfd_elfNN_link_read_relocs
+ internal_relocs = (_bfd_elf_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -756,11 +759,18 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
case R_IA64_PCREL21BI:
case R_IA64_PCREL21M:
case R_IA64_PCREL21F:
+ if (link_info->relax_finalizing)
+ continue;
is_branch = TRUE;
break;
case R_IA64_LTOFF22X:
case R_IA64_LDXMOV:
+ if (!link_info->relax_finalizing)
+ {
+ sec->need_finalize_relax = 1;
+ continue;
+ }
is_branch = FALSE;
break;
@@ -786,7 +796,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
goto error_return;
}
- isym = isymbuf + ELF64_R_SYM (irel->r_info);
+ isym = isymbuf + ELFNN_R_SYM (irel->r_info);
if (isym->st_shndx == SHN_UNDEF)
continue; /* We can't do anthing with undefined symbols. */
else if (isym->st_shndx == SHN_ABS)
@@ -1047,6 +1057,9 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
/* ??? Resize .rela.got too. */
}
+ if (link_info->relax_finalizing)
+ sec->need_finalize_relax = 0;
+
*again = changed_contents || changed_relocs;
return TRUE;
@@ -1076,7 +1089,7 @@ elfNN_ia64_relax_ldxmov (abfd, contents, off)
case 0: shift = 5; break;
case 1: shift = 14; off += 3; break;
case 2: shift = 23; off += 6; break;
- case 3:
+ default:
abort ();
}
@@ -1453,7 +1466,7 @@ elfNN_ia64_aix_link_add_symbols (abfd, info)
if (! elf_hash_table (info)->dynamic_sections_created
&& abfd->xvec == info->hash->creator)
{
- if (! bfd_elfNN_link_create_dynamic_sections (abfd, info))
+ if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
return FALSE;
}
@@ -1779,7 +1792,10 @@ elfNN_ia64_hash_hide_symbol (info, xh, force_local)
_bfd_elf_link_hash_hide_symbol (info, &h->root, force_local);
for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next)
- dyn_i->want_plt2 = 0;
+ {
+ dyn_i->want_plt2 = 0;
+ dyn_i->want_plt = 0;
+ }
}
/* Create the derived linker hash table. The IA-64 ELF port uses this
@@ -2622,7 +2638,10 @@ allocate_fptr (dyn_i, data)
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
- if (x->info->shared
+ if ((x->info->shared
+ && (!h
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
/* AIX needs an FPTR in this case. */
|| (elfNN_ia64_aix_vec (x->info->hash->creator)
&& (!h
@@ -2747,15 +2766,18 @@ allocate_dynrel_entries (dyn_i, data)
struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
struct elfNN_ia64_link_hash_table *ia64_info;
struct elfNN_ia64_dyn_reloc_entry *rent;
- bfd_boolean dynamic_symbol, shared;
+ bfd_boolean dynamic_symbol, shared, resolved_zero;
ia64_info = elfNN_ia64_hash_table (x->info);
dynamic_symbol = elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info)
|| (elfNN_ia64_aix_vec (x->info->hash->creator)
/* Don't allocate an entry for __GLOB_DATA_PTR */
&& (!dyn_i->h || strcmp (dyn_i->h->root.root.string,
- "__GLOB_DATA_PTR") != 0));
+ "__GLOB_DATA_PTR") != 0));
shared = x->info->shared;
+ resolved_zero = (dyn_i->h
+ && ELF_ST_VISIBILITY (dyn_i->h->other)
+ && dyn_i->h->root.type == bfd_link_hash_undefweak);
/* Take care of the normal data relocations. */
@@ -2800,8 +2822,12 @@ allocate_dynrel_entries (dyn_i, data)
/* Take care of the GOT and PLT relocations. */
- if (((dynamic_symbol || shared) && (dyn_i->want_got || dyn_i->want_gotx))
- || (dyn_i->want_ltoff_fptr && dyn_i->h && dyn_i->h->dynindx != -1))
+ if ((!resolved_zero
+ && (dynamic_symbol || shared)
+ && (dyn_i->want_got || dyn_i->want_gotx))
+ || (dyn_i->want_ltoff_fptr
+ && dyn_i->h
+ && dyn_i->h->dynindx != -1))
ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela);
if ((dynamic_symbol || shared) && dyn_i->want_tprel)
ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela);
@@ -2810,7 +2836,7 @@ allocate_dynrel_entries (dyn_i, data)
if (dynamic_symbol && dyn_i->want_dtprel)
ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela);
- if (dyn_i->want_pltoff)
+ if (!resolved_zero && dyn_i->want_pltoff)
{
bfd_size_type t = 0;
@@ -3418,7 +3444,11 @@ set_got_entry (abfd, info, dyn_i, dynindx, addend, value, dyn_r_type)
bfd_put_64 (abfd, value, got_sec->contents + got_offset);
/* Install a dynamic relocation if needed. */
- if ((info->shared && dyn_r_type != R_IA64_DTPREL64LSB)
+ if ((info->shared
+ && (!dyn_i->h
+ || ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
+ || dyn_i->h->root.type != bfd_link_hash_undefweak)
+ && dyn_r_type != R_IA64_DTPREL64LSB)
|| elfNN_ia64_dynamic_symbol_p (dyn_i->h, info)
|| elfNN_ia64_aix_vec (abfd->xvec)
|| (dynindx != -1 && dyn_r_type == R_IA64_FPTR64LSB))
@@ -3539,7 +3569,11 @@ set_pltoff_entry (abfd, info, dyn_i, value, is_plt)
bfd_put_64 (abfd, gp, pltoff_sec->contents + dyn_i->pltoff_offset + 8);
/* Install dynamic relocations if needed. */
- if (!is_plt && info->shared)
+ if (!is_plt
+ && info->shared
+ && (!dyn_i->h
+ || ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
+ || dyn_i->h->root.type != bfd_link_hash_undefweak))
{
unsigned int dyn_r_type;
@@ -3859,6 +3893,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
asection *sym_sec;
bfd_byte *hit_addr;
bfd_boolean dynamic_symbol_p;
+ bfd_boolean local_symbol_p;
bfd_boolean undef_weak_ref;
r_type = ELFNN_R_TYPE (rel->r_info);
@@ -3970,6 +4005,11 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
hit_addr = contents + rel->r_offset;
value += rel->r_addend;
dynamic_symbol_p = elfNN_ia64_dynamic_symbol_p (h, info);
+ /* Is this symbol locally defined? A protected symbol is locallly
+ defined. But its function descriptor may not. Use it with
+ caution. */
+ local_symbol_p = (! dynamic_symbol_p
+ || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT);
switch (r_type)
{
@@ -4002,7 +4042,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
/* If we don't need dynamic symbol lookup, find a
matching RELATIVE relocation. */
dyn_r_type = r_type;
- if (dynamic_symbol_p)
+ if (! local_symbol_p)
{
dynindx = h->dynindx;
addend = rel->r_addend;
@@ -4331,7 +4371,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
/* If we don't need dynamic symbol lookup, install two
RELATIVE relocations. */
- if (! dynamic_symbol_p)
+ if (local_symbol_p)
{
unsigned int dyn_r_type;
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 0c3a5d96fca..72516f71f1c 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -542,7 +542,7 @@ static bfd *reldyn_sorting_bfd;
/* The default alignment for sections, as a power of two. */
#define MIPS_ELF_LOG_FILE_ALIGN(abfd) \
- (get_elf_backend_data (abfd)->s->file_align == 8 ? 3 : 2)
+ (get_elf_backend_data (abfd)->s->log_file_align)
/* Get word-sized data. */
#define MIPS_ELF_GET_WORD(abfd, ptr) \
@@ -5106,10 +5106,10 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
sizeof CALL_FP_STUB - 1) == 0)
continue;
- sec_relocs = (MNAME(abfd,_bfd_elf,link_read_relocs)
- (abfd, o, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory));
+ sec_relocs
+ = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (sec_relocs == NULL)
return FALSE;
@@ -5561,9 +5561,9 @@ _bfd_mips_relax_section (abfd, sec, link_info, again)
if (link_info->relocateable)
return TRUE;
- internal_relocs = (MNAME(abfd,_bfd_elf,link_read_relocs)
- (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
- link_info->keep_memory));
+ internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ link_info->keep_memory);
if (internal_relocs == NULL)
return TRUE;
@@ -7887,10 +7887,9 @@ _bfd_mips_elf_discard_info (abfd, cookie, info)
if (! tdata)
return FALSE;
- cookie->rels = (MNAME(abfd,_bfd_elf,link_read_relocs)
- (abfd, o, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory));
+ cookie->rels = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (!cookie->rels)
{
free (tdata);
@@ -9174,12 +9173,25 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd)
/* Check if we have the same endianess */
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
- return FALSE;
+ {
+ (*_bfd_error_handler)
+ (_("%s: endianness incompatible with that of the selected emulation"),
+ bfd_archive_filename (ibfd));
+ return FALSE;
+ }
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
return TRUE;
+ if (strcmp (bfd_get_target (ibfd), bfd_get_target (obfd)) != 0)
+ {
+ (*_bfd_error_handler)
+ (_("%s: ABI is incompatible with that of the selected emulation"),
+ bfd_archive_filename (ibfd));
+ return FALSE;
+ }
+
new_flags = elf_elfheader (ibfd)->e_flags;
elf_elfheader (obfd)->e_flags |= new_flags & EF_MIPS_NOREORDER;
old_flags = elf_elfheader (obfd)->e_flags;
diff --git a/bfd/reloc.c b/bfd/reloc.c
index f3f642840b8..6aea881f385 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -2727,7 +2727,7 @@ ENUMX
ENUMX
BFD_RELOC_SH_TLS_TPOFF32
ENUMDOC
- Renesas SH relocs. Not all of these appear in object files.
+ Renesas / SuperH SH relocs. Not all of these appear in object files.
ENUM
BFD_RELOC_THUMB_PCREL_BRANCH9
@@ -2854,7 +2854,7 @@ ENUMDOC
ENUM
BFD_RELOC_M32R_24
ENUMDOC
- Mitsubishi M32R relocs.
+ Renesas M32R (formerly Mitsubishi M32R) relocs.
This is a 24 bit absolute address.
ENUM
BFD_RELOC_M32R_10_PCREL
diff --git a/bfd/section.c b/bfd/section.c
index 89f8126536c..04f439e9b4e 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -396,8 +396,10 @@ CODE_FRAGMENT
. {* Bits used by various backends. *}
. unsigned int has_tls_reloc:1;
.
+. {* Nonzero if this section needs the relax finalize pass. *}
+. unsigned int need_finalize_relax:1;
+.
. {* Usused bits. *}
-. unsigned int flag11:1;
. unsigned int flag12:1;
. unsigned int flag13:1;
. unsigned int flag14:1;
@@ -615,8 +617,8 @@ static const asymbol global_syms[] =
/* linker_mark, linker_has_input, gc_mark, segment_mark, */ \
0, 0, 1, 0, \
\
- /* sec_info_type, use_rela_p, has_tls_reloc, flag11, flag12, */ \
- 0, 0, 0, 0, 0, \
+ /* sec_info_type, use_rela_p, has_tls_reloc, need_finalize_relax, flag12, */ \
+ 0, 0, 0, 0, 0, \
\
/* flag13, flag14, flag15, flag16, flag20, flag24, */ \
0, 0, 0, 0, 0, 0, \
diff --git a/bfd/version.h b/bfd/version.h
index 0d88243137f..235b6c252c1 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,3 +1,3 @@
-#define BFD_VERSION_DATE 20030419
+#define BFD_VERSION_DATE 20030509
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_string@
diff --git a/bfd/xtensa-isa.c b/bfd/xtensa-isa.c
index ffbef53dfd4..761e5c6bb69 100644
--- a/bfd/xtensa-isa.c
+++ b/bfd/xtensa-isa.c
@@ -159,7 +159,7 @@ configuration.\n"
static int
xtensa_add_isa (xtensa_isa_internal *isa, libisa_module_specifier libisa)
{
- const int (*get_num_opcodes_fn) (void);
+ int (*get_num_opcodes_fn) (void);
struct config_struct *(*get_config_table_fn) (void);
xtensa_opcode_internal **(*get_opcodes_fn) (void);
int (*decode_insn_fn) (const xtensa_insnbuf);
diff --git a/bfd/xtensa-modules.c b/bfd/xtensa-modules.c
index d023b5233e1..e5d7682f09a 100644
--- a/bfd/xtensa-modules.c
+++ b/bfd/xtensa-modules.c
@@ -41,7 +41,7 @@ tie_undo_reloc_l (uint32 offset, uint32 pc)
}
xtensa_opcode_internal** get_opcodes (void);
-const int get_num_opcodes (void);
+int get_num_opcodes (void);
int decode_insn (const xtensa_insnbuf);
int interface_version (void);
@@ -5463,7 +5463,7 @@ get_opcodes (void)
return &opcodes[0];
}
-const int
+int
get_num_opcodes (void)
{
return 149;
diff --git a/config-ml.in b/config-ml.in
index aae3f87fe74..e227500c4a0 100644
--- a/config-ml.in
+++ b/config-ml.in
@@ -17,8 +17,6 @@
# . ${srcdir}/../config-ml.in
# fi
#
-# See librx/configure.in in the libg++ distribution for an example of how
-# to handle autoconf'd libraries.
#
# Things are complicated because 6 separate cases must be handled:
# 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6.
@@ -30,13 +28,10 @@
# The build tree is layed out as
#
# ./
-# libg++
# newlib
# m68020/
-# libg++
# newlib
# m68881/
-# libg++
# newlib
#
# The nice feature about this arrangement is that inter-library references
@@ -69,11 +64,6 @@
# newlib. It is up to each target to turn on multilib support for the other
# libraries as desired.
-# We have to handle being invoked by both Cygnus configure and Autoconf.
-#
-# Cygnus configure incoming variables:
-# srcdir, subdir, host, arguments
-#
# Autoconf incoming variables:
# srcdir, host, ac_configure_args
#
@@ -83,21 +73,10 @@
# Note that `host' in this case is GCC's `target'. Target libraries are
# configured for a particular host.
-if [ -n "${ac_configure_args}" ]; then
- Makefile=${ac_file-Makefile}
- ml_config_shell=${CONFIG_SHELL-/bin/sh}
- ml_arguments="${ac_configure_args}"
- ml_realsrcdir=${srcdir}
-else
- Makefile=${Makefile-Makefile}
- ml_config_shell=${config_shell-/bin/sh}
- ml_arguments="${arguments}"
- if [ -n "${subdir}" -a "${subdir}" != "." ] ; then
- ml_realsrcdir=${srcdir}/${subdir}
- else
- ml_realsrcdir=${srcdir}
- fi
-fi
+Makefile=${ac_file-Makefile}
+ml_config_shell=${CONFIG_SHELL-/bin/sh}
+ml_arguments="${ac_configure_args}"
+ml_realsrcdir=${srcdir}
# Scan all the arguments and set all the ones we need.
@@ -156,7 +135,7 @@ done
if [ "${enable_multilib}" = yes ]; then
# Compute whether this is the library's top level directory
-# (ie: not a multilib subdirectory, and not a subdirectory like libg++/src).
+# (ie: not a multilib subdirectory, and not a subdirectory like newlib/src).
# ${with_multisubdir} tells us we're in the right branch, but we could be
# in a subdir of that.
# ??? The previous version could void this test by separating the process into
@@ -397,6 +376,28 @@ mips*-*-*)
esac
;;
powerpc*-*-* | rs6000*-*-*)
+ if [ x$enable_aix64 = xno ]
+ then
+ old_multidirs="${multidirs}"
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "$x" in
+ *ppc64* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
+ if [ x$enable_pthread = xno ]
+ then
+ old_multidirs="${multidirs}"
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "$x" in
+ *pthread* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
if [ x$enable_softfloat = xno ]
then
old_multidirs="${multidirs}"
@@ -463,17 +464,6 @@ powerpc*-*-* | rs6000*-*-*)
esac
done
fi
- if [ x$enable_aix = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *mcall-aix* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
;;
sparc*-*-*)
case " $multidirs " in
@@ -533,6 +523,7 @@ multi-do:
CFLAGS="$(CFLAGS) $${flags}" \
prefix="$(prefix)" \
exec_prefix="$(exec_prefix)" \
+ GCJFLAGS="$(GCJFLAGS) $${flags}" \
CXXFLAGS="$(CXXFLAGS) $${flags}" \
LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
@@ -723,7 +714,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
;;
*)
case "${srcdir}" in
- /*) # absolute path
+ /* | [A-Za-z]:[\\/]* ) # absolute path
ml_newsrcdir=${srcdir}
;;
*) # otherwise relative
@@ -736,12 +727,12 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
esac
case "${progname}" in
- /*) ml_recprog=${progname} ;;
+ /* | [A-Za-z]:[\\/]* ) ml_recprog=${progname} ;;
*) ml_recprog=${dotdot}${progname} ;;
esac
# FIXME: POPDIR=${PWD=`pwd`} doesn't work here.
- ML_POPDIR=`pwd`
+ ML_POPDIR=`${PWDCMD-pwd}`
cd ${ml_dir}/${ml_libdir}
if [ -f ${ml_newsrcdir}/configure ]; then
@@ -756,11 +747,12 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
break
fi
done
- ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags"'
+ ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" GCJ="${GCJ_}$flags"'
if [ "${with_target_subdir}" = "." ]; then
CC_=$CC' '
CXX_=$CXX' '
+ GCJ_=$GCJ' '
else
# Create a regular expression that matches any string as long
# as ML_POPDIR.
@@ -789,6 +781,18 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
esac
done
+ GCJ_=
+ for arg in ${GCJ}; do
+ case $arg in
+ -[BIL]"${ML_POPDIR}"/*)
+ GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ "${ML_POPDIR}"/*)
+ GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ *)
+ GCJ_="${GCJ_}${arg} " ;;
+ esac
+ done
+
if test "x${LD_LIBRARY_PATH+set}" = xset; then
LD_LIBRARY_PATH_=
for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do
diff --git a/cpu/ChangeLog b/cpu/ChangeLog
new file mode 100644
index 00000000000..c66cc4b7b95
--- /dev/null
+++ b/cpu/ChangeLog
@@ -0,0 +1,11 @@
+2003-05-02 Andrew Cagney <cagney@redhat.com>
+
+ * New file.
+
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ad86a9055ca..9c58b41c498 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,726 @@
+2003-05-08 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.h (max_register_size): Delete declaration.
+ * regcache.c (max_register_size): Delete function.
+ (struct regcache_descr): Delete field "max_register_size".
+ (init_regcache_descr, init_legacy_regcache_descr): Assert that all
+ registers fit in MAX_REGISTER_SIZE.
+ (regcache_save): Replace max_register_size with MAX_REGISTER_SIZE.
+ (regcache_restore, regcache_xfer_part, regcache_dump): Ditto.
+ * thread-db.c: Replace max_register_size with MAX_REGISTER_SIZE.
+ * sh-tdep.c, rom68k-rom.c, remote-sim.c, remote-mips.c: Ditto.
+ * remote-e7000.c, monitor.c, mipsv4-nat.c, mips-nat.c: Ditto.
+ * m68klinux-nat.c, lynx-nat.c, irix4-nat.c: Ditto.
+ * hpux-thread.c, hppah-nat.c, hppab-nat.c, hppa-tdep.c: Ditto.
+ * dve3900-rom.c, hppa-tdep.c: Ditto.
+
+2003-05-08 David Carlton <carlton@math.stanford.edu>
+
+ * valops.c (push_word): Fix typo.
+
+2003-05-08 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh: Delete references to MAX_REGISTER_RAW_SIZE.
+ * gdbarch.h: Re-generate.
+ * defs.h (MAX_REGISTER_RAW_SIZE): Delete macro.
+ (legacy_max_register_raw_size): Delete declaration.
+ * regcache.c (legacy_max_register_raw_size): Delete function.
+ * valops.c: Replace MAX_REGISTER_RAW_SIZE with MAX_REGISTER_SIZE.
+ * target.c, stack.c, sparc-tdep.c, sh-tdep.c: Ditto.
+ * rs6000-tdep.c, rs6000-nat.c, remote.c, remote-sim.c: Ditto.
+ * remote-rdp.c, remote-array.c, regcache.c: Ditto.
+ * ppc-linux-nat.c, monitor.c, mn10300-tdep.c: Ditto.
+ * mips-tdep.c, mips-linux-tdep.c, m68klinux-nat.c: Ditto.
+ * infptrace.c, ia64-tdep.c, i386-tdep.c, frame.c: Ditto.
+ * findvar.c, dwarf2cfi.c: Ditto.
+
+2003-05-08 Andrew Cagney <cagney@redhat.com>
+
+ * mips-tdep.c (read_signed_register): New function, moved to here
+ from "regcache.c".
+ (read_signed_register_pid): Ditto.
+ * regcache.c (read_signed_register_pid): Delete function, moved to
+ "mips-tdep.c".
+ (read_signed_register): Ditto.
+ * regcache.h (read_signed_register): Delete declaration.
+ (read_signed_register_pid): Delete declaration.
+
+2003-05-08 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh: Add comments on MAX_REGISTER_SIZE.
+ * gdbarch.h: Re-generate.
+ * defs.h (MAX_REGISTER_VIRTUAL_SIZE): Delete macro.
+ (legacy_max_register_virtual_size): Delete declaration.
+ * infcmd.c (default_print_registers_info): Use MAX_REGISTER_SIZE.
+ * d10v-tdep.c (d10v_print_registers_info): Ditto.
+ * tracepoint.c (memrange_sortmerge): Ditto.
+ * sparc-tdep.c (sparc_print_registers): Ditto.
+ * regcache.c (legacy_max_register_virtual_size): Delete function.
+
+2002-05-08 J. Brobecker <brobecker@gnat.com>
+
+ * fork-child.c (escape_bang_in_quoted_argument): New function.
+ (fork_inferior): Escape '!' characters in quoted arguments
+ only when needed.
+
+2003-05-08 J. Brobecker <brobecker@gnat.com>
+
+ * dwarf2read.c (set_cu_language): Set the language to "minimal" if
+ the language of the CU is not currently supported by GDB.
+
+2003-05-08 J. Brobecker <brobecker@gnat.com>
+
+ * defs.h (language): Add language_minimal enum value.
+ * c-lang.c (minimal_language_defn): New language definition.
+ (_initialize_c_language): Add the new minimal language to the list
+ of languages known to GDB.
+
+2003-05-08 Kevin Buettner <kevinb@redhat.com>
+
+ * frame.c (get_frame_type): Don't attempt to lazily initialize
+ frame's unwinder for legacy frames.
+
+2003-05-07 Andrew Cagney <cagney@redhat.com>
+
+ * ia64-tdep.c (ia64_remote_translate_xfer_address): Add "gdbarch"
+ and "regcache" parameters.
+ * avr-tdep.c (avr_remote_translate_xfer_address): Ditto.
+
+2003-05-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ * dwarf2read.c (dwarf_decode_lines): Only use output of
+ check_cu_functions() when calling record_line(). Do not update
+ the current address.
+
+2003-05-07 Andrew Cagney <cagney@redhat.com>
+
+ * fork-child.c (startup_inferior): Delete #ifdef STARTUP_INFERIOR
+ code.
+
+2003-05-07 Jim Blandy <jimb@redhat.com>
+
+ Rename commands 'maint list symtabs' and 'maint list psymtabs' to
+ 'maint info symtabs' and 'maint info psymtabs'.
+ * symmisc.c (maintenance_info_symtabs, maintenance_info_psymtabs):
+ Renamed from maintenance_list_symtabs and maintenance_list_psymtabs.
+ * symtab.h (maintenance_info_symtabs, maintenance_info_psymtabs):
+ Declarations updated.
+ * maint.c (maintenance_list_command): Delete.
+ (_initialize_maint_cmds): Update calls to add_cmd.
+ * gdbcmd.h (maintenancelistlist): Delete declaration.
+ * cli/cli-cmds.c (maintenancelistlist): Delete.
+ (init_cmd_lists): Don't initialize it.
+ * cli/cli-cmds.h (maintenancelistlist): Delete declaration.
+
+2003-05-07 Andrew Cagney <cagney@redhat.com>
+
+ * d10v-tdep.c (remote_d10v_translate_xfer_address): Add
+ "regcache".
+ (d10v_print_registers_info): Update.
+ (d10v_dmap_register, d10v_imap_register): Delete functions.
+ (struct gdbarch_tdep): Add "regcache" parameter to "dmap_register"
+ and "imap_register".
+ (d10v_ts2_dmap_register, d10v_ts2_imap_register): Add "regcache".
+ (d10v_ts3_dmap_register, d10v_ts3_imap_register): Add "regcache".
+ * arch-utils.c (generic_remote_translate_xfer_address): Add
+ "regcache" and "gdbarch" parameters.
+ * gdbarch.sh (REMOTE_TRANSLATE_XFER_ADDRESS): Add "regcache"
+ parameter. Change class to multi-arch.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * remote.c (remote_xfer_memory): Use
+ gdbarch_remote_translate_xfer_address.
+
+2003-05-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ * infrun.c (prev_pc): Move declaration ahead of proceed().
+ (proceed): Refresh prev_pc value before resuming.
+ (stop_stepping): Remove code to refresh prev_pc.
+
+2003-05-06 Kris Warkentin <kewarken@qnx.com>
+
+ * nto-tdep.c: Removed stray comment.
+
+2003-05-06 Kris Warkentin <kewarken@qnx.com>
+
+ * i386-nto-tdep.c: Fix old K&R function definitions.
+ * nto-tdep.c: Likewise and change stat.h include to gdb_stat.h.
+ Also change add_show_from_set() call to add_setshow_cmd().
+ * nto-tdep.h: Remove PARAMS and grep ^func ARI hits.
+
+2003-05-05 Andrew Cagney <cagney@redhat.com>
+
+ * dummy-frame.c: Include "command.h" and "gdbcmd.h".
+ (fprint_dummy_frames): New function.
+ (maintenance_print_dummy_frames): New function.
+ (_initialize_dummy_frame): Add command "maint print dummy-frames".
+ * frame.c (fprint_frame_id): Make global.
+ * frame.h (fprint_frame_id): Declare.
+ * Makefile.in (dummy-frame.o): Update dependencies.
+
+2003-05-05 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_REGISTER_SIZE): Rename REGISTER_SIZE.
+ (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS): Rename
+ SIZEOF_CALL_DUMMY_WORDS.
+ (DEPRECATED_CALL_DUMMY_WORDS): Rename CALL_DUMMY_WORDS.
+ (DEPRECATED_FIX_CALL_DUMMY): Rename FIX_CALL_DUMMY.
+ (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET): Rename
+ CALL_DUMMY_BREAKPOINT_OFFSET.
+ (DEPRECATED_CALL_DUMMY_START_OFFSET): Rename
+ CALL_DUMMY_START_OFFSET.
+ (DEPRECATED_CALL_DUMMY_LENGTH): Rename CALL_DUMMY_LENGTH.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * alpha-tdep.c, alphafbsd-tdep.c, arm-linux-tdep.c: Update.
+ * arm-tdep.c, avr-tdep.c, breakpoint.c, cris-tdep.c: Update.
+ * dummy-frame.c, dummy-frame.h, frv-tdep.c, gdbarch.c: Update.
+ * gdbarch.h, gdbarch.sh, h8300-tdep.c, hppa-tdep.c: Update.
+ * i386-tdep.c, ia64-tdep.c, infcall.c, inferior.h: Update.
+ * m68hc11-tdep.c, m68k-tdep.c, mcore-tdep.c: Update.
+ * mips-tdep.c, mn10300-tdep.c, ns32k-tdep.c: Update.
+ * rs6000-tdep.c, s390-tdep.c, sh-tdep.c, sol-thread.c: Update.
+ * sparc-tdep.c, target.c, v850-tdep.c, valops.c: Update.
+ * vax-tdep.c, x86-64-tdep.c, xstormy16-tdep.c: Update.
+ * config/ia64/tm-ia64.h, config/m68k/tm-vx68.h: Update.
+ * config/mips/tm-mips.h, config/pa/nm-hppah.h: Update.
+ * config/pa/tm-hppa.h, config/pa/tm-hppa64.h: Update.
+ * config/s390/tm-s390.h, config/sparc/tm-sp64.h: Update.
+ * config/sparc/tm-sparc.h: Update.
+
+2003-05-05 Kris Warkentin <kewarken@qnx.com>
+
+ * configure.tgt: Add i[3456]86-*-nto*.
+ * i386-nto-tdep.c: New file. i386 specific support for QNX Neutrino.
+ * nto-tdep.c: New file. Neutrino target support routines.
+ * nto-tdep.h: New file. Neutrino target header.
+ * config/tm-qnxnto.h: New file.
+ * config/i386/i386nto.mt: New file.
+ * config/i386/tm-i386nto.h: New file.
+
+2003-05-04 Andrew Cagney <cagney@redhat.com>
+
+ * gdbthread.h (save_infrun_state): Drop prev_func_name parameter.
+ (load_infrun_state): Ditto.
+ (struct thread_info): Drop "prev_func_name" field.
+ * thread.c (load_infrun_state): Update.
+ (save_infrun_state): Update.
+ * infrun.c (prev_func_name): Delete variable.
+ (init_wait_for_inferior): Do not clear prev_func_name.
+ (stop_stepping, keep_going, context_switch): Do not swap
+ prev_func_name.
+ (handle_inferior_event, check_sigtramp2): Use pc_in_sigtramp
+ instead of PC_IN_SIGTRAMP.
+
+2003-05-04 Andrew Cagney <cagney@redhat.com>
+
+ * sentinel-frame.c (sentinel_frame_prev_register): Replace
+ REGISTER_BYTE with register_offset_hack.
+ * regcache.c (init_regcache_descr): When REGISTER_BYTE_P, check
+ that REGISTER_BYTE is consistent with the regcache.
+ * gdbarch.sh (REGISTER_BYTE): Add a predicate.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+2003-05-04 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-tdep.c (fxsave_offset): Add entries for %xmm8-%xmm15.
+ (FXSAVE_ADDR, i387_supply_fxsave): Add support for %xmm8-%xmm15.
+
+ * i386-linux-nat.c (supply_gregset): Remove unnecessary casts.
+
+2003-05-03 J. Brobecker <brobecker@gnat.com>
+
+ From Thierry Schneider <tpschneider1@yahoo.com>
+ * Makfile.in (SUBDIR_MI_OBS): Add dependency on mi-cmd-symbol.o.
+ (SUBDIR_MI_SRCS): Add mi-cmd-symbol.c.
+ (mi-cmd-symbol.o): Add rule.
+
+2003-05-03 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (PUSH_DUMMY_CODE): New architecture method, add
+ comments noteing that it replaces the old FIX_CALL_DUMMY code.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * d10v-tdep.c (d10v_push_dummy_code): New function.
+ (d10v_gdbarch_init): Set push_dummy_code.
+ * infcall.c (legacy_push_dummy_code): New function.
+ (generic_push_dummy_code): New function.
+ (push_dummy_code): New function.
+ (call_function_by_hand): Call push_dummy_code. Pass bp_addr,
+ instead of dummy_addr, to push_dummy_call. Move call to
+ generic_save_call_dummy_addr to outside of CALL_DUMMY_LOCATION
+ switch.
+ * sparc-tdep.c (sparc_gdbarch_init): Mention push_dummy_code.
+
+2003-05-03 Andrew Cagney <cagney@redhat.com>
+
+ * disasm.h (print_insn): Declare.
+ * disasm.c (init_gdb_disassemble_info): New function.
+ (gdb_disassembly): Call init_gdb_disassemble_info.
+ (gdb_print_insn): New function.
+ * v850-tdep.c (v850_scan_prologue): Call gdb_print_insn, instead
+ of TARGET_PRINT_INSN. Send debug info to "gdb_stdlog".
+ * mcore-tdep.c: Include "disasm.h"
+ (mcore_dump_insn): Call gdb_print_insn, instead of TARGET_PRINT_INSN.
+ * d10v-tdep.c: Include "disasm.h".
+ (display_trace): Call gdb_print_insn, instead of print_insn.
+ (print_insn): Delete function.
+ * printcmd.c: Include "disasm.h".
+ (print_insn): Delete function.
+ (print_formatted): Call gdb_print_insn, instead of print_insn.
+ * Makefile.in (printcmd.o): Update dependencies.
+ (mcore-tdep.o, d10v-tdep.o): Ditto.
+
+2003-05-02 Andrew Cagney <cagney@redhat.com>
+
+ * std-regs.c (value_of_builtin_frame_pc_reg): Delete #ifdef
+ PC_REGNUM, re-indent.
+ * stack.c (frame_info): Use "pc" for the name of get_frame_pc when
+ PC_REGNUM isn't set.
+
+ * gdbarch.sh (REGISTER_SIZE, REGISTER_BYTES): Make optional.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * d10v-tdep.c (d10v_gdbarch_init): Do not set register_size,
+ register_virtual_size, pc_regnum, or register_bytes.
+ (D10V_PC_REGNUM): Rename _PC_REGNUM.
+ (d10v_register_type): Use D10V_PC_REGNUM.
+ (d10v_print_registers_info, d10v_read_pc): Ditto.
+ (d10v_write_pc, d10v_eva_prepare_to_trace): Ditto.
+ (d10v_unwind_pc, d10v_frame_prev_register): Ditto.
+
+2003-05-02 David Carlton <carlton@bactrian.org>
+
+ * objfiles.c (allocate_objfile): For anonymous objfiles, allocate
+ the name with mstrsave.
+
+2003-05-02 Elena Zannoni <ezannoni@redhat.com>
+
+ * charset.c (GDB_DEFAULT_TARGET_CHARSET,
+ GDB_DEFAULT_HOST_CHARSET): Move to earlier in the file.
+ (host_charset_name, target_charset_name): New vars for use by
+ set/show commands.
+ (host_charset_enum, target_charset_enum): New enums for set/show
+ commands.
+ (set_charset_sfunc, set_host_charset_sfunc,
+ set_target_charset_sfunc): New functions.
+ (set_host_charset, set_target_charset): Make static.
+ (list_charsets, set_host_charset_command,
+ set_target_charset_command): Delete functions.
+ (show_charset_command): Rewrite as....
+ (show_charset): Hook this up with the set/show command mechanism.
+ (_initialize_charset): Change names of charsets to match the
+ set/show enums. Use host_charset_name and target_charset_name.
+ Use set/show mechanism for charset, host-charset, target-charset
+ commands. Do not make 'show host-charset' and 'show
+ target-charset' be aliases of 'show charset'.
+
+ * charset.h (set_host_charset, set_target_charset): Don't export,
+ they are not used outside the file.
+
+2003-05-01 Andrew Cagney <cagney@redhat.com>
+
+ * disasm.c (gdb_disassemble_from_exec): Delete global variable.
+ (gdb_disassembly): Make "di" non static, always initialize and
+ cleanup. Always use dis_asm_read_memory.
+ (gdb_dis_asm_read_memory): Delete function.
+
+2003-05-01 Andrew Cagney <cagney@redhat.com>
+
+ * d10v-tdep.c (d10v_frame_align): Replace d10v_stack_align.
+ (d10v_gdbarch_init): Set frame_align instead of stack_align.
+
+2003-04-30 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (deprecated_tm_print_insn_info): Rename
+ "tm_print_insn_info".
+ (TARGET_PRINT_INSN_INFO): Delete macro.
+ (dis_asm_read_memory): Delete function declaration.
+ (dis_asm_memory_error, dis_asm_print_address): Ditto.
+ (tm_print_insn_info): Delete variable definition.
+ (_initialize_gdbarch): Do not initialize "tm_print_insn_info".
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * d10v-tdep.c (display_trace): Replace "tm_print_insn_info" with
+ "deprecated_tm_print_insn_info".
+ * mcore-tdep.c (mcore_dump_insn): Ditto.
+ * mips-tdep.c (mips_gdbarch_init): Ditto.
+ * sparc-tdep.c (_initialize_sparc_tdep): Ditto.
+ * v850-tdep.c (v850_scan_prologue, v850_gdbarch_init): Ditto.
+ * ia64-tdep.c (_initialize_ia64_tdep): Ditto.
+ * printcmd.c (print_insn): Use "deprecated_tm_print_insn_info"
+ instead of TARGET_PRINT_INSN_INFO, add comment.
+ * s390-tdep.c (s390_get_frame_info): Instead of
+ "dis_asm_read_memory", use "deprecated_tm_print_insn_info".
+ (s390_check_function_end, s390_is_sigreturn): Ditto.
+ * corefile.c (dis_asm_read_memory): Move to "disasm.c".
+ (dis_asm_memory_error, dis_asm_print_address): Ditto.
+ * disasm.c: Include "gdbcore.h".
+ (_initialize_disasm): New function, initialize
+ "deprecated_tm_print_insn_info".
+ (deprecated_tm_print_insn_info): New variable.
+ (dis_asm_read_memory): Moved from "corefile.c", made static.
+ (dis_asm_print_address, dis_asm_memory_error): Ditto.
+ * Makefile.in (disasm.o): Update dependencies.
+
+2003-04-30 Andrew Cagney <cagney@redhat.com>
+
+ * sparc-tdep.c (SPARC_HAS_FPU): When multi-arch, define as 1.
+
+2003-04-29 Adam Fedor <fedor@gnu.org>
+
+ * eval.c (evaluate_subexp_standard): Handle ObjC ops.
+ * infcall.c (find_function_addr): Make non-static.
+ * infcall.h (find_function_addr): Declare.
+ * Makefile.in (eval.o): Update dependencies.
+
+2003-04-28 Adam Fedor <fedor@gnu.org>
+
+ * symtab.c (symbol_find_demangled_name): Check for and demangle
+ ObjC symbols.
+ (symbol_init_demangled_name): Init for language_objc as well.
+
+2003-04-28 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_TARGET_READ_FP): Replace TARGET_READ_FP.
+ (DEPRECATED_FP_REGNUM): Replace FP_REGNUM.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * infcall.c (call_function_by_hand): Use DEPRECATED_FP_REGNUM,
+ DEPRECATED_TARGET_READ_FP, or "sp" to create the dummy frame ID.
+ * inferior.h (deprecated_read_fp): Rename read_fp.
+ (generic_target_read_fp): Delete declaration.
+ * regcache.c (generic_target_read_fp): Delete function.
+ (deprecated_read_fp): Replace read_fp, use
+ DEPRECATED_TARGET_READ_FP or DEPRECATED_FP_REGNUM.
+ * d10v-tdep.c (d10v_read_fp): Delete function.
+ (d10v_gdbarch_init): Do not set deprecated_read_fp.
+
+ * sparc-tdep.c (sparc_gdbarch_init): Do not set
+ deprecated_target_read_fp to generic_target_read_fp.
+ * sh-tdep.c (sh_gdbarch_init): Ditto.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Ditto.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto.
+ * frv-tdep.c (frv_gdbarch_init): Ditto.
+
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Set
+ deprecated_fp_regnum.
+ * x86-64-tdep.c (x86_64_init_abi): Ditto.
+ * vax-tdep.c (vax_gdbarch_init): Ditto.
+ * v850-tdep.c (v850_gdbarch_init): Ditto.
+ * sparc-tdep.c (sparc_gdbarch_init): Ditto.
+ * sh-tdep.c (sh_gdbarch_init): Ditto.
+ * s390-tdep.c (s390_gdbarch_init): Ditto.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Ditto.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
+ * mcore-tdep.c (mcore_gdbarch_init): Ditto.
+ * m68k-tdep.c (m68k_gdbarch_init): Ditto.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto.
+ * ia64-tdep.c (ia64_gdbarch_init): Ditto.
+ * i386-tdep.c (i386_gdbarch_init): Ditto.
+ * hppa-tdep.c (hppa_gdbarch_init): Ditto.
+ * h8300-tdep.c (h8300_gdbarch_init): Ditto.
+ * frv-tdep.c (frv_gdbarch_init): Ditto.
+ * cris-tdep.c (cris_gdbarch_init): Ditto.
+ * avr-tdep.c (avr_gdbarch_init): Ditto.
+ * arm-tdep.c (arm_gdbarch_init): Ditto.
+ * alpha-tdep.c (alpha_gdbarch_init): Ditto.
+
+ * x86-64-tdep.c (x86_64_init_abi): Set deprecated_target_read_fp.
+ * v850-tdep.c (v850_gdbarch_init): Ditto.
+ * sparc-tdep.c (sparc_gdbarch_init): Ditto.
+ * sh-tdep.c (sh_gdbarch_init): Ditto.
+ * s390-tdep.c (s390_gdbarch_init): Ditto.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Ditto.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
+ * mips-tdep.c (mips_gdbarch_init): Ditto.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto.
+ * ia64-tdep.c (ia64_gdbarch_init): Ditto.
+ * hppa-tdep.c (hppa_gdbarch_init): Ditto.
+ * frv-tdep.c (frv_gdbarch_init): Ditto.
+ * avr-tdep.c (avr_gdbarch_init): Ditto.
+ * arm-tdep.c (arm_gdbarch_init): Ditto.
+
+ * vax-tdep.c (vax_frame_init_saved_regs): Replace FP_REGNUM with
+ DEPRECATED_FP_REGNUM.
+ (vax_push_dummy_frame, vax_pop_frame): Ditto.
+ * std-regs.c (value_of_builtin_frame_fp_reg): Ditto.
+ * sparc-tdep.c (sparc_init_extra_frame_info): Ditto.
+ (sparc_push_dummy_frame, sparc64_read_fp): Ditto.
+ (sparc32_register_virtual_type): Ditto.
+ * sh-tdep.c (sh64_frame_chain): Ditto.
+ (sh64_get_saved_register, sh64_pop_frame): Ditto.
+ (sh_nofp_frame_init_saved_regs): Ditto.
+ (sh64_nofp_frame_init_saved_regs): Ditto.
+ (sh_fp_frame_init_saved_regs): Ditto.
+ * remote-mips.c (mips_wait, mips_fetch_registers): Ditto.
+ * remote-e7000.c (fetch_regs_from_dump): Ditto.
+ * procfs.c (procfs_fetch_registers): Ditto.
+ (procfs_store_registers): Ditto.
+ * ns32knbsd-nat.c (fetch_inferior_registers): Ditto.
+ (store_inferior_registers, fetch_core_registers): Ditto.
+ (fetch_kcore_registers, clear_regs): Ditto.
+ * ns32k-tdep.c (ns32k_frame_init_saved_regs): Ditto.
+ (ns32k_push_dummy_frame, ns32k_pop_frame): Ditto.
+ * nlm/i386.h (DEPRECATED_FP_REGNUM): Ditto.
+ * nlm/i386.c (do_status): Ditto.
+ * mipsv4-nat.c (supply_gregset): Ditto.
+ * mips-tdep.c: Ditto for comments.
+ * mips-nat.c (fetch_inferior_registers): Ditto.
+ (store_inferior_registers, fetch_core_registers): Ditto.
+ * m68k-tdep.c (m68k_push_dummy_frame): Ditto.
+ (m68k_pop_frame, m68k_frame_init_saved_regs): Ditto.
+ * i386-tdep.c (i386_frame_init_saved_regs): Ditto.
+ (i386_do_pop_frame, i386_register_type): Ditto.
+ * hppa-tdep.c (hppa_frame_chain): Ditto.
+ (hppa_push_dummy_frame, find_dummy_frame_regs): Ditto.
+ (hppa_pop_frame, hppa_read_fp): Ditto.
+ (skip_prologue_hard_way, hppa_frame_find_saved_regs): Ditto.
+ * cris-tdep.c (cris_examine, cris_pop_frame): Ditto.
+ * config/vax/nm-vax.h (REGISTER_U_ADDR): Ditto.
+ * config/sparc/tm-sparc.h (DEPRECATED_FP_REGNUM): Ditto.
+ * config/sparc/tm-sp64.h (DEPRECATED_FP_REGNUM): Ditto.
+ * config/s390/tm-s390.h (DEPRECATED_FP_REGNUM): Ditto.
+ * config/pa/tm-hppa64.h (DEPRECATED_FP_REGNUM): Ditto.
+ * config/ia64/tm-ia64.h (DEPRECATED_FP_REGNUM): Ditto.
+ * blockframe.c: Ditto for comments.
+ * arch-utils.h: Ditto for comments.
+ * arch-utils.c (legacy_virtual_frame_pointer): Ditto.
+ * alphanbsd-tdep.c (fetch_core_registers): Ditto.
+ * alphabsd-nat.c (fetch_inferior_registers): Ditto.
+ * alpha-tdep.h: Ditto for comments.
+ * alpha-tdep.c (alpha_cannot_fetch_register): Ditto.
+ (alpha_cannot_store_register): Ditto.
+ (alpha_push_dummy_frame): Ditto.
+ * alpha-nat.c (supply_gregset): Ditto.
+
+ * config/sparc/tm-sp64.h (DEPRECATED_TARGET_READ_FP): Update.
+ * config/pa/tm-hppa64.h (DEPRECATED_TARGET_READ_FP): Update.
+ * config/sparc/tm-sparc.h: Update comment.
+
+ * hppa-tdep.c (hppa_init_extra_frame_info): Use
+ deprecated_read_fp instead of TARGET_READ_FP.
+ (hppa_init_extra_frame_info, hppa_frame_chain): Ditto.
+ (hppa_push_dummy_frame, hppa_read_fp): Ditto.
+ * sparc-tdep.c (sparc_init_extra_frame_info): Use
+ deprecated_read_fp instead of read_fp.
+ * s390-tdep.c (s390_push_arguments): Ditto.
+ * ia64-tdep.c (ia64_gdbarch_init): Ditto.
+ * frame.h: Ditto in comments.
+ * frame.c (legacy_get_prev_frame): Ditto.
+ * dummy-frame.c (dummy_frame_this_id): Ditto.
+ * arm-tdep.c (arm_init_extra_frame_info): Ditto.
+
+2003-04-28 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (deprecated_tm_print_insn): Rename tm_print_insn.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * xstormy16-tdep.c (_initialize_xstormy16_tdep): Update.
+ * vax-tdep.c (_initialize_vax_tdep): Update.
+ * v850-tdep.c (_initialize_v850_tdep): Update.
+ * sparc-tdep.c (_initialize_sparc_tdep): Update.
+ * s390-tdep.c (_initialize_s390_tdep): Update.
+ * ns32k-tdep.c (_initialize_ns32k_tdep): Update.
+ * mn10300-tdep.c (_initialize_mn10300_tdep): Update.
+ * mips-tdep.c (_initialize_mips_tdep): Update.
+ * mcore-tdep.c (_initialize_mcore_tdep): Update.
+ * m68k-tdep.c (_initialize_m68k_tdep): Update.
+ * ia64-tdep.c (_initialize_ia64_tdep): Update.
+ * hppa-tdep.c (_initialize_hppa_tdep): Update.
+ * h8300-tdep.c (_initialize_h8300_tdep): Update.
+ * frv-tdep.c (_initialize_frv_tdep): Update.
+ * cris-tdep.c (cris_delayed_get_disassembler): Update.
+ (_initialize_cris_tdep): Update.
+ * arch-utils.c (legacy_print_insn): Update.
+ * alpha-tdep.c (_initialize_alpha_tdep): Update.
+
+2003-04-26 Adam Fedor <fedor@gnu.org>
+
+ * linespec.c (decode_objc): New function to decode ObjC calls
+ (decode_line_1): Check for ObjC calls (using decode_objc)
+ * Makefile (linespec.o): Update dependencies.
+
+2003-04-26 Daniel Jacobowitz <drow@mvista.com>
+
+ * breakpoint.h (struct breakpoint_ops): New.
+ (struct breakpoint): Add ops member.
+
+ * breakpoint.c (print_bp_stop_message, print_one_breakpoint)
+ (mention): Use new breakpoint ops member.
+ (set_raw_breakpoint): Initialize ops field to NULL.
+ (print_exception_catchpoint, print_one_exception_catchpoint)
+ (print_mention_exception_catchpoint, handle_gnu_v3_exceptions): New.
+ (gnu_v3_exception_catchpoint_ops): New.
+ (catch_exception_command_1): Call handle_gnu_v3_exceptions.
+
+2003-04-25 Adam Fedor <fedor@gnu.org>
+
+ * Makefile.in (COMMON_OBS): Add objc-lang.o
+
+2003-04-25 Andrew Cagney <cagney@redhat.com>
+
+ * d10v-tdep.c (print_insn): Delete function.
+ (display_trace): Use TARGET_PRINT_INSN.
+ (_initialize_d10v_tdep): Do not set tm_print_insn.
+ (d10v_gdbarch_init): Set print_insn.
+
+2003-04-25 Andrew Cagney <cagney@redhat.com>
+
+ * d10v-tdep.c (d10v_extract_return_value): Delete call to printf.
+ (_initialize_d10v_tdep): Use add_setshow_boolean_cmd.
+ (d10v_frame_unwind_cache): Use FRAME_OBSTACK_CALLOC.
+ (NR_DMAP_REGS, A0_REGNUM): Delete, replaced by ...
+ (nr_dmap_regs, a0_regnum): ... new functions.
+ (d10v_print_registers_info): Use a0_regnum, use register_size.
+ (d10v_register_byte): Delete function.
+ (d10v_register_raw_size): Delete function.
+ (d10v_register_type): Use a0_regnum.
+ (d10v_print_registers_info): Use a0_regnum.
+ (D10V_SP_REGNUM): Rename _SP_REGNUM, replace it and SP_REGNUM.
+ (d10v_gdbarch_init): Do not set register_byte or
+ register_raw_size, use D10V_SP_REGNUM to set sp_regnum.
+ (d10v_pointer_to_address): Use extract_unsigned_integer instead of
+ extract_address.
+ (trace_command): Use XCALLOC.
+ (print_insn): Delete reference to tm_print_insn.
+ (saved_regs_unwinder): Use store_unsigned_integer instead of
+ store_address.
+ * frame.h (FRAME_OBSTACK_CALLOC): Define
+
+2003-04-25 David Carlton <carlton@bactrian.org>
+
+ * config/djgpp/fnchange.lst: Add testsuite/gdb.c++/maint.exp.
+
+2003-04-24 Adam Fedor <fedor@gnu.org>
+
+ * objc-lang.c: Include "valprint.h"
+ * Makefile.in (objc-lang.o): Update dependencies.
+
+2003-04-24 Adam Fedor <fedor@gnu.org>
+
+ * objc-lang.c (FETCH_ARGUMENT, CONVERT_FUNCPTR): Remove
+ architecture dependant compilation and mark as unimplemented
+ (until they get put in the gdbarch vector).
+
+2003-04-23 David Carlton <carlton@bactrian.org>
+
+ * cp-support.c (cp_find_first_component): Accept 'operator' in
+ more locations.
+
+2003-04-23 Andrew Cagney <cagney@redhat.com>
+
+ * infcall.c (call_function_by_hand): Eliminate redundant
+ indentation. Move "saved_async" and "old_cleanups" to where they
+ are needed.
+
+2003-04-23 Andrew Cagney <cagney@redhat.com>
+
+ * infcall.c (call_function_by_hand): Eliminate the variables "rc"
+ and "buffer". Move the "name" code to where it is needed.
+
+2003-04-23 Andrew Cagney <cagney@redhat.com>
+
+ * infcall.c (call_function_by_hand): Move variables "start_sp",
+ "dummy", "sizeof_dummy1" and "dummy1" and corresponding dummy call
+ code to ON_STACK switch branch.
+
+2003-04-23 Andrew Cagney <cagney@redhat.com>
+
+ * infcall.c (call_function_by_hand): Make declaration of "i",
+ "sal", "bpt" and "old_sp" more local to their use. Delete #if
+ lint.
+
+2003-04-23 Andrew Cagney <cagney@redhat.com>
+
+ * infcall.c (call_function_by_hand): Delete variable
+ "n_method_args". Localize "param_type"'s declaration to the loop
+ that it is used. Reinstate code assigning to said variable -
+ deleted on 2002-06-14. Rationalize calls to value_args_coerce.
+ Rationalize code using "param_type".
+
+2003-04-22 Andrew Cagney <cagney@redhat.com>
+
+ * infcall.c (call_function_by_hand): Use new variable "bp_addr" to
+ compute the breakpoint address. Only call FIX_CALL_DUMMY when
+ ON_STACK. Eliminate the variable "addr". Do not pass "real_pc"
+ to DEPRECATED_PUSH_RETURN_ADDRESS.
+
+2003-04-22 Kevin Buettner <kevinb@redhat.com>
+
+ * dwarf2loc.c (dwarf2_evaluate_loc_desc): Invoke DWARF2_REG_TO_REGNUM
+ on the DWARF2 register number prior to fetching a register.
+
+2003-04-22 J. Brobecker <brobecker@gnat.com>
+
+ * config/pa/tm-hppa.h (SOFT_FLOAT): Delete this macro.
+ Update all the tests using SOFT_FLOAT considering the fact that
+ this macro was always set to 0.
+ * config/pa/tm-hppa64.h: Update all the tests using SOFT_FLOAT
+ considering the fact that this macro was always set to 0.
+ * hppa-tdep.h (hppa_store_return_value): Likewise.
+ (hppa_extract_return_value): Likewise.
+
+2003-04-22 J. Brobecker <brobecker@gnat.com>
+
+ * config/pa/tm-hppa.h: Remove obsolete code, was used by
+ the hppa-pro target only.
+
+2003-04-21 J. Brobecker <brobecker@gnat.com>
+
+ Ongoing multi-arch conversion effort for HP/UX:
+ * config/pa/tm-hppa.h: Move all macro that are no longer
+ defined now that GDB_MULTI_ARCH is now set to 1 from here...
+ * config/pa/tm-hppa64.h: ... to here (hppa64 is not multiarch'ed yet).
+
+2003-04-21 J. Brobecker <brobecker@gnat.com>
+
+ * config/pa/tm-hppa.h: Obsolete a section that was only used
+ for hppa-pro.
+
+2003-04-21 J. Brobecker <brobecker@gnat.com>
+
+ Ongoing multi-arch conversion for HP/UX.
+ * config/pa/tm-hppa.h (GDB_MULTI_ARCH): Set to 1. Do not define
+ if already defined (allows hppa64 to stay non-multiarched for now).
+ * config/pa/tm-hppa64.h (GDB_MULTI_ARCH): Define.
+
+2003-04-21 Andrew Cagney <cagney@redhat.com>
+
+ * frame.c (frame_id_eq): Fail when the code_addr's do not match.
+
+2003-04-21 Andrew Cagney <cagney@redhat.com>
+
+ * i386-tdep.c (i386_gdbarch_init): Replace "mmx_num_regs" with
+ "i386_num_mmx_regs".
+
+2003-04-21 Andrew Cagney <cagney@redhat.com>
+
+ * infcall.c: New file.
+ * infcall.h: New file.
+ * valarith.c: Include "infcall.h".
+ * scm-lang.c, objc-lang.cm, hppa-tdep.c, gcore.c: Ditto.
+ * eval.c, ada-valprint.c, ada-lang.c: Ditto.
+ * Makefile.in (valarith.o, scm-lang.o): Update dependencies.
+ (objc-lang.o, hppa-tdep.o, gcore.o): Update dependencies.
+ (eval.o, ada-valprint.o, ada-lang.o): Update dependencies.
+ (SFILES): Add "infcall.c"
+ (COMMON_OBS): Add "infcall.o".
+ (infcall.o): Specify dependencies.
+ * value.h (call_function_by_hand): Delete declaration.
+ * inferior.h (run_stack_dummy): Delete declaration.
+ * infcmd.c (breakpoint_auto_delete_contents): Move to "infcall.c".
+ (run_stack_dummy): Move to "infcall.c", merged into
+ call_function_by_hand.
+ * valops.c (call_function_by_hand): Moved to "infcall.c".
+ (find_function_addr, value_arg_coerce): Ditto.
+ (unwindonsignal_p, coerce_float_to_double): Ditto.
+ (_initialize_valops): Move "set/show coerce-float-to-double", and
+ "set/show unwindonsignal" commands to "infcall.c".
+ * v850-tdep.c, target.h: Update comments.
+ * sparc-tdep.c (sparc_fix_call_dummy): Update comments.
+ * sh-tdep.c (sh_init_extra_frame_info): Update comments.
+ (sh64_init_extra_frame_info): Update comments.
+ * mn10300-tdep.c: Update comments.
+ * mcore-tdep.c (mcore_init_extra_frame_info): Update comments.
+ * config/sparc/tm-sparc.h: Update comments.
+ * breakpoint.h: Update comments.
+ * avr-tdep.c (avr_init_extra_frame_info): Update comments.
+ * arm-tdep.c: Update comment.
+
2003-04-19 Mark Kettenis <kettenis@gnu.org>
* i386-tdep.c (i386_num_register_names): New variable.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index a78ef16099a..43d544dab14 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -168,14 +168,14 @@ SUBDIR_CLI_UNINSTALL=
SUBDIR_MI_OBS = \
mi-out.o mi-console.o \
mi-cmds.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \
- mi-cmd-file.o mi-cmd-disas.o \
+ mi-cmd-file.o mi-cmd-disas.o mi-cmd-symbol.o \
mi-interp.o \
mi-main.o mi-parse.o mi-getopt.o
SUBDIR_MI_SRCS = \
mi/mi-out.c mi/mi-console.c \
mi/mi-cmds.c mi/mi-cmd-env.c \
mi/mi-cmd-var.c mi/mi-cmd-break.c mi/mi-cmd-stack.c \
- mi/mi-cmd-file.c mi/mi-cmd-disas.c \
+ mi/mi-cmd-file.c mi/mi-cmd-disas.c mi/mi-cmd-symbol.c \
mi/mi-interp.c \
mi/mi-main.c mi/mi-parse.c mi/mi-getopt.c
SUBDIR_MI_DEPS =
@@ -521,7 +521,9 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
frame-unwind.c \
gdbarch.c arch-utils.c gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \
hpacc-abi.c \
- inf-loop.c infcmd.c inflow.c infrun.c \
+ inf-loop.c \
+ infcall.c \
+ infcmd.c inflow.c infrun.c \
interps.c \
jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \
kod.c kod-cisco.c \
@@ -669,6 +671,7 @@ i386_linux_tdep_h = i386-linux-tdep.h
i386_tdep_h = i386-tdep.h
i387_tdep_h = i387-tdep.h
inf_loop_h = inf-loop.h
+infcall_h = infcall.h
inferior_h = inferior.h $(breakpoint_h) $(target_h) $(frame_h)
inflow_h = inflow.h $(terminal_h)
interps_h = interps.h
@@ -834,7 +837,9 @@ TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR)
COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \
charset.o disasm.o dummy-frame.o \
source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \
- block.o symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o \
+ block.o symtab.o symfile.o symmisc.o linespec.o \
+ infcall.o \
+ infcmd.o infrun.o \
expprint.o environ.o stack.o thread.o \
interps.o \
macrotab.o macrocmd.o macroexp.o macroscope.o \
@@ -849,7 +854,7 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \
dbxread.o coffread.o coff-pe-read.o elfread.o \
dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \
dwarf2expr.o dwarf2loc.o \
- c-lang.o f-lang.o \
+ c-lang.o f-lang.o objc-lang.o \
ui-out.o cli-out.o \
varobj.o wrapper.o \
jv-lang.o jv-valprint.o jv-typeprint.o \
@@ -1488,7 +1493,8 @@ abug-rom.o: abug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
ada-lang.o: ada-lang.c $(gdb_string_h) $(demangle_h) $(defs_h) $(symtab_h) \
$(gdbtypes_h) $(gdbcmd_h) $(expression_h) $(parser_defs_h) \
$(language_h) $(c_lang_h) $(inferior_h) $(symfile_h) $(objfiles_h) \
- $(breakpoint_h) $(gdbcore_h) $(ada_lang_h) $(ui_out_h) $(block_h)
+ $(breakpoint_h) $(gdbcore_h) $(ada_lang_h) $(ui_out_h) $(block_h) \
+ $(infcall_h)
ada-tasks.o: ada-tasks.c $(defs_h) $(command_h) $(value_h) $(language_h) \
$(inferior_h) $(symtab_h) $(target_h) $(gdbcore_h) $(gregset_h) \
$(ada_lang_h)
@@ -1498,7 +1504,7 @@ ada-typeprint.o: ada-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) \
$(c_lang_h) $(typeprint_h) $(ada_lang_h) $(gdb_string_h)
ada-valprint.o: ada-valprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \
$(expression_h) $(value_h) $(demangle_h) $(valprint_h) $(language_h) \
- $(annotate_h) $(ada_lang_h) $(c_lang_h)
+ $(annotate_h) $(ada_lang_h) $(c_lang_h) $(infcall_h)
aix-thread.o: aix-thread.c $(defs_h) $(gdb_assert_h) $(gdbthread_h) \
$(target_h) $(inferior_h) $(regcache_h) $(gdbcmd_h) $(language_h) \
$(ppc_tdep_h)
@@ -1634,7 +1640,7 @@ d10v-tdep.o: d10v-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \
$(gdb_string_h) $(value_h) $(inferior_h) $(dis_asm_h) $(symfile_h) \
$(objfiles_h) $(language_h) $(arch_utils_h) $(regcache_h) \
$(remote_h) $(floatformat_h) $(gdb_sim_d10v_h) $(sim_regno_h) \
- $(gdb_assert_h)
+ $(gdb_assert_h) $(disasm_h)
dbug-rom.o: dbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
$(serial_h) $(regcache_h) $(m68k_tdep_h)
dbxread.o: dbxread.c $(defs_h) $(gdb_string_h) $(gdb_obstack_h) \
@@ -1650,13 +1656,14 @@ demangle.o: demangle.c $(defs_h) $(command_h) $(gdbcmd_h) $(demangle_h) \
dink32-rom.o: dink32-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
$(serial_h) $(symfile_h) $(inferior_h) $(regcache_h)
disasm.o: disasm.c $(defs_h) $(gdb_string_h) $(target_h) $(value_h) \
- $(disasm_h) $(ui_out_h)
+ $(disasm_h) $(ui_out_h) $(gdbcore_h)
doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) \
$(gdb_assert_h) $(gdb_string_h) $(gdbtypes_h)
dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h)
dsrec.o: dsrec.c $(defs_h) $(serial_h) $(srec_h)
dummy-frame.o: dummy-frame.c $(defs_h) $(dummy_frame_h) $(regcache_h) \
- $(frame_h) $(inferior_h) $(gdb_assert_h) $(frame_unwind_h)
+ $(frame_h) $(inferior_h) $(gdb_assert_h) $(frame_unwind_h) \
+ $(command_h) $(gdbcmd_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) \
@@ -1681,7 +1688,7 @@ elfread.o: elfread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(elf_bfd_h) \
environ.o: environ.c $(defs_h) $(environ_h) $(gdb_string_h)
eval.o: eval.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
$(value_h) $(expression_h) $(target_h) $(frame_h) $(language_h) \
- $(f_lang_h) $(cp_abi_h)
+ $(f_lang_h) $(cp_abi_h) $(infcall_h) $(objc-lang.h) $(block_h)
event-loop.o: event-loop.c $(defs_h) $(event_loop_h) $(event_top_h) \
$(gdb_string_h)
event-top.o: event-top.c $(defs_h) $(top_h) $(inferior_h) $(target_h) \
@@ -1723,7 +1730,7 @@ frame-unwind.o: frame-unwind.c $(defs_h) $(frame_h) $(frame_unwind_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) \
- $(elf_bfd_h) $(symfile_h) $(objfiles_h)
+ $(elf_bfd_h) $(symfile_h) $(objfiles_h) $(infcall_h)
gdb.o: gdb.c $(defs_h) $(main_h) $(gdb_string_h) $(interps_h)
gdb-events.o: gdb-events.c $(defs_h) $(gdb_events_h) $(gdbcmd_h)
gdbarch.o: gdbarch.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) $(inferior_h) \
@@ -1758,9 +1765,9 @@ hpacc-abi.o: hpacc-abi.c $(defs_h) $(value_h) $(gdb_regex_h) $(gdb_string_h) \
$(gdbtypes_h) $(gdbcore_h) $(cp_abi_h)
hppa-tdep.o: hppa-tdep.c $(defs_h) $(frame_h) $(bfd_h) $(inferior_h) \
$(value_h) $(regcache_h) $(completer_h) $(language_h) $(osabi_h) \
- $(gdb_assert_h) $(infttrace_h) $(symtab_h) $(a_out_encap_h) \
- $(gdb_stat_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) \
- $(symfile_h) $(objfiles_h)
+ $(gdb_assert_h) $(infttrace_h) $(symtab_h) $(infcall_h) \
+ $(a_out_encap_h) $(gdb_stat_h) $(gdb_wait_h) $(gdbcore_h) \
+ $(gdbcmd_h) $(target_h) $(symfile_h) $(objfiles_h)
hppa-hpux-tdep.o: hppa-hpux-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \
$(osabi_h) $(gdb_string_h)
hppab-nat.o: hppab-nat.c $(defs_h) $(inferior_h) $(target_h) $(regcache_h)
@@ -1830,6 +1837,9 @@ ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \
$(value_h) $(objfiles_h) $(elf_common_h) $(elf_bfd_h)
inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(target_h) $(event_loop_h) \
$(event_top_h) $(inf_loop_h) $(remote_h)
+infcall.o: infcall.c $(defs_h) $(breakpoint_h) $(target_h) $(regcache_h) \
+ $(inferior_h) $(gdb_assert_h) $(block_h) $(gdbcore_h) $(language_h) \
+ $(symfile_h) $(gdbcmd_h) $(command_h) $(gdb_string_h)
infcmd.o: infcmd.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
$(frame_h) $(inferior_h) $(environ_h) $(value_h) $(gdbcmd_h) \
$(symfile_h) $(gdbcore_h) $(target_h) $(language_h) $(symfile_h) \
@@ -1877,7 +1887,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) $(parser_defs_h) $(block_h)
+ $(cp_abi_h) $(source_h) $(parser_defs_h) $(block_h) $(objc_lang_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)
@@ -1936,7 +1946,7 @@ mcore-rom.o: mcore-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
$(gdb_string_h) $(regcache_h) $(serial_h)
mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \
$(gdbcmd_h) $(regcache_h) $(symfile_h) $(gdbcore_h) $(inferior_h) \
- $(arch_utils_h) $(gdb_string_h)
+ $(arch_utils_h) $(gdb_string_h) $(disasm_h)
mdebugread.o: mdebugread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \
$(symfile_h) $(objfiles_h) $(gdb_obstack_h) $(buildsym_h) \
$(stabsread_h) $(complaints_h) $(demangle_h) $(gdb_assert_h) \
@@ -1995,9 +2005,9 @@ ns32knbsd-tdep.o: ns32knbsd-tdep.c $(defs_h) $(ns32k_tdep_h) $(gdb_string_h) \
$(osabi_h)
objc-lang.o: objc-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
$(parser_defs_h) $(language_h) $(c_lang_h) $(objc_lang_h) \
- $(complaints_h) $(value_h) $(symfile_h) $(objfiles_h) \
- $(gdb_string_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(frame_h) \
- $(gdb_regex_h) $(regcache_h) $(block_h)
+ $(complaints_h) $(value_h) $(symfile_h) $(objfiles_h) $(gdb_string_h) \
+ $(target_h) $(gdbcore_h) $(gdbcmd_h) $(frame_h) $(gdb_regex_h) \
+ $(regcache_h) $(block_h) $(infcall_h) $(valprint_h)
objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \
$(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_stat_h) \
$(gdb_obstack_h) $(gdb_string_h) $(breakpoint_h) $(mmalloc_h) \
@@ -2052,7 +2062,7 @@ printcmd.o: printcmd.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \
$(gdbtypes_h) $(value_h) $(language_h) $(expression_h) $(gdbcore_h) \
$(gdbcmd_h) $(target_h) $(breakpoint_h) $(demangle_h) $(valprint_h) \
$(annotate_h) $(symfile_h) $(objfiles_h) $(completer_h) $(ui_out_h) \
- $(gdb_assert_h) $(block_h)
+ $(gdb_assert_h) $(block_h) $(disasm_h)
proc-api.o: proc-api.c $(defs_h) $(gdbcmd_h) $(completer_h) $(gdb_wait_h) \
$(proc_utils_h)
proc-events.o: proc-events.c $(defs_h)
@@ -2150,7 +2160,7 @@ scm-exp.o: scm-exp.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
$(scm_tags_h)
scm-lang.o: scm-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
$(parser_defs_h) $(language_h) $(value_h) $(c_lang_h) $(scm_lang_h) \
- $(scm_tags_h) $(gdb_string_h) $(gdbcore_h) $(source_h)
+ $(scm_tags_h) $(source_h) $(gdb_string_h) $(gdbcore_h) $(infcall_h)
scm-valprint.o: scm-valprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \
$(expression_h) $(parser_defs_h) $(language_h) $(value_h) \
$(scm_lang_h) $(valprint_h) $(gdbcore_h)
@@ -2266,7 +2276,7 @@ symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \
$(gdbcmd_h) $(call_cmds_h) $(gdb_regex_h) $(expression_h) \
$(language_h) $(demangle_h) $(inferior_h) $(linespec_h) \
$(filenames_h) $(gdb_obstack_h) $(gdb_string_h) $(gdb_stat_h) \
- $(cp_abi_h) $(source_h) $(block_h)
+ $(cp_abi_h) $(source_h) $(block_h) $(objc_lang_h)
target.o: target.c $(defs_h) $(gdb_string_h) $(target_h) $(gdbcmd_h) \
$(symtab_h) $(inferior_h) $(bfd_h) $(symfile_h) $(objfiles_h) \
$(gdb_wait_h) $(dcache_h) $(regcache_h)
@@ -2308,7 +2318,7 @@ v850ice.o: v850ice.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \
$(gdbcore_h) $(value_h) $(command_h) $(regcache_h)
valarith.o: valarith.c $(defs_h) $(value_h) $(symtab_h) $(gdbtypes_h) \
$(expression_h) $(target_h) $(language_h) $(gdb_string_h) \
- $(doublest_h)
+ $(doublest_h) $(infcall_h)
valops.o: valops.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(value_h) $(frame_h) \
$(inferior_h) $(gdbcore_h) $(target_h) $(demangle_h) $(language_h) \
$(gdbcmd_h) $(regcache_h) $(cp_abi_h) $(gdb_string_h) \
@@ -2566,6 +2576,9 @@ mi-cmd-env.o: $(srcdir)/mi/mi-cmd-env.c $(defs_h) $(inferior_h) $(value_h) \
mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(target_h) $(frame_h) \
$(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h) $(block_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c
+mi-cmd-symbol.o: $(srcdir)/mi/mi-cmd-symbol.c $(defs_h) \
+ $(mi_cmds_h) $(ui_out_h) $(symtab_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-symbol.c
mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \
$(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-var.c
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index bc0809d3e2a..b047442d6f3 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -39,6 +39,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "ada-lang.h"
#include "ui-out.h"
#include "block.h"
+#include "infcall.h"
struct cleanup *unresolved_names;
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index 8633f2c7893..5b90c0683cd 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -30,6 +30,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "annotate.h"
#include "ada-lang.h"
#include "c-lang.h"
+#include "infcall.h"
/* Encapsulates arguments to ada_val_print. */
struct ada_val_print_args
diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c
index 548869b2fa8..af0a336cf6a 100644
--- a/gdb/alpha-nat.c
+++ b/gdb/alpha-nat.c
@@ -212,7 +212,7 @@ supply_gregset (gdb_gregset_t *gregsetp)
/* Fill inaccessible registers with zero. */
supply_register (ALPHA_ZERO_REGNUM, zerobuf);
- supply_register (FP_REGNUM, zerobuf);
+ supply_register (DEPRECATED_FP_REGNUM, zerobuf);
}
void
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index d61f359c1f5..c1648b48b48 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -66,8 +66,6 @@ static gdbarch_frame_locals_address_ftype alpha_frame_locals_address;
static gdbarch_skip_prologue_ftype alpha_skip_prologue;
-static gdbarch_fix_call_dummy_ftype alpha_fix_call_dummy;
-
static gdbarch_get_longjmp_target_ftype alpha_get_longjmp_target;
struct frame_extra_info
@@ -293,13 +291,13 @@ alpha_register_name (int regno)
static int
alpha_cannot_fetch_register (int regno)
{
- return (regno == FP_REGNUM || regno == ALPHA_ZERO_REGNUM);
+ return (regno == DEPRECATED_FP_REGNUM || regno == ALPHA_ZERO_REGNUM);
}
static int
alpha_cannot_store_register (int regno)
{
- return (regno == FP_REGNUM || regno == ALPHA_ZERO_REGNUM);
+ return (regno == DEPRECATED_FP_REGNUM || regno == ALPHA_ZERO_REGNUM);
}
static int
@@ -1269,7 +1267,7 @@ alpha_push_dummy_frame (void)
be read as zero and will help us to catch any errors in the dummy frame
retrieval code. */
PROC_DUMMY_FRAME (proc_desc) = sp;
- PROC_FRAME_REG (proc_desc) = FP_REGNUM;
+ PROC_FRAME_REG (proc_desc) = DEPRECATED_FP_REGNUM;
PROC_FRAME_OFFSET (proc_desc) = 0;
sp += PROC_REG_OFFSET (proc_desc);
write_register (SP_REGNUM, sp);
@@ -1806,12 +1804,12 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Register info */
set_gdbarch_num_regs (gdbarch, ALPHA_NUM_REGS);
set_gdbarch_sp_regnum (gdbarch, ALPHA_SP_REGNUM);
- set_gdbarch_fp_regnum (gdbarch, ALPHA_FP_REGNUM);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, ALPHA_FP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, ALPHA_PC_REGNUM);
set_gdbarch_fp0_regnum (gdbarch, ALPHA_FP0_REGNUM);
set_gdbarch_register_name (gdbarch, alpha_register_name);
- set_gdbarch_register_size (gdbarch, ALPHA_REGISTER_SIZE);
+ set_gdbarch_deprecated_register_size (gdbarch, ALPHA_REGISTER_SIZE);
set_gdbarch_register_bytes (gdbarch, ALPHA_REGISTER_BYTES);
set_gdbarch_register_byte (gdbarch, alpha_register_byte);
set_gdbarch_register_raw_size (gdbarch, alpha_register_raw_size);
@@ -1859,8 +1857,8 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
stopping the user call is achieved via a bp_call_dummy breakpoint.
But we need a fake CALL_DUMMY definition to enable the proper
call_function_by_hand and to avoid zero length array warnings. */
- set_gdbarch_call_dummy_words (gdbarch, alpha_call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, alpha_call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_frame_args_address (gdbarch, alpha_frame_args_address);
set_gdbarch_frame_locals_address (gdbarch, alpha_frame_locals_address);
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, alpha_init_extra_frame_info);
@@ -1873,7 +1871,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_push_dummy_frame (gdbarch, alpha_push_dummy_frame);
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
- set_gdbarch_fix_call_dummy (gdbarch, alpha_fix_call_dummy);
+ set_gdbarch_deprecated_fix_call_dummy (gdbarch, alpha_fix_call_dummy);
set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop);
set_gdbarch_deprecated_init_frame_pc_first (gdbarch, alpha_init_frame_pc_first);
@@ -1925,7 +1923,7 @@ _initialize_alpha_tdep (void)
gdbarch_register (bfd_arch_alpha, alpha_gdbarch_init, alpha_dump_tdep);
- tm_print_insn = print_insn_alpha;
+ deprecated_tm_print_insn = print_insn_alpha;
/* Let the user set the fence post for heuristic_proc_start. */
diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h
index 76f91f32bf4..0e8aefbfe16 100644
--- a/gdb/alpha-tdep.h
+++ b/gdb/alpha-tdep.h
@@ -40,12 +40,12 @@
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
#define ALPHA_MAX_REGISTER_VIRTUAL_SIZE 8
-/* Register numbers of various important registers.
- Note that most of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and FP_REGNUM is a "phony" register number which is too large
- to be an actual register number as far as the user is concerned
- but serves to get the desired value when passed to read_register. */
+/* Register numbers of various important registers. Note that most of
+ these values are "real" register numbers, and correspond to the
+ general registers of the machine, and DEPRECATED_FP_REGNUM is a
+ "phony" register number which is too large to be an actual register
+ number as far as the user is concerned but serves to get the
+ desired value when passed to read_register. */
#define ALPHA_V0_REGNUM 0 /* Function integer return value */
#define ALPHA_T7_REGNUM 8 /* Return address register for OSF/1 __add* */
diff --git a/gdb/alphabsd-nat.c b/gdb/alphabsd-nat.c
index b26d3ea7c48..a20b36f575e 100644
--- a/gdb/alphabsd-nat.c
+++ b/gdb/alphabsd-nat.c
@@ -113,7 +113,7 @@ fetch_inferior_registers (int regno)
}
/* Reset virtual frame pointer. */
- supply_register (FP_REGNUM, NULL);
+ supply_register (DEPRECATED_FP_REGNUM, NULL);
}
/* Store register REGNO back into the inferior. If REGNO is -1, do
diff --git a/gdb/alphafbsd-tdep.c b/gdb/alphafbsd-tdep.c
index 6b1b068d9cf..3d8eafb2927 100644
--- a/gdb/alphafbsd-tdep.c
+++ b/gdb/alphafbsd-tdep.c
@@ -32,7 +32,7 @@ alphafbsd_use_struct_convention (int gcc_p, struct type *type)
/* All aggregate types that won't fit in a register must be returned
in memory. */
- if (TYPE_LENGTH (type) > REGISTER_SIZE)
+ if (TYPE_LENGTH (type) > DEPRECATED_REGISTER_SIZE)
return 1;
/* The only aggregate types that can be returned in a register are
diff --git a/gdb/alphanbsd-tdep.c b/gdb/alphanbsd-tdep.c
index 6137c5e98de..a4a77c1c00c 100644
--- a/gdb/alphanbsd-tdep.c
+++ b/gdb/alphanbsd-tdep.c
@@ -70,7 +70,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
for (regno = 0; regno < ALPHA_ZERO_REGNUM; regno++)
supply_register (regno, regs + (regmap[regno] * 8));
supply_register (ALPHA_ZERO_REGNUM, NULL);
- supply_register (FP_REGNUM, NULL);
+ supply_register (DEPRECATED_FP_REGNUM, NULL);
supply_register (PC_REGNUM, regs + (28 * 8));
/* Floating point registers. */
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 825bd5cb76f..2f555ff6fa8 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -191,7 +191,9 @@ LONGEST legacy_call_dummy_words[1];
int legacy_sizeof_call_dummy_words = sizeof (legacy_call_dummy_words);
void
-generic_remote_translate_xfer_address (CORE_ADDR gdb_addr, int gdb_len,
+generic_remote_translate_xfer_address (struct gdbarch *gdbarch,
+ struct regcache *regcache,
+ CORE_ADDR gdb_addr, int gdb_len,
CORE_ADDR * rem_addr, int *rem_len)
{
*rem_addr = gdb_addr;
@@ -209,7 +211,7 @@ generic_prologue_frameless_p (CORE_ADDR ip)
int
legacy_print_insn (bfd_vma vma, disassemble_info *info)
{
- return (*tm_print_insn) (vma, info);
+ return (*deprecated_tm_print_insn) (vma, info);
}
/* Helper functions for INNER_THAN */
@@ -410,7 +412,8 @@ cannot_register_not (int regnum)
}
/* Legacy version of target_virtual_frame_pointer(). Assumes that
- there is an FP_REGNUM and that it is the same, cooked or raw. */
+ there is an DEPRECATED_FP_REGNUM and that it is the same, cooked or
+ raw. */
void
legacy_virtual_frame_pointer (CORE_ADDR pc,
@@ -422,8 +425,8 @@ legacy_virtual_frame_pointer (CORE_ADDR pc,
register and an offset can determine this. I think it should
instead generate a byte code expression as that would work better
with things like Dwarf2's CFI. */
- if (FP_REGNUM >= 0 && FP_REGNUM < NUM_REGS)
- *frame_regnum = FP_REGNUM;
+ if (DEPRECATED_FP_REGNUM >= 0 && DEPRECATED_FP_REGNUM < NUM_REGS)
+ *frame_regnum = DEPRECATED_FP_REGNUM;
else if (SP_REGNUM >= 0 && SP_REGNUM < NUM_REGS)
*frame_regnum = SP_REGNUM;
else
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index f3874a0c250..cf515a4f76d 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -141,7 +141,8 @@ void default_coff_make_msymbol_special (int val, struct minimal_symbol *msym);
int cannot_register_not (int regnum);
/* Legacy version of target_virtual_frame_pointer(). Assumes that
- there is an FP_REGNUM and that it is the same, cooked or raw. */
+ there is an DEPRECATED_FP_REGNUM and that it is the same, cooked or
+ raw. */
extern gdbarch_virtual_frame_pointer_ftype legacy_virtual_frame_pointer;
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 91fa88fe0ad..60c8ae492a9 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -46,7 +46,7 @@
static const char arm_linux_arm_le_breakpoint[] = {0x01,0x00,0x9f,0xef};
-/* CALL_DUMMY_WORDS:
+/* DEPRECATED_CALL_DUMMY_WORDS:
This sequence of words is the instructions
mov lr, pc
@@ -115,10 +115,10 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* Walk through the list of args and determine how large a temporary
stack is required. Need to take care here as structs may be
passed on the stack, and we have to to push them. */
- nstack_size = -4 * REGISTER_SIZE; /* Some arguments go into A1-A4. */
+ nstack_size = -4 * DEPRECATED_REGISTER_SIZE; /* Some arguments go into A1-A4. */
if (struct_return) /* The struct address goes in A1. */
- nstack_size += REGISTER_SIZE;
+ nstack_size += DEPRECATED_REGISTER_SIZE;
/* Walk through the arguments and add their size to nstack_size. */
for (argnum = 0; argnum < nargs; argnum++)
@@ -131,7 +131,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* ANSI C code passes float arguments as integers, K&R code
passes float arguments as doubles. Correct for this here. */
- if (TYPE_CODE_FLT == TYPE_CODE (arg_type) && REGISTER_SIZE == len)
+ if (TYPE_CODE_FLT == TYPE_CODE (arg_type) && DEPRECATED_REGISTER_SIZE == len)
nstack_size += FP_REGISTER_VIRTUAL_SIZE;
else
nstack_size += len;
@@ -178,7 +178,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
.stabs records the type as FP_FLOAT. In this latter case
the compiler converts the float arguments to double before
calling the function. */
- if (TYPE_CODE_FLT == typecode && REGISTER_SIZE == len)
+ if (TYPE_CODE_FLT == typecode && DEPRECATED_REGISTER_SIZE == len)
{
DOUBLEST dblval;
dblval = deprecated_extract_floating (val, len);
@@ -203,7 +203,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
registers and stack. */
while (len > 0)
{
- int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE;
+ int partial_len = len < DEPRECATED_REGISTER_SIZE ? len : DEPRECATED_REGISTER_SIZE;
if (argreg <= ARM_LAST_ARG_REGNUM)
{
@@ -214,8 +214,8 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
else
{
/* Push the arguments onto the stack. */
- write_memory ((CORE_ADDR) fp, val, REGISTER_SIZE);
- fp += REGISTER_SIZE;
+ write_memory ((CORE_ADDR) fp, val, DEPRECATED_REGISTER_SIZE);
+ fp += DEPRECATED_REGISTER_SIZE;
}
len -= partial_len;
@@ -530,9 +530,8 @@ arm_linux_init_abi (struct gdbarch_info info,
tdep->jb_pc = ARM_LINUX_JB_PC;
tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE;
- set_gdbarch_call_dummy_words (gdbarch, arm_linux_call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch,
- sizeof (arm_linux_call_dummy_words));
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_linux_call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (arm_linux_call_dummy_words));
/* The following two overrides shouldn't be needed. */
set_gdbarch_deprecated_extract_return_value (gdbarch, arm_linux_extract_return_value);
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 0a029e84702..d2e3ef598a0 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1118,7 +1118,7 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
else if (fromleaf)
/* If we were called by a frameless fn. then our frame is
still in the frame pointer register on the board... */
- deprecated_update_frame_base_hack (fi, read_fp ());
+ deprecated_update_frame_base_hack (fi, deprecated_read_fp ());
}
/* Calculate actual addresses of saved registers using offsets
@@ -1237,7 +1237,7 @@ arm_push_dummy_frame (void)
write_register (ARM_SP_REGNUM, sp);
}
-/* CALL_DUMMY_WORDS:
+/* DEPRECATED_CALL_DUMMY_WORDS:
This sequence of words is the instructions
mov lr,pc
@@ -1257,17 +1257,17 @@ static LONGEST arm_call_dummy_words[] =
FIXME rearnsha 2002-02018: Tweeking current_gdbarch is not an
optimal solution, but the call to arm_fix_call_dummy is immediately
- followed by a call to run_stack_dummy, which is the only function
- where call_dummy_breakpoint_offset is actually used. */
+ followed by a call to call_function_by_hand, which is the only
+ function where call_dummy_breakpoint_offset is actually used. */
static void
arm_set_call_dummy_breakpoint_offset (void)
{
if (caller_is_thumb)
- set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 4);
+ set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 4);
else
- set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 8);
+ set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 8);
}
/* Fix up the call dummy, based on whether the processor is currently
@@ -1430,7 +1430,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
/* Some platforms require a double-word aligned stack. Make sure sp
is correctly aligned before we start. We always do this even if
it isn't really needed -- it can never hurt things. */
- sp &= ~(CORE_ADDR)(2 * REGISTER_SIZE - 1);
+ sp &= ~(CORE_ADDR)(2 * DEPRECATED_REGISTER_SIZE - 1);
/* The struct_return pointer occupies the first parameter
passing register. */
@@ -1477,7 +1477,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
registers and stack. */
while (len > 0)
{
- int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE;
+ int partial_len = len < DEPRECATED_REGISTER_SIZE ? len : DEPRECATED_REGISTER_SIZE;
if (argreg <= ARM_LAST_ARG_REGNUM)
{
@@ -1487,7 +1487,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
if (arm_debug)
fprintf_unfiltered (gdb_stdlog, "arg %d in %s = 0x%s\n",
argnum, REGISTER_NAME (argreg),
- phex (regval, REGISTER_SIZE));
+ phex (regval, DEPRECATED_REGISTER_SIZE));
regcache_cooked_write_unsigned (regcache, argreg, regval);
argreg++;
}
@@ -1497,8 +1497,8 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
if (arm_debug)
fprintf_unfiltered (gdb_stdlog, "arg %d @ sp + %d\n",
argnum, nstack);
- si = push_stack_item (si, val, REGISTER_SIZE);
- nstack += REGISTER_SIZE;
+ si = push_stack_item (si, val, DEPRECATED_REGISTER_SIZE);
+ nstack += DEPRECATED_REGISTER_SIZE;
}
len -= partial_len;
@@ -1799,7 +1799,7 @@ thumb_get_next_pc (CORE_ADDR pc)
/* Fetch the saved PC from the stack. It's stored above
all of the other registers. */
- offset = bitcount (bits (inst1, 0, 7)) * REGISTER_SIZE;
+ offset = bitcount (bits (inst1, 0, 7)) * DEPRECATED_REGISTER_SIZE;
sp = read_register (ARM_SP_REGNUM);
nextpc = (CORE_ADDR) read_memory_integer (sp + offset, 4);
nextpc = ADDR_BITS_REMOVE (nextpc);
@@ -2309,10 +2309,10 @@ arm_use_struct_convention (int gcc_p, struct type *type)
/* In the ARM ABI, "integer" like aggregate types are returned in
registers. For an aggregate type to be integer like, its size
- must be less than or equal to REGISTER_SIZE and the offset of
- each addressable subfield must be zero. Note that bit fields are
- not addressable, and all addressable subfields of unions always
- start at offset zero.
+ must be less than or equal to DEPRECATED_REGISTER_SIZE and the
+ offset of each addressable subfield must be zero. Note that bit
+ fields are not addressable, and all addressable subfields of
+ unions always start at offset zero.
This function is based on the behaviour of GCC 2.95.1.
See: gcc/arm.c: arm_return_in_memory() for details.
@@ -2326,7 +2326,7 @@ arm_use_struct_convention (int gcc_p, struct type *type)
/* All aggregate types that won't fit in a register must be returned
in memory. */
- if (TYPE_LENGTH (type) > REGISTER_SIZE)
+ if (TYPE_LENGTH (type) > DEPRECATED_REGISTER_SIZE)
{
return 1;
}
@@ -2348,11 +2348,11 @@ arm_use_struct_convention (int gcc_p, struct type *type)
int i;
/* Need to check if this struct/union is "integer" like. For
this to be true, its size must be less than or equal to
- REGISTER_SIZE and the offset of each addressable subfield
- must be zero. Note that bit fields are not addressable, and
- unions always start at offset zero. If any of the subfields
- is a floating point type, the struct/union cannot be an
- integer type. */
+ DEPRECATED_REGISTER_SIZE and the offset of each addressable
+ subfield must be zero. Note that bit fields are not
+ addressable, and unions always start at offset zero. If any
+ of the subfields is a floating point type, the struct/union
+ cannot be an integer type. */
/* For each field in the object, check:
1) Is it FP? --> yes, nRc = 1;
@@ -2930,15 +2930,15 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->lowest_pc = 0x20;
tdep->jb_pc = -1; /* Longjump support not enabled by default. */
- set_gdbarch_call_dummy_words (gdbarch, arm_call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call);
/* Frame handling. */
set_gdbarch_deprecated_frame_chain_valid (gdbarch, arm_frame_chain_valid);
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, arm_init_extra_frame_info);
- set_gdbarch_read_fp (gdbarch, arm_read_fp);
+ set_gdbarch_deprecated_target_read_fp (gdbarch, arm_read_fp);
set_gdbarch_deprecated_frame_chain (gdbarch, arm_frame_chain);
set_gdbarch_frameless_function_invocation
(gdbarch, arm_frameless_function_invocation);
@@ -2972,7 +2972,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Information about registers, etc. */
set_gdbarch_print_float_info (gdbarch, arm_print_float_info);
- set_gdbarch_fp_regnum (gdbarch, ARM_FP_REGNUM); /* ??? */
+ set_gdbarch_deprecated_fp_regnum (gdbarch, ARM_FP_REGNUM); /* ??? */
set_gdbarch_sp_regnum (gdbarch, ARM_SP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, ARM_PC_REGNUM);
set_gdbarch_register_byte (gdbarch, arm_register_byte);
@@ -2991,7 +2991,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_sim_regno (gdbarch, arm_register_sim_regno);
/* Integer registers are 4 bytes. */
- set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_deprecated_register_size (gdbarch, 4);
set_gdbarch_register_name (gdbarch, arm_register_name);
/* Returning results. */
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index b787c8141cf..386b3861629 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -396,7 +396,9 @@ avr_read_fp (void)
pointer? */
static void
-avr_remote_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes,
+avr_remote_translate_xfer_address (struct gdbarch *gdbarch,
+ struct regcache *regcache,
+ CORE_ADDR memaddr, int nr_bytes,
CORE_ADDR *targ_addr, int *targ_len)
{
long out_addr;
@@ -753,8 +755,8 @@ avr_init_extra_frame_info (int fromleaf, struct frame_info *fi)
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
get_frame_base (fi)))
{
- /* We need to setup fi->frame here because run_stack_dummy gets it wrong
- by assuming it's always FP. */
+ /* We need to setup fi->frame here because call_function_by_hand
+ gets it wrong by assuming it's always FP. */
deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi),
AVR_PC_REGNUM));
}
@@ -1145,18 +1147,18 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_read_pc (gdbarch, avr_read_pc);
set_gdbarch_write_pc (gdbarch, avr_write_pc);
- set_gdbarch_read_fp (gdbarch, avr_read_fp);
+ set_gdbarch_deprecated_target_read_fp (gdbarch, avr_read_fp);
set_gdbarch_read_sp (gdbarch, avr_read_sp);
set_gdbarch_deprecated_dummy_write_sp (gdbarch, avr_write_sp);
set_gdbarch_num_regs (gdbarch, AVR_NUM_REGS);
set_gdbarch_sp_regnum (gdbarch, AVR_SP_REGNUM);
- set_gdbarch_fp_regnum (gdbarch, AVR_FP_REGNUM);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, AVR_FP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, AVR_PC_REGNUM);
set_gdbarch_register_name (gdbarch, avr_register_name);
- set_gdbarch_register_size (gdbarch, 1);
+ set_gdbarch_deprecated_register_size (gdbarch, 1);
set_gdbarch_register_bytes (gdbarch, AVR_NUM_REG_BYTES);
set_gdbarch_register_byte (gdbarch, avr_register_byte);
set_gdbarch_register_raw_size (gdbarch, avr_register_raw_size);
@@ -1168,7 +1170,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_print_insn (gdbarch, print_insn_avr);
set_gdbarch_call_dummy_address (gdbarch, avr_call_dummy_address);
- set_gdbarch_call_dummy_words (gdbarch, avr_call_dummy_words);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, avr_call_dummy_words);
/* set_gdbarch_believe_pcc_promotion (gdbarch, 1); // TRoth: should this be set? */
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 47e576e8211..fce25e469a7 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -523,14 +523,14 @@ block_innermost_frame (struct block *block)
top of the stack frame which we are checking, where "bottom" and
"top" refer to some section of memory which contains the code for
the call dummy. Calls to this macro assume that the contents of
- SP_REGNUM and FP_REGNUM (or the saved values thereof), respectively,
- are the things to pass.
-
- This won't work on the 29k, where SP_REGNUM and FP_REGNUM don't
- have that meaning, but the 29k doesn't use ON_STACK. This could be
- fixed by generalizing this scheme, perhaps by passing in a frame
- and adding a few fields, at least on machines which need them for
- DEPRECATED_PC_IN_CALL_DUMMY.
+ SP_REGNUM and DEPRECATED_FP_REGNUM (or the saved values thereof),
+ respectively, are the things to pass.
+
+ This won't work on the 29k, where SP_REGNUM and
+ DEPRECATED_FP_REGNUM don't have that meaning, but the 29k doesn't
+ use ON_STACK. This could be fixed by generalizing this scheme,
+ perhaps by passing in a frame and adding a few fields, at least on
+ machines which need them for DEPRECATED_PC_IN_CALL_DUMMY.
Something simpler, like checking for the stack segment, doesn't work,
since various programs (threads implementations, gcc nested function
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 8ab9e541f23..66b319e842b 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1697,7 +1697,7 @@ deprecated_frame_in_dummy (struct frame_info *frame)
for signals.exp in the testsuite. */
&& (get_frame_pc (frame)
>= (b->address
- - SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * REGISTER_SIZE))
+ - DEPRECATED_SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * DEPRECATED_REGISTER_SIZE))
&& get_frame_pc (frame) <= b->address)
return 1;
}
@@ -2271,9 +2271,15 @@ print_bp_stop_message (bpstat bs)
break;
case print_it_normal:
- /* Normal case, we handle everything in print_it_typical. */
- return print_it_typical (bs);
+ /* Normal case. Call the breakpoint's print_it method, or
+ print_it_typical. */
+ if (bs->breakpoint_at != NULL && bs->breakpoint_at->ops != NULL
+ && bs->breakpoint_at->ops->print_it != NULL)
+ return bs->breakpoint_at->ops->print_it (bs->breakpoint_at);
+ else
+ return print_it_typical (bs);
break;
+
default:
internal_error (__FILE__, __LINE__,
"print_bp_stop_message: unrecognized enum value");
@@ -3265,143 +3271,147 @@ print_one_breakpoint (struct breakpoint *b,
else
strcat (wrap_indent, " ");
}
- switch (b->type)
- {
- case bp_none:
- internal_error (__FILE__, __LINE__,
- "print_one_breakpoint: bp_none encountered\n");
- break;
- case bp_watchpoint:
- case bp_hardware_watchpoint:
- case bp_read_watchpoint:
- case bp_access_watchpoint:
- /* Field 4, the address, is omitted (which makes the columns
- not line up too nicely with the headers, but the effect
- is relatively readable). */
- if (addressprint)
- ui_out_field_skip (uiout, "addr");
- annotate_field (5);
- print_expression (b->exp, stb->stream);
- ui_out_field_stream (uiout, "what", stb);
- break;
-
- case bp_catch_load:
- case bp_catch_unload:
- /* Field 4, the address, is omitted (which makes the columns
- not line up too nicely with the headers, but the effect
- is relatively readable). */
- if (addressprint)
- ui_out_field_skip (uiout, "addr");
- annotate_field (5);
- if (b->dll_pathname == NULL)
- {
- ui_out_field_string (uiout, "what", "<any library>");
- ui_out_spaces (uiout, 1);
- }
- else
- {
- ui_out_text (uiout, "library \"");
- ui_out_field_string (uiout, "what", b->dll_pathname);
- ui_out_text (uiout, "\" ");
- }
- break;
-
- case bp_catch_fork:
- case bp_catch_vfork:
- /* Field 4, the address, is omitted (which makes the columns
- not line up too nicely with the headers, but the effect
- is relatively readable). */
- if (addressprint)
- ui_out_field_skip (uiout, "addr");
- annotate_field (5);
- if (b->forked_inferior_pid != 0)
- {
- ui_out_text (uiout, "process ");
- ui_out_field_int (uiout, "what", b->forked_inferior_pid);
- ui_out_spaces (uiout, 1);
- }
-
- case bp_catch_exec:
- /* Field 4, the address, is omitted (which makes the columns
- not line up too nicely with the headers, but the effect
- is relatively readable). */
- if (addressprint)
- ui_out_field_skip (uiout, "addr");
- annotate_field (5);
- if (b->exec_pathname != NULL)
- {
- ui_out_text (uiout, "program \"");
- ui_out_field_string (uiout, "what", b->exec_pathname);
- ui_out_text (uiout, "\" ");
- }
- break;
+ if (b->ops != NULL && b->ops->print_one != NULL)
+ b->ops->print_one (b, last_addr);
+ else
+ switch (b->type)
+ {
+ case bp_none:
+ internal_error (__FILE__, __LINE__,
+ "print_one_breakpoint: bp_none encountered\n");
+ break;
- case bp_catch_catch:
- /* Field 4, the address, is omitted (which makes the columns
- not line up too nicely with the headers, but the effect
- is relatively readable). */
- if (addressprint)
- ui_out_field_skip (uiout, "addr");
- annotate_field (5);
- ui_out_field_string (uiout, "what", "exception catch");
- ui_out_spaces (uiout, 1);
- break;
+ case bp_watchpoint:
+ case bp_hardware_watchpoint:
+ case bp_read_watchpoint:
+ case bp_access_watchpoint:
+ /* Field 4, the address, is omitted (which makes the columns
+ not line up too nicely with the headers, but the effect
+ is relatively readable). */
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "what", stb);
+ break;
+
+ case bp_catch_load:
+ case bp_catch_unload:
+ /* Field 4, the address, is omitted (which makes the columns
+ not line up too nicely with the headers, but the effect
+ is relatively readable). */
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ if (b->dll_pathname == NULL)
+ {
+ ui_out_field_string (uiout, "what", "<any library>");
+ ui_out_spaces (uiout, 1);
+ }
+ else
+ {
+ ui_out_text (uiout, "library \"");
+ ui_out_field_string (uiout, "what", b->dll_pathname);
+ ui_out_text (uiout, "\" ");
+ }
+ break;
+
+ case bp_catch_fork:
+ case bp_catch_vfork:
+ /* Field 4, the address, is omitted (which makes the columns
+ not line up too nicely with the headers, but the effect
+ is relatively readable). */
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ if (b->forked_inferior_pid != 0)
+ {
+ ui_out_text (uiout, "process ");
+ ui_out_field_int (uiout, "what", b->forked_inferior_pid);
+ ui_out_spaces (uiout, 1);
+ }
+
+ case bp_catch_exec:
+ /* Field 4, the address, is omitted (which makes the columns
+ not line up too nicely with the headers, but the effect
+ is relatively readable). */
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ if (b->exec_pathname != NULL)
+ {
+ ui_out_text (uiout, "program \"");
+ ui_out_field_string (uiout, "what", b->exec_pathname);
+ ui_out_text (uiout, "\" ");
+ }
+ break;
+
+ case bp_catch_catch:
+ /* Field 4, the address, is omitted (which makes the columns
+ not line up too nicely with the headers, but the effect
+ is relatively readable). */
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ ui_out_field_string (uiout, "what", "exception catch");
+ ui_out_spaces (uiout, 1);
+ break;
+
+ case bp_catch_throw:
+ /* Field 4, the address, is omitted (which makes the columns
+ not line up too nicely with the headers, but the effect
+ is relatively readable). */
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ ui_out_field_string (uiout, "what", "exception throw");
+ ui_out_spaces (uiout, 1);
+ break;
+
+ case bp_breakpoint:
+ case bp_hardware_breakpoint:
+ case bp_until:
+ case bp_finish:
+ case bp_longjmp:
+ case bp_longjmp_resume:
+ case bp_step_resume:
+ case bp_through_sigtramp:
+ case bp_watchpoint_scope:
+ case bp_call_dummy:
+ case bp_shlib_event:
+ case bp_thread_event:
+ case bp_overlay_event:
+ if (addressprint)
+ {
+ annotate_field (4);
+ ui_out_field_core_addr (uiout, "addr", b->address);
+ }
+ annotate_field (5);
+ *last_addr = b->address;
+ if (b->source_file)
+ {
+ sym = find_pc_sect_function (b->address, b->section);
+ if (sym)
+ {
+ ui_out_text (uiout, "in ");
+ ui_out_field_string (uiout, "func",
+ SYMBOL_PRINT_NAME (sym));
+ ui_out_wrap_hint (uiout, wrap_indent);
+ ui_out_text (uiout, " at ");
+ }
+ ui_out_field_string (uiout, "file", b->source_file);
+ ui_out_text (uiout, ":");
+ ui_out_field_int (uiout, "line", b->line_number);
+ }
+ else
+ {
+ print_address_symbolic (b->address, stb->stream, demangle, "");
+ ui_out_field_stream (uiout, "at", stb);
+ }
+ break;
+ }
- case bp_catch_throw:
- /* Field 4, the address, is omitted (which makes the columns
- not line up too nicely with the headers, but the effect
- is relatively readable). */
- if (addressprint)
- ui_out_field_skip (uiout, "addr");
- annotate_field (5);
- ui_out_field_string (uiout, "what", "exception throw");
- ui_out_spaces (uiout, 1);
- break;
-
- case bp_breakpoint:
- case bp_hardware_breakpoint:
- case bp_until:
- case bp_finish:
- case bp_longjmp:
- case bp_longjmp_resume:
- case bp_step_resume:
- case bp_through_sigtramp:
- case bp_watchpoint_scope:
- case bp_call_dummy:
- case bp_shlib_event:
- case bp_thread_event:
- case bp_overlay_event:
- if (addressprint)
- {
- annotate_field (4);
- ui_out_field_core_addr (uiout, "addr", b->address);
- }
- annotate_field (5);
- *last_addr = b->address;
- if (b->source_file)
- {
- sym = find_pc_sect_function (b->address, b->section);
- if (sym)
- {
- ui_out_text (uiout, "in ");
- ui_out_field_string (uiout, "func",
- SYMBOL_PRINT_NAME (sym));
- ui_out_wrap_hint (uiout, wrap_indent);
- ui_out_text (uiout, " at ");
- }
- ui_out_field_string (uiout, "file", b->source_file);
- ui_out_text (uiout, ":");
- ui_out_field_int (uiout, "line", b->line_number);
- }
- else
- {
- print_address_symbolic (b->address, stb->stream, demangle, "");
- ui_out_field_stream (uiout, "at", stb);
- }
- break;
- }
-
if (b->thread != -1)
{
/* FIXME: This seems to be redundant and lost here; see the
@@ -3851,6 +3861,7 @@ set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype)
b->triggered_dll_pathname = NULL;
b->forked_inferior_pid = 0;
b->exec_pathname = NULL;
+ b->ops = NULL;
/* Add this breakpoint to the end of the chain
so that a list of breakpoints will come out in order
@@ -4413,103 +4424,107 @@ mention (struct breakpoint *b)
create_breakpoint_hook (b);
breakpoint_create_event (b->number);
- switch (b->type)
- {
- case bp_none:
- printf_filtered ("(apparently deleted?) Eventpoint %d: ", b->number);
- break;
- case bp_watchpoint:
- ui_out_text (uiout, "Watchpoint ");
- ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "wpt");
- ui_out_field_int (uiout, "number", b->number);
- ui_out_text (uiout, ": ");
- print_expression (b->exp, stb->stream);
- ui_out_field_stream (uiout, "exp", stb);
- do_cleanups (ui_out_chain);
- break;
- case bp_hardware_watchpoint:
- ui_out_text (uiout, "Hardware watchpoint ");
- ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "wpt");
- ui_out_field_int (uiout, "number", b->number);
- ui_out_text (uiout, ": ");
- print_expression (b->exp, stb->stream);
- ui_out_field_stream (uiout, "exp", stb);
- do_cleanups (ui_out_chain);
- break;
- case bp_read_watchpoint:
- ui_out_text (uiout, "Hardware read watchpoint ");
- ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "hw-rwpt");
- ui_out_field_int (uiout, "number", b->number);
- ui_out_text (uiout, ": ");
- print_expression (b->exp, stb->stream);
- ui_out_field_stream (uiout, "exp", stb);
- do_cleanups (ui_out_chain);
- break;
- case bp_access_watchpoint:
- ui_out_text (uiout, "Hardware access (read/write) watchpoint ");
- ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "hw-awpt");
- ui_out_field_int (uiout, "number", b->number);
- ui_out_text (uiout, ": ");
- print_expression (b->exp, stb->stream);
- ui_out_field_stream (uiout, "exp", stb);
- do_cleanups (ui_out_chain);
- break;
- case bp_breakpoint:
- if (ui_out_is_mi_like_p (uiout))
- {
- say_where = 0;
- break;
- }
- printf_filtered ("Breakpoint %d", b->number);
- say_where = 1;
- break;
- case bp_hardware_breakpoint:
- if (ui_out_is_mi_like_p (uiout))
- {
- say_where = 0;
- break;
- }
- printf_filtered ("Hardware assisted breakpoint %d", b->number);
- say_where = 1;
- break;
- case bp_catch_load:
- case bp_catch_unload:
- printf_filtered ("Catchpoint %d (%s %s)",
- b->number,
- (b->type == bp_catch_load) ? "load" : "unload",
- (b->dll_pathname != NULL) ?
- b->dll_pathname : "<any library>");
- break;
- case bp_catch_fork:
- case bp_catch_vfork:
- printf_filtered ("Catchpoint %d (%s)",
- b->number,
- (b->type == bp_catch_fork) ? "fork" : "vfork");
- break;
- case bp_catch_exec:
- printf_filtered ("Catchpoint %d (exec)",
- b->number);
- break;
- case bp_catch_catch:
- case bp_catch_throw:
- printf_filtered ("Catchpoint %d (%s)",
- b->number,
- (b->type == bp_catch_catch) ? "catch" : "throw");
- break;
+ if (b->ops != NULL && b->ops->print_mention != NULL)
+ b->ops->print_mention (b);
+ else
+ switch (b->type)
+ {
+ case bp_none:
+ printf_filtered ("(apparently deleted?) Eventpoint %d: ", b->number);
+ break;
+ case bp_watchpoint:
+ ui_out_text (uiout, "Watchpoint ");
+ ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "wpt");
+ ui_out_field_int (uiout, "number", b->number);
+ ui_out_text (uiout, ": ");
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "exp", stb);
+ do_cleanups (ui_out_chain);
+ break;
+ case bp_hardware_watchpoint:
+ ui_out_text (uiout, "Hardware watchpoint ");
+ ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "wpt");
+ ui_out_field_int (uiout, "number", b->number);
+ ui_out_text (uiout, ": ");
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "exp", stb);
+ do_cleanups (ui_out_chain);
+ break;
+ case bp_read_watchpoint:
+ ui_out_text (uiout, "Hardware read watchpoint ");
+ ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "hw-rwpt");
+ ui_out_field_int (uiout, "number", b->number);
+ ui_out_text (uiout, ": ");
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "exp", stb);
+ do_cleanups (ui_out_chain);
+ break;
+ case bp_access_watchpoint:
+ ui_out_text (uiout, "Hardware access (read/write) watchpoint ");
+ ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "hw-awpt");
+ ui_out_field_int (uiout, "number", b->number);
+ ui_out_text (uiout, ": ");
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "exp", stb);
+ do_cleanups (ui_out_chain);
+ break;
+ case bp_breakpoint:
+ if (ui_out_is_mi_like_p (uiout))
+ {
+ say_where = 0;
+ break;
+ }
+ printf_filtered ("Breakpoint %d", b->number);
+ say_where = 1;
+ break;
+ case bp_hardware_breakpoint:
+ if (ui_out_is_mi_like_p (uiout))
+ {
+ say_where = 0;
+ break;
+ }
+ printf_filtered ("Hardware assisted breakpoint %d", b->number);
+ say_where = 1;
+ break;
+ case bp_catch_load:
+ case bp_catch_unload:
+ printf_filtered ("Catchpoint %d (%s %s)",
+ b->number,
+ (b->type == bp_catch_load) ? "load" : "unload",
+ (b->dll_pathname != NULL) ?
+ b->dll_pathname : "<any library>");
+ break;
+ case bp_catch_fork:
+ case bp_catch_vfork:
+ printf_filtered ("Catchpoint %d (%s)",
+ b->number,
+ (b->type == bp_catch_fork) ? "fork" : "vfork");
+ break;
+ case bp_catch_exec:
+ printf_filtered ("Catchpoint %d (exec)",
+ b->number);
+ break;
+ case bp_catch_catch:
+ case bp_catch_throw:
+ printf_filtered ("Catchpoint %d (%s)",
+ b->number,
+ (b->type == bp_catch_catch) ? "catch" : "throw");
+ break;
+
+ case bp_until:
+ case bp_finish:
+ case bp_longjmp:
+ case bp_longjmp_resume:
+ case bp_step_resume:
+ case bp_through_sigtramp:
+ case bp_call_dummy:
+ case bp_watchpoint_scope:
+ case bp_shlib_event:
+ case bp_thread_event:
+ case bp_overlay_event:
+ break;
+ }
- case bp_until:
- case bp_finish:
- case bp_longjmp:
- case bp_longjmp_resume:
- case bp_step_resume:
- case bp_through_sigtramp:
- case bp_call_dummy:
- case bp_watchpoint_scope:
- case bp_shlib_event:
- case bp_thread_event:
- case bp_overlay_event:
- break;
- }
if (say_where)
{
if (addressprint || b->source_file == NULL)
@@ -5449,7 +5464,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
#if !defined(TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT)
#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(BYTE_SIZE) \
- ((BYTE_SIZE) <= (REGISTER_SIZE))
+ ((BYTE_SIZE) <= (DEPRECATED_REGISTER_SIZE))
#endif
#if !defined(TARGET_REGION_OK_FOR_HW_WATCHPOINT)
@@ -6004,6 +6019,90 @@ create_exception_catchpoint (int tempflag, char *cond_string,
mention (b);
}
+static enum print_stop_action
+print_exception_catchpoint (struct breakpoint *b)
+{
+ annotate_catchpoint (b->number);
+
+ if (strstr (b->addr_string, "throw") != NULL)
+ printf_filtered ("\nCatchpoint %d (exception thrown)\n",
+ b->number);
+ else
+ printf_filtered ("\nCatchpoint %d (exception caught)\n",
+ b->number);
+
+ return PRINT_SRC_AND_LOC;
+}
+
+static void
+print_one_exception_catchpoint (struct breakpoint *b, CORE_ADDR *last_addr)
+{
+ if (addressprint)
+ {
+ annotate_field (4);
+ ui_out_field_core_addr (uiout, "addr", b->address);
+ }
+ annotate_field (5);
+ *last_addr = b->address;
+ if (strstr (b->addr_string, "throw") != NULL)
+ ui_out_field_string (uiout, "what", "exception throw");
+ else
+ ui_out_field_string (uiout, "what", "exception catch");
+}
+
+static void
+print_mention_exception_catchpoint (struct breakpoint *b)
+{
+ if (strstr (b->addr_string, "throw") != NULL)
+ printf_filtered ("Catchpoint %d (throw)", b->number);
+ else
+ printf_filtered ("Catchpoint %d (catch)", b->number);
+}
+
+static struct breakpoint_ops gnu_v3_exception_catchpoint_ops = {
+ print_exception_catchpoint,
+ print_one_exception_catchpoint,
+ print_mention_exception_catchpoint
+};
+
+static int
+handle_gnu_v3_exceptions (int tempflag, char *cond_string,
+ enum exception_event_kind ex_event, int from_tty)
+{
+ char *trigger_func_name, *nameptr;
+ struct symtabs_and_lines sals;
+ struct breakpoint *b;
+
+ if (ex_event == EX_EVENT_CATCH)
+ trigger_func_name = xstrdup ("__cxa_begin_catch");
+ else
+ trigger_func_name = xstrdup ("__cxa_throw");
+
+ nameptr = trigger_func_name;
+ sals = decode_line_1 (&nameptr, 1, NULL, 0, NULL);
+ if (sals.nelts == 0)
+ {
+ free (trigger_func_name);
+ return 0;
+ }
+
+ b = set_raw_breakpoint (sals.sals[0], bp_breakpoint);
+ set_breakpoint_count (breakpoint_count + 1);
+ b->number = breakpoint_count;
+ b->cond = NULL;
+ b->cond_string = (cond_string == NULL) ?
+ NULL : savestring (cond_string, strlen (cond_string));
+ b->thread = -1;
+ b->addr_string = trigger_func_name;
+ b->enable_state = bp_enabled;
+ b->disposition = tempflag ? disp_del : disp_donttouch;
+ b->ops = &gnu_v3_exception_catchpoint_ops;
+
+ free (sals.sals);
+ mention (b);
+ return 1;
+}
+
/* Deal with "catch catch" and "catch throw" commands */
static void
@@ -6024,6 +6123,9 @@ catch_exception_command_1 (enum exception_event_kind ex_event, char *arg,
(ex_event != EX_EVENT_CATCH))
error ("Unsupported or unknown exception event; cannot catch it");
+ if (handle_gnu_v3_exceptions (tempflag, cond_string, ex_event, from_tty))
+ return;
+
/* See if we can find a callback routine */
sal = target_enable_exception_callback (ex_event, 1);
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index e8c8750eef4..86eec4ae310 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -184,6 +184,24 @@ enum target_hw_bp_type
hw_execute = 3 /* Execute HW breakpoint */
};
+/* This structure is a collection of function pointers that, if available,
+ will be called instead of the performing the default action for this
+ bptype. */
+
+struct breakpoint_ops
+{
+ /* The normal print routine for this breakpoint, called when we
+ hit it. */
+ enum print_stop_action (*print_it) (struct breakpoint *);
+
+ /* Display information about this breakpoint, for "info breakpoints". */
+ void (*print_one) (struct breakpoint *, CORE_ADDR *);
+
+ /* Display information about this breakpoint after setting it (roughly
+ speaking; this is called from "mention"). */
+ void (*print_mention) (struct breakpoint *);
+};
+
/* Note that the ->silent field is not currently used by any commands
(though the code is in there if it was to be, and set_raw_breakpoint
does set it to 0). I implemented it because I thought it would be
@@ -306,6 +324,9 @@ struct breakpoint
char *exec_pathname;
asection *section;
+
+ /* Methods associated with this breakpoint. */
+ struct breakpoint_ops *ops;
};
/* The following stuff is an abstract data type "bpstat" ("breakpoint
@@ -623,7 +644,7 @@ extern void set_longjmp_resume_breakpoint (CORE_ADDR, struct frame_id);
enabled watchpoints. When disabled, the watchpoints are marked
call_disabled. When reenabled, they are marked enabled.
- The intended client of these functions is infcmd.c\run_stack_dummy.
+ The intended client of these functions is call_function_by_hand.
The inferior must be stopped, and all breakpoints removed, when
these functions are used.
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index e492b9a205e..fbdf0054afa 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -651,10 +651,47 @@ const struct language_defn asm_language_defn =
LANG_MAGIC
};
+/* The following language_defn does not represent a real language.
+ It just provides a minimal support a-la-C that should allow users
+ to do some simple operations when debugging applications that use
+ a language currently not supported by GDB. */
+
+const struct language_defn minimal_language_defn =
+{
+ "minimal", /* Language name */
+ language_minimal,
+ c_builtin_types,
+ range_check_off,
+ type_check_off,
+ case_sensitive_on,
+ c_preprocess_and_parse,
+ c_error,
+ evaluate_subexp_standard,
+ c_printchar, /* Print a character constant */
+ c_printstr, /* Function to print string constant */
+ c_emit_char, /* Print a single char */
+ c_create_fundamental_type, /* Create fundamental type in this language */
+ c_print_type, /* Print a type using appropriate syntax */
+ c_val_print, /* Print a value using appropriate syntax */
+ c_value_print, /* Print a top-level value */
+ NULL, /* Language specific skip_trampoline */
+ NULL, /* Language specific symbol demangler */
+ {"", "", "", ""}, /* Binary format info */
+ {"0%lo", "0", "o", ""}, /* Octal format info */
+ {"%ld", "", "d", ""}, /* Decimal format info */
+ {"0x%lx", "0x", "x", ""}, /* Hex format info */
+ c_op_print_tab, /* expression operators for printing */
+ 1, /* c-style arrays */
+ 0, /* String lower bound */
+ &builtin_type_char, /* Type of string elements */
+ LANG_MAGIC
+};
+
void
_initialize_c_language (void)
{
add_language (&c_language_defn);
add_language (&cplus_language_defn);
add_language (&asm_language_defn);
+ add_language (&minimal_language_defn);
}
diff --git a/gdb/charset.c b/gdb/charset.c
index 4f5e5b45b68..0062e281e99 100644
--- a/gdb/charset.c
+++ b/gdb/charset.c
@@ -96,7 +96,7 @@ struct charset {
struct charset *next;
/* The name of the character set. Comparisons on character set
- names are case-insensitive. */
+ names are case-sensitive. */
const char *name;
/* Non-zero iff this character set can be used as a host character
@@ -125,7 +125,7 @@ struct translation {
/* This structure describes functions going from the FROM character
set to the TO character set. Comparisons on character set names
- are case-insensitive. */
+ are case-sensitive. */
const char *from, *to;
/* Pointers to translation-specific functions, and data pointers to
@@ -156,16 +156,32 @@ struct translation {
/* The global lists of character sets and translations. */
-/* Character set names are always compared ignoring case. */
-static int
-strcmp_case_insensitive (const char *p, const char *q)
-{
- while (*p && *q && tolower (*p) == tolower (*q))
- p++, q++;
+#ifndef GDB_DEFAULT_HOST_CHARSET
+#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
+#endif
- return tolower (*p) - tolower (*q);
-}
+#ifndef GDB_DEFAULT_TARGET_CHARSET
+#define GDB_DEFAULT_TARGET_CHARSET "ISO-8859-1"
+#endif
+
+static const char *host_charset_name = GDB_DEFAULT_HOST_CHARSET;
+static const char *target_charset_name = GDB_DEFAULT_TARGET_CHARSET;
+static const char *host_charset_enum[] =
+{
+ "ASCII",
+ "ISO-8859-1",
+ 0
+};
+
+static const char *target_charset_enum[] =
+{
+ "ASCII",
+ "ISO-8859-1",
+ "EBCDIC-US",
+ "IBM1047",
+ 0
+};
/* The global list of all the charsets GDB knows about. */
static struct charset *all_charsets;
@@ -192,7 +208,7 @@ lookup_charset (const char *name)
struct charset *cs;
for (cs = all_charsets; cs; cs = cs->next)
- if (! strcmp_case_insensitive (name, cs->name))
+ if (! strcmp (name, cs->name))
return cs;
return NULL;
@@ -217,8 +233,8 @@ lookup_translation (const char *from, const char *to)
struct translation *t;
for (t = all_translations; t; t = t->next)
- if (! strcmp_case_insensitive (from, t->from)
- && ! strcmp_case_insensitive (to, t->to))
+ if (! strcmp (from, t->from)
+ && ! strcmp (to, t->to))
return t;
return 0;
@@ -897,6 +913,26 @@ static void *target_char_to_host_baton;
static struct cached_iconv cached_iconv_host_to_target;
static struct cached_iconv cached_iconv_target_to_host;
+
+/* Charset structures manipulation functions. */
+
+static struct charset *
+lookup_charset_or_error (const char *name)
+{
+ struct charset *cs = lookup_charset (name);
+
+ if (! cs)
+ error ("GDB doesn't know of any character set named `%s'.", name);
+
+ return cs;
+}
+
+static void
+check_valid_host_charset (struct charset *cs)
+{
+ if (! cs->valid_host_charset)
+ error ("GDB can't use `%s' as its host character set.", cs->name);
+}
/* Set the host and target character sets to HOST and TARGET. */
static void
@@ -986,35 +1022,76 @@ set_host_and_target_charsets (struct charset *host, struct charset *target)
current_target_charset = target;
}
+/* Do the real work of setting the host charset. */
+static void
+set_host_charset (const char *charset)
+{
+ struct charset *cs = lookup_charset_or_error (charset);
+ check_valid_host_charset (cs);
+ set_host_and_target_charsets (cs, current_target_charset);
+}
-static struct charset *
-lookup_charset_or_error (const char *name)
+/* Do the real work of setting the target charset. */
+static void
+set_target_charset (const char *charset)
{
- struct charset *cs = lookup_charset (name);
+ struct charset *cs = lookup_charset_or_error (charset);
- if (! cs)
- error ("GDB doesn't know of any character set named `%s'.", name);
+ set_host_and_target_charsets (current_host_charset, cs);
+}
- return cs;
+
+/* 'Set charset', 'set host-charset', 'set target-charset', 'show
+ charset' sfunc's. */
+
+/* This is the sfunc for the 'set charset' command. */
+static void
+set_charset_sfunc (char *charset, int from_tty, struct cmd_list_element *c)
+{
+ struct charset *cs = lookup_charset_or_error (host_charset_name);
+ check_valid_host_charset (cs);
+ /* CAREFUL: set the target charset here as well. */
+ target_charset_name = host_charset_name;
+ set_host_and_target_charsets (cs, cs);
}
-
+/* 'set host-charset' command sfunc. We need a wrapper here because
+ the function needs to have a specific signature. */
static void
-check_valid_host_charset (struct charset *cs)
+set_host_charset_sfunc (char *charset, int from_tty,
+ struct cmd_list_element *c)
{
- if (! cs->valid_host_charset)
- error ("GDB can't use `%s' as its host character set.", cs->name);
+ set_host_charset (host_charset_name);
}
+/* Wrapper for the 'set target-charset' command. */
+static void
+set_target_charset_sfunc (char *charset, int from_tty,
+ struct cmd_list_element *c)
+{
+ set_target_charset (target_charset_name);
+}
-void
-set_host_charset (const char *charset)
+/* sfunc for the 'show charset' command. */
+static void
+show_charset (char *arg, int from_tty)
{
- struct charset *cs = lookup_charset_or_error (charset);
- check_valid_host_charset (cs);
- set_host_and_target_charsets (cs, current_target_charset);
+ if (current_host_charset == current_target_charset)
+ {
+ printf_filtered ("The current host and target character set is `%s'.\n",
+ host_charset ());
+ }
+ else
+ {
+ printf_filtered ("The current host character set is `%s'.\n",
+ host_charset ());
+ printf_filtered ("The current target character set is `%s'.\n",
+ target_charset ());
+ }
}
+
+/* Accessor functions. */
const char *
host_charset (void)
@@ -1022,16 +1099,6 @@ host_charset (void)
return current_host_charset->name;
}
-
-void
-set_target_charset (const char *charset)
-{
- struct charset *cs = lookup_charset_or_error (charset);
-
- set_host_and_target_charsets (current_host_charset, cs);
-}
-
-
const char *
target_charset (void)
{
@@ -1094,104 +1161,14 @@ target_char_to_host (int target_char, int *host_char)
-/* Commands. */
-
-
-/* List the valid character sets. If HOST_ONLY is non-zero, list only
- those character sets which can be used as GDB's host character set. */
-static void
-list_charsets (int host_only)
-{
- struct charset *cs;
-
- printf_filtered ("Valid character sets are:\n");
-
- for (cs = all_charsets; cs; cs = cs->next)
- if (host_only && cs->valid_host_charset)
- printf_filtered (" %s\n", cs->name);
- else
- printf_filtered (" %s %s\n",
- cs->name,
- cs->valid_host_charset ? "*" : " ");
-
- if (! host_only)
- printf_filtered ("* - can be used as a host character set\n");
-}
-
-
-static void
-set_charset_command (char *arg, int from_tty)
-{
- if (! arg || arg[0] == '\0')
- list_charsets (0);
- else
- {
- struct charset *cs = lookup_charset_or_error (arg);
- check_valid_host_charset (cs);
- set_host_and_target_charsets (cs, cs);
- }
-}
-
-
-static void
-set_host_charset_command (char *arg, int from_tty)
-{
- if (! arg || arg[0] == '\0')
- list_charsets (1);
- else
- {
- struct charset *cs = lookup_charset_or_error (arg);
- check_valid_host_charset (cs);
- set_host_and_target_charsets (cs, current_target_charset);
- }
-}
-
-
-static void
-set_target_charset_command (char *arg, int from_tty)
-{
- if (! arg || arg[0] == '\0')
- list_charsets (0);
- else
- {
- struct charset *cs = lookup_charset_or_error (arg);
- set_host_and_target_charsets (current_host_charset, cs);
- }
-}
-
-
-static void
-show_charset_command (char *arg, int from_tty)
-{
- if (current_host_charset == current_target_charset)
- {
- printf_filtered ("The current host and target character set is `%s'.\n",
- host_charset ());
- }
- else
- {
- printf_filtered ("The current host character set is `%s'.\n",
- host_charset ());
- printf_filtered ("The current target character set is `%s'.\n",
- target_charset ());
- }
-}
-
-
-
/* The charset.c module initialization function. */
-#ifndef GDB_DEFAULT_HOST_CHARSET
-#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-#endif
-
-#ifndef GDB_DEFAULT_TARGET_CHARSET
-#define GDB_DEFAULT_TARGET_CHARSET "ISO-8859-1"
-#endif
void
_initialize_charset (void)
{
+ struct cmd_list_element *new_cmd;
+
/* Register all the character set GDB knows about.
You should use the same names that iconv does, where possible, to
@@ -1204,28 +1181,28 @@ _initialize_charset (void)
when a translation's function pointer for a particular operation
is zero. Hopefully, these defaults will be correct often enough
that we won't need to provide too many translations. */
- register_charset (simple_charset ("ascii", 1,
+ register_charset (simple_charset ("ASCII", 1,
ascii_print_literally, 0,
ascii_to_control, 0));
- register_charset (iso_8859_family_charset ("iso-8859-1"));
- register_charset (ebcdic_family_charset ("ebcdic-us"));
- register_charset (ebcdic_family_charset ("ibm1047"));
+ register_charset (iso_8859_family_charset ("ISO-8859-1"));
+ register_charset (ebcdic_family_charset ("EBCDIC-US"));
+ register_charset (ebcdic_family_charset ("IBM1047"));
register_iconv_charsets ();
{
struct { char *from; char *to; int *table; } tlist[] = {
- { "ascii", "iso-8859-1", ascii_to_iso_8859_1_table },
- { "ascii", "ebcdic-us", ascii_to_ebcdic_us_table },
- { "ascii", "ibm1047", ascii_to_ibm1047_table },
- { "iso-8859-1", "ascii", iso_8859_1_to_ascii_table },
- { "iso-8859-1", "ebcdic-us", iso_8859_1_to_ebcdic_us_table },
- { "iso-8859-1", "ibm1047", iso_8859_1_to_ibm1047_table },
- { "ebcdic-us", "ascii", ebcdic_us_to_ascii_table },
- { "ebcdic-us", "iso-8859-1", ebcdic_us_to_iso_8859_1_table },
- { "ebcdic-us", "ibm1047", ebcdic_us_to_ibm1047_table },
- { "ibm1047", "ascii", ibm1047_to_ascii_table },
- { "ibm1047", "iso-8859-1", ibm1047_to_iso_8859_1_table },
- { "ibm1047", "ebcdic-us", ibm1047_to_ebcdic_us_table }
+ { "ASCII", "ISO-8859-1", ascii_to_iso_8859_1_table },
+ { "ASCII", "EBCDIC-US", ascii_to_ebcdic_us_table },
+ { "ASCII", "IBM1047", ascii_to_ibm1047_table },
+ { "ISO-8859-1", "ASCII", iso_8859_1_to_ascii_table },
+ { "ISO-8859-1", "EBCDIC-US", iso_8859_1_to_ebcdic_us_table },
+ { "ISO-8859-1", "IBM1047", iso_8859_1_to_ibm1047_table },
+ { "EBCDIC-US", "ASCII", ebcdic_us_to_ascii_table },
+ { "EBCDIC-US", "ISO-8859-1", ebcdic_us_to_iso_8859_1_table },
+ { "EBCDIC-US", "IBM1047", ebcdic_us_to_ibm1047_table },
+ { "IBM1047", "ASCII", ibm1047_to_ascii_table },
+ { "IBM1047", "ISO-8859-1", ibm1047_to_iso_8859_1_table },
+ { "IBM1047", "EBCDIC-US", ibm1047_to_ebcdic_us_table }
};
int i;
@@ -1236,40 +1213,63 @@ _initialize_charset (void)
tlist[i].table));
}
- set_host_charset (GDB_DEFAULT_HOST_CHARSET);
- set_target_charset (GDB_DEFAULT_TARGET_CHARSET);
-
- add_cmd ("charset", class_support, set_charset_command,
- "Use CHARSET as the host and target character set.\n"
- "The `host character set' is the one used by the system GDB is running on.\n"
- "The `target character set' is the one used by the program being debugged.\n"
- "You may only use supersets of ASCII for your host character set; GDB does\n"
- "not support any others.\n"
- "To see a list of the character sets GDB supports, type `set charset'\n"
- "with no argument.",
- &setlist);
-
- add_cmd ("host-charset", class_support, set_host_charset_command,
- "Use CHARSET as the host character set.\n"
- "The `host character set' is the one used by the system GDB is running on.\n"
- "You may only use supersets of ASCII for your host character set; GDB does\n"
- "not support any others.\n"
- "To see a list of the character sets GDB supports, type `set host-charset'\n"
- "with no argument.",
- &setlist);
-
- add_cmd ("target-charset", class_support, set_target_charset_command,
- "Use CHARSET as the target character set.\n"
- "The `target character set' is the one used by the program being debugged.\n"
- "GDB translates characters and strings between the host and target\n"
- "character sets as needed.\n"
- "To see a list of the character sets GDB supports, type `set target-charset'\n"
- "with no argument.",
- &setlist);
-
- add_cmd ("charset", class_support, show_charset_command,
- "Show the current host and target character sets.",
- &showlist);
- add_alias_cmd ("host-charset", "charset", class_alias, 1, &showlist);
- add_alias_cmd ("target-charset", "charset", class_alias, 1, &showlist);
+ set_host_charset (host_charset_name);
+ set_target_charset (target_charset_name);
+
+ new_cmd = add_set_enum_cmd ("charset",
+ class_support,
+ host_charset_enum,
+ &host_charset_name,
+ "Set the host and target character sets.\n"
+ "The `host character set' is the one used by the system GDB is running on.\n"
+ "The `target character set' is the one used by the program being debugged.\n"
+ "You may only use supersets of ASCII for your host character set; GDB does\n"
+ "not support any others.\n"
+ "To see a list of the character sets GDB supports, type `set charset <TAB>'.",
+ &setlist);
+
+ /* Note that the sfunc below needs to set target_charset_name, because
+ the 'set charset' command sets two variables. */
+ set_cmd_sfunc (new_cmd, set_charset_sfunc);
+ /* Don't use set_from_show - need to print some extra info. */
+ add_cmd ("charset", class_support, show_charset,
+ "Show the host and target character sets.\n"
+ "The `host character set' is the one used by the system GDB is running on.\n"
+ "The `target character set' is the one used by the program being debugged.\n"
+ "You may only use supersets of ASCII for your host character set; GDB does\n"
+ "not support any others.\n"
+ "To see a list of the character sets GDB supports, type `set charset <TAB>'.",
+ &showlist);
+
+
+ new_cmd = add_set_enum_cmd ("host-charset",
+ class_support,
+ host_charset_enum,
+ &host_charset_name,
+ "Set the host character set.\n"
+ "The `host character set' is the one used by the system GDB is running on.\n"
+ "You may only use supersets of ASCII for your host character set; GDB does\n"
+ "not support any others.\n"
+ "To see a list of the character sets GDB supports, type `set host-charset <TAB>'.",
+ &setlist);
+
+ set_cmd_sfunc (new_cmd, set_host_charset_sfunc);
+
+ add_show_from_set (new_cmd, &showlist);
+
+
+
+ new_cmd = add_set_enum_cmd ("target-charset",
+ class_support,
+ target_charset_enum,
+ &target_charset_name,
+ "Set the target character set.\n"
+ "The `target character set' is the one used by the program being debugged.\n"
+ "GDB translates characters and strings between the host and target\n"
+ "character sets as needed.\n"
+ "To see a list of the character sets GDB supports, type `set target-charset'<TAB>",
+ &setlist);
+
+ set_cmd_sfunc (new_cmd, set_target_charset_sfunc);
+ add_show_from_set (new_cmd, &showlist);
}
diff --git a/gdb/charset.h b/gdb/charset.h
index 10578cb9243..31dbe6f9f3d 100644
--- a/gdb/charset.h
+++ b/gdb/charset.h
@@ -46,23 +46,12 @@
the requirements above, it's easy to plug an entry into GDB's table
that uses iconv to handle the details. */
-
-/* Set the host character set to CHARSET. CHARSET must be a superset
- of ASCII, since GDB's code assumes this. */
-void set_host_charset (const char *charset);
-
-
-/* Set the target character set to CHARSET. */
-void set_target_charset (const char *charset);
-
-
/* Return the name of the current host/target character set. The
result is owned by the charset module; the caller should not free
it. */
const char *host_charset (void);
const char *target_charset (void);
-
/* In general, the set of C backslash escapes (\n, \f) is specific to
the character set. Not all character sets will have form feed
characters, for example.
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index c33c242bad5..108329a50c7 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -171,10 +171,6 @@ struct cmd_list_element *maintenanceinfolist;
struct cmd_list_element *maintenanceprintlist;
-/* Chain containing all defined "maintenance list" subcommands. */
-
-struct cmd_list_element *maintenancelistlist;
-
struct cmd_list_element *setprintlist;
struct cmd_list_element *showprintlist;
@@ -1036,7 +1032,6 @@ init_cmd_lists (void)
maintenancelist = NULL;
maintenanceinfolist = NULL;
maintenanceprintlist = NULL;
- maintenancelistlist = NULL;
setprintlist = NULL;
showprintlist = NULL;
setchecklist = NULL;
diff --git a/gdb/cli/cli-cmds.h b/gdb/cli/cli-cmds.h
index 1f340efa101..a6e574edd71 100644
--- a/gdb/cli/cli-cmds.h
+++ b/gdb/cli/cli-cmds.h
@@ -87,10 +87,6 @@ extern struct cmd_list_element *maintenanceinfolist;
extern struct cmd_list_element *maintenanceprintlist;
-/* Chain containing all defined "maintenance list" subcommands. */
-
-extern struct cmd_list_element *maintenancelistlist;
-
extern struct cmd_list_element *setprintlist;
extern struct cmd_list_element *showprintlist;
diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst
index b426652e364..9e87a63343e 100644
--- a/gdb/config/djgpp/fnchange.lst
+++ b/gdb/config/djgpp/fnchange.lst
@@ -232,6 +232,7 @@
@V@/gdb/testsuite/gdb.c++/m-static1.cc @V@/gdb/testsuite/gdb.cxx/m-stat1.cc
@V@/gdb/testsuite/gdb.c++/m-static.exp @V@/gdb/testsuite/gdb.cxx/m-static.exp
@V@/gdb/testsuite/gdb.c++/m-static.h @V@/gdb/testsuite/gdb.cxx/m-static.h
+@V@/gdb/testsuite/gdb.c++/maint.exp @V@/gdb/testsuite/gdb.cxx/maint.exp
@V@/gdb/testsuite/gdb.c++/member-ptr.cc @V@/gdb/testsuite/gdb.cxx/member-ptr.cc
@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
diff --git a/gdb/config/i386/nto.mt b/gdb/config/i386/nto.mt
new file mode 100644
index 00000000000..6655f3eee74
--- /dev/null
+++ b/gdb/config/i386/nto.mt
@@ -0,0 +1,4 @@
+# Target: Intel 386 running qnx6.
+TDEPFILES = i386-tdep.o i387-tdep.o corelow.o solib.o solib-svr4.o \
+ i386-nto-tdep.o nto-tdep.o remote-nto.o
+TM_FILE = tm-nto.h
diff --git a/gdb/config/i386/tm-nto.h b/gdb/config/i386/tm-nto.h
new file mode 100644
index 00000000000..ff5eb7837e0
--- /dev/null
+++ b/gdb/config/i386/tm-nto.h
@@ -0,0 +1,33 @@
+/* QNX Neutrino target header.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ This code was donated by QNX Software Systems Ltd.
+
+ 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_NTO_H
+#define TM_NTO_H 1
+
+/* Pick up most of what we need from the generic i386 target include file. */
+#include "i386/tm-i386.h"
+#include "tm-nto.h"
+
+#include "solib.h"
+
+#endif /* TM_NTO_H */
diff --git a/gdb/config/ia64/tm-ia64.h b/gdb/config/ia64/tm-ia64.h
index 9ebe9ae7a9a..feeef09bb0c 100644
--- a/gdb/config/ia64/tm-ia64.h
+++ b/gdb/config/ia64/tm-ia64.h
@@ -31,7 +31,7 @@
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
-#define REGISTER_SIZE 8
+#define DEPRECATED_REGISTER_SIZE 8
#undef NUM_REGS
#define NUM_REGS 590
@@ -40,7 +40,7 @@
#define PC_REGNUM IA64_IP_REGNUM
#define SP_REGNUM IA64_GR12_REGNUM
-#define FP_REGNUM IA64_VFP_REGNUM
+#define DEPRECATED_FP_REGNUM IA64_VFP_REGNUM
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. On the ia64, all registers
diff --git a/gdb/config/m68k/tm-vx68.h b/gdb/config/m68k/tm-vx68.h
index f7e8fca6f2b..271eb7ef70e 100644
--- a/gdb/config/m68k/tm-vx68.h
+++ b/gdb/config/m68k/tm-vx68.h
@@ -79,4 +79,4 @@
/* Number of registers in a ptrace_getfpregs call. */
#define VX_SIZE_FPREGS (8 * REGISTER_RAW_SIZE (FP0_REGNUM) \
- + (3 * REGISTER_SIZE))
+ + (3 * DEPRECATED_REGISTER_SIZE))
diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h
index dada6155713..f9aebbe1f5a 100644
--- a/gdb/config/mips/tm-mips.h
+++ b/gdb/config/mips/tm-mips.h
@@ -49,10 +49,10 @@ extern int mips_step_skips_delay (CORE_ADDR);
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
-#define REGISTER_SIZE 4
+#define DEPRECATED_REGISTER_SIZE 4
/* The size of a register. This is predefined in tm-mips64.h. We
- can't use REGISTER_SIZE because that is used for various other
+ can't use DEPRECATED_REGISTER_SIZE because that is used for various other
things. */
#ifndef MIPS_REGSIZE
diff --git a/gdb/config/pa/nm-hppah.h b/gdb/config/pa/nm-hppah.h
index 2cc1e300365..f8a2a117fa2 100644
--- a/gdb/config/pa/nm-hppah.h
+++ b/gdb/config/pa/nm-hppah.h
@@ -121,9 +121,10 @@ extern int hppa_can_use_hw_watchpoint (int type, int cnt, int ot);
#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \
hppa_can_use_hw_watchpoint(type, cnt, ot)
-/* The PA can also watch memory regions of arbitrary size, since we're using
- a page-protection scheme. (On some targets, apparently watch registers
- are used, which can only accomodate regions of REGISTER_SIZE.) */
+/* The PA can also watch memory regions of arbitrary size, since we're
+ using a page-protection scheme. (On some targets, apparently watch
+ registers are used, which can only accomodate regions of
+ DEPRECATED_REGISTER_SIZE.) */
#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(byte_count) \
(1)
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index c0b3e2630ea..7daa6f5eadf 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -27,7 +27,9 @@
/* Wonder if this is correct? Should be using push_dummy_call(). */
#define DEPRECATED_DUMMY_WRITE_SP(SP) generic_target_write_sp (SP)
-#define GDB_MULTI_ARCH 0
+#ifndef GDB_MULTI_ARCH
+#define GDB_MULTI_ARCH 1
+#endif
/* NOTE: cagney/2002-11-24: This is a guess. */
#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 0
@@ -43,11 +45,6 @@ struct value;
struct type;
struct inferior_status;
-/* By default assume we don't have to worry about software floating point. */
-#ifndef SOFT_FLOAT
-#define SOFT_FLOAT 0
-#endif
-
/* Get at various relevent fields of an instruction word. */
#define MASK_5 0x1f
@@ -61,96 +58,14 @@ struct inferior_status;
((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1))
#endif
-#if !GDB_MULTI_ARCH
-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)
-#endif
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#if !GDB_MULTI_ARCH
-#define FUNCTION_START_OFFSET 0
-#endif
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_skip_prologue (CORE_ADDR);
-#define SKIP_PROLOGUE(pc) (hppa_skip_prologue (pc))
-#endif
-
-/* If PC is in some function-call trampoline code, return the PC
- where the function itself actually starts. If not, return NULL. */
-
-#if !GDB_MULTI_ARCH
-#define SKIP_TRAMPOLINE_CODE(pc) hppa_skip_trampoline_code (pc)
-extern CORE_ADDR hppa_skip_trampoline_code (CORE_ADDR);
-#endif
-
-/* Return non-zero if we are in an appropriate trampoline. */
-
-#if !GDB_MULTI_ARCH
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
- hppa_in_solib_call_trampoline (pc, name)
-extern int hppa_in_solib_call_trampoline (CORE_ADDR, char *);
-#endif
-
-#if !GDB_MULTI_ARCH
-#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) \
- hppa_in_solib_return_trampoline (pc, name)
-extern int hppa_in_solib_return_trampoline (CORE_ADDR, char *);
-#endif
-
-#if !GDB_MULTI_ARCH
-#undef DEPRECATED_SAVED_PC_AFTER_CALL
-#define DEPRECATED_SAVED_PC_AFTER_CALL(frame) hppa_saved_pc_after_call (frame)
-extern CORE_ADDR hppa_saved_pc_after_call (struct frame_info *);
-#endif
-
-#if !GDB_MULTI_ARCH
-extern int hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs);
-#define INNER_THAN(lhs,rhs) hppa_inner_than(lhs,rhs)
-#endif
-
-#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_stack_align (CORE_ADDR sp);
-#define STACK_ALIGN(sp) hppa_stack_align (sp)
-#endif
-
/* Sequence of bytes for breakpoint instruction. */
#define BREAKPOINT {0x00, 0x01, 0x00, 0x04}
#define BREAKPOINT32 0x10004
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always.
-
- Not on the PA-RISC */
-
-#if !GDB_MULTI_ARCH
-#define DECR_PC_AFTER_BREAK 0
-#endif
-
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
- real way to know how big a register is. */
-
-#if !GDB_MULTI_ARCH
-#define REGISTER_SIZE 4
-#endif
-
-/* Number of machine registers */
-
-#if !GDB_MULTI_ARCH
-#define NUM_REGS 128
-#endif
-
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer.
They are in rows of eight entries */
@@ -184,13 +99,6 @@ extern int hppa_pc_requires_run_before_use (CORE_ADDR pc);
other r registers. */
#define FLAGS_REGNUM 0 /* Various status flags */
#define RP_REGNUM 2 /* return pointer */
-#if !GDB_MULTI_ARCH
-#define FP_REGNUM 3 /* Contains address of executing stack */
- /* frame */
-#endif
-#if !GDB_MULTI_ARCH
-#define SP_REGNUM 30 /* Contains address of top of stack */
-#endif
#define SAR_REGNUM 32 /* Shift Amount Register */
#define IPSW_REGNUM 41 /* Interrupt Processor Status Word */
#define PCOQ_HEAD_REGNUM 33 /* instruction offset queue head */
@@ -205,9 +113,6 @@ extern int hppa_pc_requires_run_before_use (CORE_ADDR pc);
#define CCR_REGNUM 54 /* Coprocessor Configuration Register */
#define TR0_REGNUM 57 /* Temporary Registers (cr24 -> cr31) */
#define CR27_REGNUM 60 /* Base register for thread-local storage, cr27 */
-#if !GDB_MULTI_ARCH
-#define FP0_REGNUM 64 /* floating point reg. 0 (fspr) */
-#endif
#define FP4_REGNUM 72
#define ARG0_REGNUM 26 /* The first argument of a callee. */
@@ -215,14 +120,6 @@ extern int hppa_pc_requires_run_before_use (CORE_ADDR pc);
#define ARG2_REGNUM 24 /* The third argument of a callee. */
#define ARG3_REGNUM 23 /* The fourth argument of a callee. */
-/* compatibility with the rest of gdb. */
-#if !GDB_MULTI_ARCH
-#define PC_REGNUM PCOQ_HEAD_REGNUM
-#endif
-#if !GDB_MULTI_ARCH
-#define NPC_REGNUM PCOQ_TAIL_REGNUM
-#endif
-
/*
* Processor Status Word Masks
*/
@@ -260,107 +157,12 @@ extern int hppa_pc_requires_run_before_use (CORE_ADDR pc);
#define DEPRECATED_DO_REGISTERS_INFO(_regnum, fp) pa_do_registers_info (_regnum, fp)
extern void pa_do_registers_info (int, int);
-#if 0
-#define STRCAT_REGISTER(regnum, fpregs, stream, precision) pa_do_strcat_registers_info (regnum, fpregs, stream, precision)
-extern void pa_do_strcat_registers_info (int, int, struct ui_file *, enum precision_type);
-#endif
-
/* PA specific macro to see if the current instruction is nullified. */
#ifndef INSTRUCTION_NULLIFIED
extern int hppa_instruction_nullified (void);
#define INSTRUCTION_NULLIFIED hppa_instruction_nullified ()
#endif
-/* Number of bytes of storage in the actual machine representation
- for register N. On the PA-RISC, all regs are 4 bytes, including
- the FP registers (they're accessed as two 4 byte halves). */
-
-#if !GDB_MULTI_ARCH
-extern int hppa_register_raw_size (int reg_nr);
-#define REGISTER_RAW_SIZE(N) hppa_register_raw_size (N)
-#endif
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#if !GDB_MULTI_ARCH
-#define REGISTER_BYTES (NUM_REGS * 4)
-#endif
-
-#if !GDB_MULTI_ARCH
-extern int hppa_register_byte (int reg_nr);
-#define REGISTER_BYTE(N) hppa_register_byte (N)
-#endif
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-
-#if !GDB_MULTI_ARCH
-#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
-#endif
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_MAX_REGISTER_RAW_SIZE 4
-#endif
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8
-#endif
-
-#if !GDB_MULTI_ARCH
-extern struct type * hppa_register_virtual_type (int reg_nr);
-#define REGISTER_VIRTUAL_TYPE(N) hppa_register_virtual_type (N)
-#endif
-
-#if !GDB_MULTI_ARCH
-extern void hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
-#define STORE_STRUCT_RETURN(ADDR, SP) hppa_store_struct_return (ADDR, SP)
-#endif
-
-/* 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. */
-
-#if !GDB_MULTI_ARCH
-void hppa_extract_return_value (struct type *type, char *regbuf, char *valbuf);
-#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- hppa_extract_return_value (TYPE, REGBUF, VALBUF);
-#endif
-
- /* elz: decide whether the function returning a value of type type
- will put it on the stack or in the registers.
- The pa calling convention says that:
- register 28 (called ret0 by gdb) contains any ASCII char,
- and any non_floating point value up to 32-bits.
- reg 28 and 29 contain non-floating point up tp 64 bits and larger
- than 32 bits. (higer order word in reg 28).
- fr4: floating point up to 64 bits
- sr1: space identifier (32-bit)
- stack: any lager than 64-bit, with the address in r28
- */
-#if !GDB_MULTI_ARCH
-extern use_struct_convention_fn hppa_use_struct_convention;
-#define USE_STRUCT_CONVENTION(gcc_p,type) hppa_use_struct_convention (gcc_p,type)
-#endif
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#if !GDB_MULTI_ARCH
-extern void hppa_store_return_value (struct type *type, char *valbuf);
-#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
- hppa_store_return_value (TYPE, VALBUF);
-#endif
-
-#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_extract_struct_value_address (char *regbuf);
-#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- hppa_extract_struct_value_address (REGBUF)
-#endif
-
/* elz: Return a large value, which is stored on the stack at addr.
This is defined only for the hppa, at this moment. The above macro
DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS is not called anymore,
@@ -376,93 +178,12 @@ 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)
-#if !GDB_MULTI_ARCH
-extern int hppa_cannot_store_register (int regnum);
-#define CANNOT_STORE_REGISTER(regno) hppa_cannot_store_register (regno)
-#endif
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) hppa_init_extra_frame_info (fromleaf, frame)
-extern void hppa_init_extra_frame_info (int, struct frame_info *);
-#endif
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces
- the frame's chain-pointer. */
-
-/* In the case of the PA-RISC, the frame's nominal address
- is the address of a 4-byte word containing the calling frame's
- address (previous FP). */
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_FRAME_CHAIN(thisframe) hppa_frame_chain (thisframe)
-extern CORE_ADDR hppa_frame_chain (struct frame_info *);
-#endif
-
-#if !GDB_MULTI_ARCH
-extern int hppa_frame_chain_valid (CORE_ADDR, struct frame_info *);
-#define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) hppa_frame_chain_valid (chain, thisframe)
-#endif
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-#if !GDB_MULTI_ARCH
-#define FRAMELESS_FUNCTION_INVOCATION(FI) \
- (hppa_frameless_function_invocation (FI))
-extern int hppa_frameless_function_invocation (struct frame_info *);
-#endif
-
-#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_frame_saved_pc (struct frame_info *frame);
-#define DEPRECATED_FRAME_SAVED_PC(FRAME) hppa_frame_saved_pc (FRAME)
-#endif
-
-#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_frame_args_address (struct frame_info *fi);
-#define FRAME_ARGS_ADDRESS(fi) hppa_frame_args_address (fi)
-#endif
-
-#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_frame_locals_address (struct frame_info *fi);
-#define FRAME_LOCALS_ADDRESS(fi) hppa_frame_locals_address (fi)
-#endif
-
-#if !GDB_MULTI_ARCH
-extern int hppa_frame_num_args (struct frame_info *frame);
-#define FRAME_NUM_ARGS(fi) hppa_frame_num_args (fi)
-#endif
-
-#if !GDB_MULTI_ARCH
-#define FRAME_ARGS_SKIP 0
-#endif
-
extern void hppa_frame_init_saved_regs (struct frame_info *);
#define DEPRECATED_FRAME_INIT_SAVED_REGS(FI) \
hppa_frame_init_saved_regs (FI)
-/* Things needed for making the inferior call functions. */
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_PUSH_DUMMY_FRAME hppa_push_dummy_frame ()
-extern void hppa_push_dummy_frame (void);
-#endif
-
-/* Discard from the stack the innermost frame,
- restoring all saved registers. */
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_POP_FRAME hppa_pop_frame ()
-extern void hppa_pop_frame (void);
-#endif
-
#define INSTRUCTION_SIZE 4
-#ifndef PA_LEVEL_0
-
/* Non-level zero PA's have space registers (but they don't always have
floating-point, do they???? */
@@ -544,52 +265,8 @@ extern void hppa_pop_frame (void);
0xe6c00002, 0xe4202000, 0x6bdf3fd1, 0x00010004,\
0x00151820, 0xe6c00002, 0x08000240, 0x08000240}
-#if !GDB_MULTI_ARCH
-#define CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 28)
-#endif
#define REG_PARM_STACK_SPACE 16
-#else /* defined PA_LEVEL_0 */
-
-/* FIXME: brobecker 2002-12-26. PA_LEVEL_0 is only defined for the
- hppa-pro target, which should be obsoleted soon. The following
- section will therefore not be included in the multiarch conversion. */
-/* This is the call dummy for a level 0 PA. Level 0's don't have space
- registers (or floating point?), so we skip all that inter-space call stuff,
- and avoid touching the fp regs.
-
- call_dummy
-
- ldw -36(%sp), %arg0
- ldw -40(%sp), %arg1
- ldw -44(%sp), %arg2
- ldw -48(%sp), %arg3
- ldil 0, %r31 ; FUNC_LDIL_OFFSET must point here
- ldo 0(%r31), %r31 ; FUNC_LDO_OFFSET must point here
- ble 0(%sr0, %r31)
- copy %r31, %r2
- break 4, 8
- nop ; restore_pc_queue expects these
- bv,n 0(%r22) ; instructions to be here...
- nop
- */
-
-/* Define offsets into the call dummy for the target function address */
-#define FUNC_LDIL_OFFSET (INSTRUCTION_SIZE * 4)
-#define FUNC_LDO_OFFSET (INSTRUCTION_SIZE * 5)
-
-#define CALL_DUMMY {0x4bda3fb9, 0x4bd93fb1, 0x4bd83fa9, 0x4bd73fa1,\
- 0x23e00000, 0x37ff0000, 0xe7e00000, 0x081f0242,\
- 0x00010004, 0x08000240, 0xeac0c002, 0x08000240}
-
-#define CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 12)
-
-#endif /* defined PA_LEVEL_0 */
-
-#if !GDB_MULTI_ARCH
-#define CALL_DUMMY_START_OFFSET 0
-#endif
-
/* If we've reached a trap instruction within the call dummy, then
we'll consider that to mean that we've reached the call dummy's
end after its successful completion. */
@@ -597,42 +274,25 @@ extern void hppa_pop_frame (void);
(DEPRECATED_PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) && \
(read_memory_integer((pc), 4) == BREAKPOINT32))
-/*
- * Insert the specified number of args and function address
- * into a call sequence of the above form stored at DUMMYNAME.
- *
- * On the hppa we need to call the stack dummy through $$dyncall.
- * Therefore our version of FIX_CALL_DUMMY takes an extra argument,
- * real_pc, which is the location where gdb should start up the
- * inferior to do the function call.
- */
+/* Insert the specified number of args and function address into a
+ call sequence of the above form stored at DUMMYNAME.
+
+ On the hppa we need to call the stack dummy through $$dyncall.
+ Therefore our version of DEPRECATED_FIX_CALL_DUMMY takes an extra
+ argument, real_pc, which is the location where gdb should start up
+ the inferior to do the function call. */
/* FIXME: brobecker 2002-12-26. This macro is going to cause us some
- problems before we can go to multiarch partial as it has been diverted
- on HPUX to return the value of the PC! */
-#define FIX_CALL_DUMMY hppa_fix_call_dummy
+ problems before we can go to multiarch partial as it has been
+ diverted on HPUX to return the value of the PC! */
+/* NOTE: cagney/2003-05-03: This has been replaced by push_dummy_code.
+ Hopefully that has all the parameters HP/UX needs. */
+#define DEPRECATED_FIX_CALL_DUMMY hppa_fix_call_dummy
extern CORE_ADDR hppa_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, int,
struct value **, struct type *, int);
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
- (hppa_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
-extern CORE_ADDR hppa_push_arguments (int, struct value **, CORE_ADDR, int,
- CORE_ADDR);
-#endif
-
-
-#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_smash_text_address (CORE_ADDR addr);
-#define SMASH_TEXT_ADDRESS(addr) hppa_smash_text_address (addr)
-#endif
-
#define GDB_TARGET_IS_HPPA
-#if !GDB_MULTI_ARCH
-#define BELIEVE_PCC_PROMOTION 1
-#endif
-
/*
* Unwind table and descriptor.
*/
@@ -752,27 +412,6 @@ typedef struct obj_private_struct
}
obj_private_data_t;
-#if 0
-extern void target_write_pc (CORE_ADDR, int);
-extern CORE_ADDR target_read_pc (int);
-extern CORE_ADDR skip_trampoline_code (CORE_ADDR, char *);
-#endif
-
-#if !GDB_MULTI_ARCH
-#define TARGET_READ_PC(pid) hppa_target_read_pc (pid)
-extern CORE_ADDR hppa_target_read_pc (ptid_t);
-#endif
-
-#if !GDB_MULTI_ARCH
-#define TARGET_WRITE_PC(v,pid) hppa_target_write_pc (v,pid)
-extern void hppa_target_write_pc (CORE_ADDR, ptid_t);
-#endif
-
-#if !GDB_MULTI_ARCH
-#define TARGET_READ_FP() hppa_target_read_fp ()
-extern CORE_ADDR hppa_target_read_fp (void);
-#endif
-
/* For a number of horrible reasons we may have to adjust the location
of variables on the stack. Ugh. */
#define HPREAD_ADJUST_STACK_ADDRESS(ADDR) hpread_adjust_stack_address(ADDR)
diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h
index 503e42688df..81bf7caeb08 100644
--- a/gdb/config/pa/tm-hppa64.h
+++ b/gdb/config/pa/tm-hppa64.h
@@ -28,6 +28,324 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
gotten working yet. */
#define GDB_TARGET_IS_HPPA_20W
+/* FIXME: brobecker 2003-04-21: Although 32bit hppa is partially multiarched,
+ the conversion for hppa64 hasn't been completed yet. */
+#define GDB_MULTI_ARCH 0
+
+/* FIXME: brobecker 2003-04-21: All the definition from this point until
+ the include of pa/tm-hppah.h are extracted from tm-hppa.h. They have
+ been temporarily moved here, until hppa64 is multiarched too. */
+
+#if !GDB_MULTI_ARCH
+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)
+#endif
+
+/* Offset from address of function to start of its code.
+ Zero on most machines. */
+
+#if !GDB_MULTI_ARCH
+#define FUNCTION_START_OFFSET 0
+#endif
+
+/* Advance PC across any function entry prologue instructions
+ to reach some "real" code. */
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_skip_prologue (CORE_ADDR);
+#define SKIP_PROLOGUE(pc) (hppa_skip_prologue (pc))
+#endif
+
+/* If PC is in some function-call trampoline code, return the PC
+ where the function itself actually starts. If not, return NULL. */
+
+#if !GDB_MULTI_ARCH
+#define SKIP_TRAMPOLINE_CODE(pc) hppa_skip_trampoline_code (pc)
+extern CORE_ADDR hppa_skip_trampoline_code (CORE_ADDR);
+#endif
+
+/* Return non-zero if we are in an appropriate trampoline. */
+
+#if !GDB_MULTI_ARCH
+#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
+ hppa_in_solib_call_trampoline (pc, name)
+extern int hppa_in_solib_call_trampoline (CORE_ADDR, char *);
+#endif
+
+#if !GDB_MULTI_ARCH
+#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) \
+ hppa_in_solib_return_trampoline (pc, name)
+extern int hppa_in_solib_return_trampoline (CORE_ADDR, char *);
+#endif
+
+#if !GDB_MULTI_ARCH
+#undef DEPRECATED_SAVED_PC_AFTER_CALL
+#define DEPRECATED_SAVED_PC_AFTER_CALL(frame) hppa_saved_pc_after_call (frame)
+extern CORE_ADDR hppa_saved_pc_after_call (struct frame_info *);
+#endif
+
+#if !GDB_MULTI_ARCH
+extern int hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs);
+#define INNER_THAN(lhs,rhs) hppa_inner_than(lhs,rhs)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_stack_align (CORE_ADDR sp);
+#define STACK_ALIGN(sp) hppa_stack_align (sp)
+#endif
+
+/* Amount PC must be decremented by after a breakpoint.
+ This is often the number of bytes in BREAKPOINT
+ but not always.
+
+ Not on the PA-RISC */
+
+#if !GDB_MULTI_ARCH
+#define DECR_PC_AFTER_BREAK 0
+#endif
+
+/* 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
+ real way to know how big a register is. */
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_REGISTER_SIZE 4
+#endif
+
+/* Number of machine registers */
+
+#if !GDB_MULTI_ARCH
+#define NUM_REGS 128
+#endif
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_FP_REGNUM 3 /* Contains address of executing stack */
+ /* frame */
+#endif
+#if !GDB_MULTI_ARCH
+#define SP_REGNUM 30 /* Contains address of top of stack */
+#endif
+
+#if !GDB_MULTI_ARCH
+#define FP0_REGNUM 64 /* floating point reg. 0 (fspr) */
+#endif
+
+/* compatibility with the rest of gdb. */
+#if !GDB_MULTI_ARCH
+#define PC_REGNUM PCOQ_HEAD_REGNUM
+#endif
+#if !GDB_MULTI_ARCH
+#define NPC_REGNUM PCOQ_TAIL_REGNUM
+#endif
+
+/* Number of bytes of storage in the actual machine representation
+ for register N. On the PA-RISC, all regs are 4 bytes, including
+ the FP registers (they're accessed as two 4 byte halves). */
+
+#if !GDB_MULTI_ARCH
+extern int hppa_register_raw_size (int reg_nr);
+#define REGISTER_RAW_SIZE(N) hppa_register_raw_size (N)
+#endif
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+#if !GDB_MULTI_ARCH
+#define REGISTER_BYTES (NUM_REGS * 4)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern int hppa_register_byte (int reg_nr);
+#define REGISTER_BYTE(N) hppa_register_byte (N)
+#endif
+
+/* Number of bytes of storage in the program's representation
+ for register N. */
+
+#if !GDB_MULTI_ARCH
+#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
+#endif
+
+/* Largest value REGISTER_RAW_SIZE can have. */
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE 4
+#endif
+
+/* Largest value REGISTER_VIRTUAL_SIZE can have. */
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8
+#endif
+
+#if !GDB_MULTI_ARCH
+extern struct type * hppa_register_virtual_type (int reg_nr);
+#define REGISTER_VIRTUAL_TYPE(N) hppa_register_virtual_type (N)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern void hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
+#define STORE_STRUCT_RETURN(ADDR, SP) hppa_store_struct_return (ADDR, SP)
+#endif
+
+/* 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. */
+
+#if !GDB_MULTI_ARCH
+void hppa_extract_return_value (struct type *type, char *regbuf, char *valbuf);
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ hppa_extract_return_value (TYPE, REGBUF, VALBUF);
+#endif
+
+ /* elz: decide whether the function returning a value of type type
+ will put it on the stack or in the registers.
+ The pa calling convention says that:
+ register 28 (called ret0 by gdb) contains any ASCII char,
+ and any non_floating point value up to 32-bits.
+ reg 28 and 29 contain non-floating point up tp 64 bits and larger
+ than 32 bits. (higer order word in reg 28).
+ fr4: floating point up to 64 bits
+ sr1: space identifier (32-bit)
+ stack: any lager than 64-bit, with the address in r28
+ */
+#if !GDB_MULTI_ARCH
+extern use_struct_convention_fn hppa_use_struct_convention;
+#define USE_STRUCT_CONVENTION(gcc_p,type) hppa_use_struct_convention (gcc_p,type)
+#endif
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+
+#if !GDB_MULTI_ARCH
+extern void hppa_store_return_value (struct type *type, char *valbuf);
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
+ hppa_store_return_value (TYPE, VALBUF);
+#endif
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_extract_struct_value_address (char *regbuf);
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
+ hppa_extract_struct_value_address (REGBUF)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern int hppa_cannot_store_register (int regnum);
+#define CANNOT_STORE_REGISTER(regno) hppa_cannot_store_register (regno)
+#endif
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) hppa_init_extra_frame_info (fromleaf, frame)
+extern void hppa_init_extra_frame_info (int, struct frame_info *);
+#endif
+
+/* Describe the pointer in each stack frame to the previous stack frame
+ (its caller). */
+
+/* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces
+ the frame's chain-pointer. */
+
+/* In the case of the PA-RISC, the frame's nominal address
+ is the address of a 4-byte word containing the calling frame's
+ address (previous FP). */
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_FRAME_CHAIN(thisframe) hppa_frame_chain (thisframe)
+extern CORE_ADDR hppa_frame_chain (struct frame_info *);
+#endif
+
+#if !GDB_MULTI_ARCH
+extern int hppa_frame_chain_valid (CORE_ADDR, struct frame_info *);
+#define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) hppa_frame_chain_valid (chain, thisframe)
+#endif
+
+/* Define other aspects of the stack frame. */
+
+/* A macro that tells us whether the function invocation represented
+ by FI does not have a frame on the stack associated with it. If it
+ does not, FRAMELESS is set to 1, else 0. */
+#if !GDB_MULTI_ARCH
+#define FRAMELESS_FUNCTION_INVOCATION(FI) \
+ (hppa_frameless_function_invocation (FI))
+extern int hppa_frameless_function_invocation (struct frame_info *);
+#endif
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_frame_saved_pc (struct frame_info *frame);
+#define DEPRECATED_FRAME_SAVED_PC(FRAME) hppa_frame_saved_pc (FRAME)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_frame_args_address (struct frame_info *fi);
+#define FRAME_ARGS_ADDRESS(fi) hppa_frame_args_address (fi)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_frame_locals_address (struct frame_info *fi);
+#define FRAME_LOCALS_ADDRESS(fi) hppa_frame_locals_address (fi)
+#endif
+
+#if !GDB_MULTI_ARCH
+extern int hppa_frame_num_args (struct frame_info *frame);
+#define FRAME_NUM_ARGS(fi) hppa_frame_num_args (fi)
+#endif
+
+#if !GDB_MULTI_ARCH
+#define FRAME_ARGS_SKIP 0
+#endif
+
+/* Things needed for making the inferior call functions. */
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_PUSH_DUMMY_FRAME hppa_push_dummy_frame ()
+extern void hppa_push_dummy_frame (void);
+#endif
+
+/* Discard from the stack the innermost frame,
+ restoring all saved registers. */
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_POP_FRAME hppa_pop_frame ()
+extern void hppa_pop_frame (void);
+#endif
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 28)
+#endif
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_CALL_DUMMY_START_OFFSET 0
+#endif
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
+ (hppa_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
+extern CORE_ADDR hppa_push_arguments (int, struct value **, CORE_ADDR, int,
+ CORE_ADDR);
+#endif
+
+#if !GDB_MULTI_ARCH
+extern CORE_ADDR hppa_smash_text_address (CORE_ADDR addr);
+#define SMASH_TEXT_ADDRESS(addr) hppa_smash_text_address (addr)
+#endif
+
+#if !GDB_MULTI_ARCH
+#define BELIEVE_PCC_PROMOTION 1
+#endif
+
+#if !GDB_MULTI_ARCH
+#define TARGET_READ_PC(pid) hppa_target_read_pc (pid)
+extern CORE_ADDR hppa_target_read_pc (ptid_t);
+#endif
+
+#if !GDB_MULTI_ARCH
+#define TARGET_WRITE_PC(v,pid) hppa_target_write_pc (v,pid)
+extern void hppa_target_write_pc (CORE_ADDR, ptid_t);
+#endif
+
+#if !GDB_MULTI_ARCH
+#define DEPRECATED_TARGET_READ_FP() hppa_target_read_fp ()
+extern CORE_ADDR hppa_target_read_fp (void);
+#endif
+
#include "pa/tm-hppah.h"
#define HPUX_1100 1
@@ -39,8 +357,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
push_word and a few other places, but REGISTER_RAW_SIZE is
the real way to know how big a register is. */
-#undef REGISTER_SIZE
-#define REGISTER_SIZE 8
+#undef DEPRECATED_REGISTER_SIZE
+#define DEPRECATED_REGISTER_SIZE 8
/* Number of bytes of storage in the actual machine representation
for register N. On the PA-RISC 2.0, all regs are 8 bytes, including
@@ -183,14 +501,14 @@ call_dummy
0xe820f0000fb110d3LL, 0x0001000400151820LL,\
0xe6c0000008000240LL}
-#define CALL_DUMMY_BREAKPOINT_OFFSET 22 * 4
+#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET 22 * 4
-/* CALL_DUMMY_LENGTH is computed based on the size of a word on the target
- machine, not the size of an instruction. Since a word on this target
- holds two instructions we have to divide the instruction size by two to
- get the word size of the dummy. */
-#undef CALL_DUMMY_LENGTH
-#define CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 26 / 2)
+/* DEPRECATED_CALL_DUMMY_LENGTH is computed based on the size of a
+ word on the target machine, not the size of an instruction. Since
+ a word on this target holds two instructions we have to divide the
+ instruction size by two to get the word size of the dummy. */
+#undef DEPRECATED_CALL_DUMMY_LENGTH
+#define DEPRECATED_CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 26 / 2)
/* The PA64 ABI mandates a 16 byte stack alignment. */
#undef STACK_ALIGN
@@ -219,15 +537,15 @@ call_dummy
*/
#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
{ \
- if (TYPE_CODE (TYPE) == TYPE_CODE_FLT && !SOFT_FLOAT) \
+ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
memcpy ((VALBUF), \
((char *)(REGBUF)) + REGISTER_BYTE (FP4_REGNUM) + \
- (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
+ (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
TYPE_LENGTH (TYPE)); \
- else if (is_integral_type(TYPE) || SOFT_FLOAT) \
+ else if (is_integral_type(TYPE)) \
memcpy ((VALBUF), \
(char *)(REGBUF) + REGISTER_BYTE (28) + \
- (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
+ (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
TYPE_LENGTH (TYPE)); \
else if (TYPE_LENGTH (TYPE) <= 8) \
memcpy ((VALBUF), \
@@ -253,16 +571,16 @@ call_dummy
#undef DEPRECATED_STORE_RETURN_VALUE
#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
{ \
- if (TYPE_CODE (TYPE) == TYPE_CODE_FLT && !SOFT_FLOAT) \
+ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
deprecated_write_register_bytes \
(REGISTER_BYTE (FP4_REGNUM) + \
- (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
+ (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
(VALBUF), \
TYPE_LENGTH (TYPE)); \
- else if (is_integral_type(TYPE) || SOFT_FLOAT) \
+ else if (is_integral_type(TYPE)) \
deprecated_write_register_bytes \
(REGISTER_BYTE (28) + \
- (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
+ (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
(VALBUF), \
TYPE_LENGTH (TYPE)); \
else if (TYPE_LENGTH (TYPE) <= 8) \
diff --git a/gdb/config/s390/tm-s390.h b/gdb/config/s390/tm-s390.h
index 1c6e6787099..37bf770e94f 100644
--- a/gdb/config/s390/tm-s390.h
+++ b/gdb/config/s390/tm-s390.h
@@ -24,15 +24,15 @@
#define TM_S390_H 1
#define S390_NUM_GPRS (16)
-#define S390_GPR_SIZE REGISTER_SIZE
-#define S390_PSW_MASK_SIZE REGISTER_SIZE
-#define S390_PSW_ADDR_SIZE REGISTER_SIZE
+#define S390_GPR_SIZE DEPRECATED_REGISTER_SIZE
+#define S390_PSW_MASK_SIZE DEPRECATED_REGISTER_SIZE
+#define S390_PSW_ADDR_SIZE DEPRECATED_REGISTER_SIZE
#define S390_NUM_FPRS (16)
#define S390_FPR_SIZE (8)
#define S390_FPC_SIZE (4)
#define S390_FPC_PAD_SIZE (4) /* gcc insists on aligning the fpregs */
#define S390_NUM_CRS (16)
-#define S390_CR_SIZE REGISTER_SIZE
+#define S390_CR_SIZE DEPRECATED_REGISTER_SIZE
#define S390_NUM_ACRS (16)
#define S390_ACR_SIZE (4)
@@ -80,7 +80,7 @@ int s390_register_byte (int reg_nr);
#define PC_REGNUM S390_PC_REGNUM
#define NUM_REGS S390_NUM_REGS
#define NUM_FREGS S390_NUM_FPRS
-#define FP_REGNUM S390_FP_REGNUM
+#define DEPRECATED_FP_REGNUM S390_FP_REGNUM
#define SP_REGNUM S390_SP_REGNUM
/* Obviously ptrace for user program tracing cannot be allowed
mess with control registers (except per registers for hardware watchpoints),
@@ -94,7 +94,7 @@ int s390_cannot_fetch_register (int regno);
int s390x_register_raw_size (int reg_nr);
#define REGISTER_RAW_SIZE(reg_nr) s390x_register_raw_size(reg_nr)
#define GDB_TARGET_IS_ESAME (1)
-#define REGISTER_SIZE (8)
+#define DEPRECATED_REGISTER_SIZE (8)
#define REGISTER_BYTES S390X_REGISTER_BYTES
#else /* CONFIG_ARCH_S390X */
@@ -102,7 +102,7 @@ int s390x_register_raw_size (int reg_nr);
int s390_register_raw_size (int reg_nr);
#define REGISTER_RAW_SIZE(reg_nr) s390_register_raw_size(reg_nr)
#define GDB_TARGET_IS_ESAME (0)
-#define REGISTER_SIZE (4)
+#define DEPRECATED_REGISTER_SIZE (4)
#define REGISTER_BYTES S390_REGISTER_BYTES
#endif /* CONFIG_ARCH_S390X */
diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h
index 2d2193d207f..b371d1297b3 100644
--- a/gdb/config/sparc/tm-sp64.h
+++ b/gdb/config/sparc/tm-sp64.h
@@ -90,26 +90,26 @@ struct type;
#undef CALL_DUMMY
#define CALL_DUMMY {0}
-#undef CALL_DUMMY_LENGTH
-#define CALL_DUMMY_LENGTH 0
+#undef DEPRECATED_CALL_DUMMY_LENGTH
+#define DEPRECATED_CALL_DUMMY_LENGTH 0
#undef CALL_DUMMY_CALL_OFFSET
#define CALL_DUMMY_CALL_OFFSET 0
-#undef CALL_DUMMY_START_OFFSET
-#define CALL_DUMMY_START_OFFSET 0
-#undef CALL_DUMMY_BREAKPOINT_OFFSET
-#define CALL_DUMMY_BREAKPOINT_OFFSET 0
+#undef DEPRECATED_CALL_DUMMY_START_OFFSET
+#define DEPRECATED_CALL_DUMMY_START_OFFSET 0
+#undef DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET
+#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET 0
#undef CALL_DUMMY_LOCATION
#define CALL_DUMMY_LOCATION AT_ENTRY_POINT
#undef DEPRECATED_PC_IN_CALL_DUMMY
#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_at_entry_point (pc, sp, frame_address)
#undef DEPRECATED_CALL_DUMMY_STACK_ADJUST
#define DEPRECATED_CALL_DUMMY_STACK_ADJUST 128
-#undef SIZEOF_CALL_DUMMY_WORDS
-#define SIZEOF_CALL_DUMMY_WORDS 0
+#undef DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
+#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS 0
#undef CALL_DUMMY_ADDRESS
#define CALL_DUMMY_ADDRESS() entry_point_address()
-#undef FIX_CALL_DUMMY
-#define FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P)
+#undef DEPRECATED_FIX_CALL_DUMMY
+#define DEPRECATED_FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P)
#undef DEPRECATED_PUSH_RETURN_ADDRESS
#define DEPRECATED_PUSH_RETURN_ADDRESS(PC, SP) sparc_at_entry_push_return_address (PC, SP)
extern CORE_ADDR sparc_at_entry_push_return_address (CORE_ADDR pc,
@@ -147,20 +147,20 @@ extern void sparc_at_entry_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
#define DEPRECATED_CALL_DUMMY_STACK_ADJUST 128
/* Size of the call dummy in bytes. */
-#undef CALL_DUMMY_LENGTH
-#define CALL_DUMMY_LENGTH 192
+#undef DEPRECATED_CALL_DUMMY_LENGTH
+#define DEPRECATED_CALL_DUMMY_LENGTH 192
/* Offset within CALL_DUMMY of the 'call' instruction. */
-#undef CALL_DUMMY_START_OFFSET
-#define CALL_DUMMY_START_OFFSET 148
+#undef DEPRECATED_CALL_DUMMY_START_OFFSET
+#define DEPRECATED_CALL_DUMMY_START_OFFSET 148
/* Offset within CALL_DUMMY of the 'call' instruction. */
#undef CALL_DUMMY_CALL_OFFSET
-#define CALL_DUMMY_CALL_OFFSET (CALL_DUMMY_START_OFFSET + (5 * 4))
+#define CALL_DUMMY_CALL_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + (5 * 4))
/* Offset within CALL_DUMMY of the 'ta 1' instruction. */
-#undef CALL_DUMMY_BREAKPOINT_OFFSET
-#define CALL_DUMMY_BREAKPOINT_OFFSET (CALL_DUMMY_START_OFFSET + (8 * 4))
+#undef DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET
+#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + (8 * 4))
/* Call dummy will be located on the stack. */
#undef CALL_DUMMY_LOCATION
@@ -169,15 +169,15 @@ extern void sparc_at_entry_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address)
/* Insert the function address into the call dummy. */
-#undef FIX_CALL_DUMMY
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
+#undef DEPRECATED_FIX_CALL_DUMMY
+#define DEPRECATED_FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
sparc_fix_call_dummy (dummyname, pc, fun, type, gcc_p)
void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
struct type *value_type, int using_gcc);
/* The remainder of these will accept the default definition. */
-#undef SIZEOF_CALL_DUMMY_WORDS
+#undef DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
#undef DEPRECATED_PUSH_RETURN_ADDRESS
#undef CALL_DUMMY_ADDRESS
#undef STORE_STRUCT_RETURN
@@ -269,7 +269,7 @@ extern CORE_ADDR sparc64_read_fp ();
extern void sparc64_write_sp (CORE_ADDR);
#define TARGET_READ_SP() (sparc64_read_sp ())
-#define TARGET_READ_FP() (sparc64_read_fp ())
+#define DEPRECATED_TARGET_READ_FP() (sparc64_read_fp ())
#define DEPRECATED_DUMMY_WRITE_SP(X) (sparc64_write_sp (X))
#undef DEPRECATED_EXTRACT_RETURN_VALUE
@@ -297,7 +297,7 @@ extern void sp64_extract_return_value (struct type *, char[], char *, int);
#define L0_REGNUM 16 /* First local reg that's saved on stack frame
rather than in machine registers */
#define I0_REGNUM 24 /* %i0 */
-#define FP_REGNUM 30 /* Contains address of executing stack frame */
+#define DEPRECATED_FP_REGNUM 30 /* Contains address of executing stack frame */
#define I7_REGNUM 31 /* Last local reg saved on stack frame */
#define FP0_REGNUM 32 /* Floating point register 0 */
#endif
@@ -376,8 +376,8 @@ extern void sp64_extract_return_value (struct type *, char[], char *, int);
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
-#undef REGISTER_SIZE
-#define REGISTER_SIZE 8
+#undef DEPRECATED_REGISTER_SIZE
+#define DEPRECATED_REGISTER_SIZE 8
/* Number of bytes of storage in the actual machine representation
for register N. */
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index 414b69ec9ce..a44b04ed251 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -174,7 +174,7 @@ extern int sparc_intreg_size (void);
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
-#define REGISTER_SIZE 4
+#define DEPRECATED_REGISTER_SIZE 4
/* Number of machine registers */
@@ -182,7 +182,7 @@ extern int sparc_intreg_size (void);
#define SP_REGNUM 14 /* Contains address of top of stack, \
which is also the bottom of the frame. */
-#define FP_REGNUM 30 /* Contains address of executing stack frame */
+#define DEPRECATED_FP_REGNUM 30 /* Contains address of executing stack frame */
#define FP0_REGNUM 32 /* Floating point register 0 */
@@ -201,8 +201,9 @@ extern int sparc_intreg_size (void);
remove the ins and locals from `registers', make sure that
frame_register() can get them from the stack (even in the innermost
frame), and make this the way to access them. For the frame
- pointer we would do that via TARGET_READ_FP. On the other hand,
- that is likely to be confusing or worse for flat frames. */
+ pointer we would do that via DEPRECATED_TARGET_READ_FP. On the
+ other hand, that is likely to be confusing or worse for flat
+ frames. */
#define REGISTER_BYTES (32*4+32*4+8*4)
@@ -545,9 +546,9 @@ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev);
*
* call_function then writes CALL_DUMMY, pushes the args onto the
* stack, and adjusts the stack pointer.
- *
- * run_stack_dummy then starts execution (in the middle of
- * CALL_DUMMY, as directed by call_function). */
+
+ call_function_by_hand then starts execution (in the middle of
+ CALL_DUMMY, as directed by call_function). */
#ifndef CALL_DUMMY
/* This sequence of words is the instructions
@@ -588,19 +589,19 @@ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev);
/* Size of the call dummy in bytes. */
-#define CALL_DUMMY_LENGTH 0x38
+#define DEPRECATED_CALL_DUMMY_LENGTH 0x38
/* Offset within call dummy of first instruction to execute. */
-#define CALL_DUMMY_START_OFFSET 0
+#define DEPRECATED_CALL_DUMMY_START_OFFSET 0
/* Offset within CALL_DUMMY of the 'call' instruction. */
-#define CALL_DUMMY_CALL_OFFSET (CALL_DUMMY_START_OFFSET + 0x24)
+#define CALL_DUMMY_CALL_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + 0x24)
/* Offset within CALL_DUMMY of the 'ta 1' trap instruction. */
-#define CALL_DUMMY_BREAKPOINT_OFFSET (CALL_DUMMY_START_OFFSET + 0x30)
+#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + 0x30)
#define DEPRECATED_CALL_DUMMY_STACK_ADJUST 68
@@ -625,7 +626,7 @@ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev);
/* Insert the specified number of args and function address
into a call sequence of the above form stored at DUMMYNAME. */
-#define FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P) \
+#define DEPRECATED_FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P) \
sparc_fix_call_dummy (DUMMYNAME, PC, FUN, TYPE, GCC_P)
void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
struct type *value_type, int using_gcc);
diff --git a/gdb/config/tm-nto.h b/gdb/config/tm-nto.h
new file mode 100644
index 00000000000..359ff068b7a
--- /dev/null
+++ b/gdb/config/tm-nto.h
@@ -0,0 +1,61 @@
+/* Target machine sub-description for QNX Neutrino version 6.
+ This is included by other tm-*.h files to specify nto specific
+ stuff.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ This code was donated by QNX Software Systems Ltd.
+
+ 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_QNXNTO_H
+#define _TM_QNXNTO_H
+
+#include "tm-sysv4.h"
+
+/* Setup the valid realtime signal range. */
+#define REALTIME_LO 41
+#define REALTIME_HI 56
+
+/* Set up the undefined useable signals. */
+#define RAW_SIGNAL_LO 32
+#define RAW_SIGNAL_HI (REALTIME_LO - 1)
+
+#define TARGET_SIGNAL_RAW_VALUES \
+TARGET_SIGNAL_RAW0, \
+TARGET_SIGNAL_RAW1, \
+TARGET_SIGNAL_RAW2, \
+TARGET_SIGNAL_RAW3, \
+TARGET_SIGNAL_RAW4, \
+TARGET_SIGNAL_RAW5, \
+TARGET_SIGNAL_RAW6, \
+TARGET_SIGNAL_RAW7, \
+TARGET_SIGNAL_RAW8
+
+#define TARGET_SIGNAL_RAW_TABLE \
+{"SIGNAL32", "Signal 32"}, \
+{"SIGNAL33", "Signal 33"}, \
+{"SIGNAL34", "Signal 34"}, \
+{"SIGNAL35", "Signal 35"}, \
+{"SIGNAL36", "Signal 36"}, \
+{"SIGNAL37", "Signal 37"}, \
+{"SIGNAL38", "Signal 38"}, \
+{"SIGNAL39", "Signal 39"}, \
+{"SIGNAL40", "Signal 40"}
+
+#endif /* _TM_QNXNTO_H */
diff --git a/gdb/config/vax/nm-vax.h b/gdb/config/vax/nm-vax.h
index efebd6b8936..2518047290f 100644
--- a/gdb/config/vax/nm-vax.h
+++ b/gdb/config/vax/nm-vax.h
@@ -24,6 +24,6 @@
{ addr = blockend - 0110 + regno * 4; \
if (regno == PC_REGNUM) addr = blockend - 8; \
if (regno == PS_REGNUM) addr = blockend - 4; \
- if (regno == FP_REGNUM) addr = blockend - 0120; \
+ if (regno == DEPRECATED_FP_REGNUM) addr = blockend - 0120; \
if (regno == AP_REGNUM) addr = blockend - 0124; \
if (regno == SP_REGNUM) addr = blockend - 20; }
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index aeb9e2718e1..fe4cc5d4856 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -51,6 +51,7 @@ arm*-*-linux*) gdb_target=linux
;;
arm*-*-netbsd*) gdb_target=nbsd
gdb_multi_arch=yes ;;
+arm-*-nto*) gdb_target=nto ;;
arm*-*-* | thumb*-*-* | strongarm*-*-*)
gdb_target=embed
configdirs="$configdirs rdi-share"
@@ -90,6 +91,7 @@ i[3456]86-*-netbsd*) gdb_target=nbsd ;;
i[3456]86-*-openbsd*) gdb_target=obsd ;;
i[3456]86-*-go32*) gdb_target=i386aout ;;
i[3456]86-*-msdosdjgpp*) gdb_target=go32 ;;
+i[3456]86-*-nto*) gdb_target=nto ;;
i[3456]86-*-lynxos*) gdb_target=i386lynx ;;
i[3456]86-*-solaris*) gdb_target=i386sol2 ;;
i[3456]86-*-sco*) gdb_target=i386v ;;
@@ -216,6 +218,7 @@ sh-*-linux*) gdb_target=linux
build_gdbserver=yes
;;
sh*-*-netbsdelf*) gdb_target=nbsd ;;
+sh-*-nto*) gdb_target=nto ;;
sh*) gdb_target=embed ;;
sparc-*-aout*) gdb_target=sparc-em ;;
@@ -280,5 +283,6 @@ esac
case "${target}" in
*-*-linux*) gdb_osabi=GDB_OSABI_LINUX ;;
*-*-gnu*) gdb_osabi=GDB_OSABI_HURD ;;
+*-*-nto*) gdb_osabi=GDB_OSABI_QNXNTO ;;
*-*-solaris*) gdb_osabi=GDB_OSABI_SOLARIS ;;
esac
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 8a0073a83df..094a3eff0c1 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -238,28 +238,6 @@ read_memory (CORE_ADDR memaddr, char *myaddr, int len)
memory_error (status, memaddr);
}
-/* Like target_read_memory, but slightly different parameters. */
-int
-dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr, unsigned int len,
- disassemble_info *info)
-{
- return target_read_memory (memaddr, (char *) myaddr, len);
-}
-
-/* Like memory_error with slightly different parameters. */
-void
-dis_asm_memory_error (int status, bfd_vma memaddr, disassemble_info *info)
-{
- memory_error (status, memaddr);
-}
-
-/* Like print_address with slightly different parameters. */
-void
-dis_asm_print_address (bfd_vma addr, struct disassemble_info *info)
-{
- print_address (addr, info->stream);
-}
-
/* Argument / return result struct for use with
do_captured_read_memory_integer(). MEMADDR and LEN are filled in
by gdb_read_memory_integer(). RESULT is the contents that were
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index ca47854def2..14456f8938f 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -57,16 +57,7 @@ static void first_component_command (char *arg, int from_tty);
'foo' in an anonymous namespace gets demangled as "(anonymous
namespace)::foo".
- - And operator names can contain parentheses or angle brackets.
- Fortunately, I _think_ that operator names can only occur in a
- fairly restrictive set of locations (in particular, they have be
- at depth 0, don't they?). */
-
-/* NOTE: carlton/2003-02-21: Daniel Jacobowitz came up with an example
- where operator names don't occur at depth 0. Sigh. (It involved a
- template argument that was a pointer: I hadn't realized that was
- possible.) Handling such edge cases does not seem like a
- high-priority problem to me. */
+ - And operator names can contain parentheses or angle brackets. */
/* FIXME: carlton/2003-03-13: We have several functions here with
overlapping functionality; can we combine them? Also, do they
@@ -209,40 +200,14 @@ method_name_from_physname (const char *physname)
unsigned int
cp_find_first_component (const char *name)
{
- /* Names like 'operator<<' screw up the recursion, so let's
- special-case them. I _hope_ they can only occur at the start of
- a component. */
-
unsigned int index = 0;
-
- if (strncmp (name, "operator", LENGTH_OF_OPERATOR) == 0)
- {
- index += LENGTH_OF_OPERATOR;
- while (isspace(name[index]))
- ++index;
- switch (name[index])
- {
- case '<':
- if (name[index + 1] == '<')
- index += 2;
- else
- index += 1;
- break;
- case '>':
- case '-':
- if (name[index + 1] == '>')
- index += 2;
- else
- index += 1;
- break;
- case '(':
- index += 2;
- break;
- default:
- index += 1;
- break;
- }
- }
+ /* Operator names can show up in unexpected places. Since these can
+ contain parentheses or angle brackets, they can screw up the
+ recursion. But not every string 'operator' is part of an
+ operater name: e.g. you could have a variable 'cooperator'. So
+ this variable tells us whether or not we should treat the string
+ 'operator' as starting an operator. */
+ int operator_possible = 1;
for (;; ++index)
{
@@ -261,6 +226,7 @@ cp_find_first_component (const char *name)
gdb_assert (name[index] == ':');
index += 2;
}
+ operator_possible = 1;
break;
case '(':
/* Similar comment as to '<'. */
@@ -272,13 +238,63 @@ cp_find_first_component (const char *name)
gdb_assert (name[index] == ':');
index += 2;
}
+ operator_possible = 1;
break;
case '>':
case ')':
case '\0':
case ':':
return index;
+ case 'o':
+ /* Operator names can screw up the recursion. */
+ if (operator_possible
+ && strncmp (name + index, "operator", LENGTH_OF_OPERATOR) == 0)
+ {
+ index += LENGTH_OF_OPERATOR;
+ while (isspace(name[index]))
+ ++index;
+ switch (name[index])
+ {
+ /* Skip over one less than the appropriate number of
+ characters: the for loop will skip over the last
+ one. */
+ case '<':
+ if (name[index + 1] == '<')
+ index += 1;
+ else
+ index += 0;
+ break;
+ case '>':
+ case '-':
+ if (name[index + 1] == '>')
+ index += 1;
+ else
+ index += 0;
+ break;
+ case '(':
+ index += 1;
+ break;
+ default:
+ index += 0;
+ break;
+ }
+ }
+ operator_possible = 0;
+ break;
+ case ' ':
+ case ',':
+ case '.':
+ case '&':
+ case '*':
+ /* NOTE: carlton/2003-04-18: I'm not sure what the precise
+ set of relevant characters are here: it's necessary to
+ include any character that can show up before 'operator'
+ in a demangled name, and it's safe to include any
+ character that can't be part of an identifier's name. */
+ operator_possible = 1;
+ break;
default:
+ operator_possible = 0;
break;
}
}
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index f03cd14e269..ff2d6d22abf 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -53,7 +53,7 @@ enum cris_num_regs
};
/* Register numbers of various important registers.
- FP_REGNUM Contains address of executing stack frame.
+ DEPRECATED_FP_REGNUM Contains address of executing stack frame.
STR_REGNUM Contains the address of structure return values.
RET_REGNUM Contains the return value when shorter than or equal to 32 bits
ARG1_REGNUM Contains the first parameter to a function.
@@ -65,8 +65,8 @@ enum cris_num_regs
SRP_REGNUM Subroutine return pointer register.
BRP_REGNUM Breakpoint return pointer register. */
-/* FP_REGNUM = 8, SP_REGNUM = 14, and PC_REGNUM = 15 have been incorporated
- into the multi-arch framework. */
+/* DEPRECATED_FP_REGNUM = 8, SP_REGNUM = 14, and PC_REGNUM = 15 have
+ been incorporated into the multi-arch framework. */
enum cris_regnums
{
@@ -529,7 +529,7 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
}
get_frame_extra_info (fi)->leaf_function = 0;
}
- else if (regno == FP_REGNUM)
+ else if (regno == DEPRECATED_FP_REGNUM)
{
have_fp = 1;
}
@@ -616,7 +616,7 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
break;
}
}
- else if (cris_get_operand2 (insn) == FP_REGNUM
+ else if (cris_get_operand2 (insn) == DEPRECATED_FP_REGNUM
/* The size is a fixed-size. */
&& ((insn & 0x0F00) >> 8) == 0x0001
/* A negative offset. */
@@ -640,7 +640,7 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
break;
}
}
- else if (cris_get_operand2 (insn) == FP_REGNUM
+ else if (cris_get_operand2 (insn) == DEPRECATED_FP_REGNUM
/* The size is a fixed-size. */
&& ((insn & 0x0F00) >> 8) == 0x0001
/* A positive offset. */
@@ -681,7 +681,7 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
if (have_fp)
{
- get_frame_saved_regs (fi)[FP_REGNUM] = get_frame_base (fi);
+ get_frame_saved_regs (fi)[DEPRECATED_FP_REGNUM] = get_frame_base (fi);
/* Calculate the addresses. */
for (regno = regsave; regno >= 0; regno--)
@@ -971,7 +971,7 @@ cris_abi_original_store_return_value (struct type *type, char *valbuf)
{
int len = TYPE_LENGTH (type);
- if (len <= REGISTER_SIZE)
+ if (len <= DEPRECATED_REGISTER_SIZE)
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.");
@@ -984,7 +984,7 @@ cris_abi_v2_store_return_value (struct type *type, char *valbuf)
{
int len = TYPE_LENGTH (type);
- if (len <= 2 * REGISTER_SIZE)
+ if (len <= 2 * DEPRECATED_REGISTER_SIZE)
{
/* Note that this works since R10 and R11 are consecutive registers. */
deprecated_write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf,
@@ -1057,7 +1057,7 @@ cris_abi_original_extract_return_value (struct type *type, char *regbuf,
{
int len = TYPE_LENGTH (type);
- if (len <= REGISTER_SIZE)
+ if (len <= DEPRECATED_REGISTER_SIZE)
memcpy (valbuf, regbuf + REGISTER_BYTE (RET_REGNUM), len);
else
internal_error (__FILE__, __LINE__, "cris_abi_original_extract_return_value: type length too large");
@@ -1071,7 +1071,7 @@ cris_abi_v2_extract_return_value (struct type *type, char *regbuf,
{
int len = TYPE_LENGTH (type);
- if (len <= 2 * REGISTER_SIZE)
+ if (len <= 2 * DEPRECATED_REGISTER_SIZE)
memcpy (valbuf, regbuf + REGISTER_BYTE (RET_REGNUM), len);
else
internal_error (__FILE__, __LINE__, "cris_abi_v2_extract_return_value: type length too large");
@@ -1216,8 +1216,8 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi)
get_frame_base (fi),
get_frame_base (fi)))
{
- /* We need to setup fi->frame here because run_stack_dummy gets it wrong
- by assuming it's always FP. */
+ /* We need to setup fi->frame here because call_function_by_hand
+ gets it wrong by assuming it's always FP. */
deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM));
get_frame_extra_info (fi)->return_pc =
deprecated_read_register_dummy (get_frame_pc (fi),
@@ -1311,13 +1311,13 @@ cris_abi_original_push_arguments (int nargs, struct value **args,
/* Make sure there's space on the stack. Allocate space for data and a
parameter to refer to that data. */
for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
- stack_alloc += (TYPE_LENGTH (VALUE_TYPE (args[argnum])) + REGISTER_SIZE);
+ stack_alloc += (TYPE_LENGTH (VALUE_TYPE (args[argnum])) + DEPRECATED_REGISTER_SIZE);
sp -= stack_alloc;
/* We may over-allocate a little here, but that won't hurt anything. */
/* Initialize stack frame pointers. */
fp_params = sp;
- fp_data = sp + (nargs * REGISTER_SIZE);
+ fp_data = sp + (nargs * DEPRECATED_REGISTER_SIZE);
/* Now load as many as possible of the first arguments into
registers, and push the rest onto the stack. */
@@ -1330,14 +1330,14 @@ cris_abi_original_push_arguments (int nargs, struct value **args,
len = TYPE_LENGTH (type);
val = (char *) VALUE_CONTENTS (args[argnum]);
- if (len <= REGISTER_SIZE && argreg <= ARG4_REGNUM)
+ if (len <= DEPRECATED_REGISTER_SIZE && argreg <= ARG4_REGNUM)
{
/* Data fits in a register; put it in the first available
register. */
write_register (argreg, *(unsigned long *) val);
argreg++;
}
- else if (len > REGISTER_SIZE && argreg <= ARG4_REGNUM)
+ else if (len > DEPRECATED_REGISTER_SIZE && argreg <= ARG4_REGNUM)
{
/* Data does not fit in register; pass it on the stack and
put its address in the first available register. */
@@ -1346,21 +1346,21 @@ cris_abi_original_push_arguments (int nargs, struct value **args,
fp_data += len;
argreg++;
}
- else if (len > REGISTER_SIZE)
+ else if (len > DEPRECATED_REGISTER_SIZE)
{
/* Data does not fit in register; put both data and
parameter on the stack. */
write_memory (fp_data, val, len);
- write_memory (fp_params, (char *) (&fp_data), REGISTER_SIZE);
+ write_memory (fp_params, (char *) (&fp_data), DEPRECATED_REGISTER_SIZE);
fp_data += len;
- fp_params += REGISTER_SIZE;
+ fp_params += DEPRECATED_REGISTER_SIZE;
}
else
{
/* Data fits in a register, but we are out of registers;
put the parameter on the stack. */
- write_memory (fp_params, val, REGISTER_SIZE);
- fp_params += REGISTER_SIZE;
+ write_memory (fp_params, val, DEPRECATED_REGISTER_SIZE);
+ fp_params += DEPRECATED_REGISTER_SIZE;
}
}
@@ -1401,20 +1401,21 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int reg_demand;
len = TYPE_LENGTH (VALUE_TYPE (args[argnum]));
- reg_demand = (len / REGISTER_SIZE) + (len % REGISTER_SIZE != 0 ? 1 : 0);
+ reg_demand = (len / DEPRECATED_REGISTER_SIZE) + (len % DEPRECATED_REGISTER_SIZE != 0 ? 1 : 0);
- /* reg_demand * REGISTER_SIZE is the amount of memory we might need to
- allocate for this argument. 2 * REGISTER_SIZE is the amount of stack
- space we might need to pass the argument itself (either by value or by
+ /* reg_demand * DEPRECATED_REGISTER_SIZE is the amount of memory
+ we might need to allocate for this argument. 2 *
+ DEPRECATED_REGISTER_SIZE is the amount of stack space we
+ might need to pass the argument itself (either by value or by
reference). */
- stack_alloc += (reg_demand * REGISTER_SIZE + 2 * REGISTER_SIZE);
+ stack_alloc += (reg_demand * DEPRECATED_REGISTER_SIZE + 2 * DEPRECATED_REGISTER_SIZE);
}
sp -= stack_alloc;
/* We may over-allocate a little here, but that won't hurt anything. */
/* Initialize frame pointers. */
fp_arg = sp;
- fp_mem = sp + (nargs * (2 * REGISTER_SIZE));
+ fp_mem = sp + (nargs * (2 * DEPRECATED_REGISTER_SIZE));
/* Now load as many as possible of the first arguments into registers,
and push the rest onto the stack. */
@@ -1432,9 +1433,9 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
val = (char *) VALUE_CONTENTS (args[argnum]);
/* How may registers worth of storage do we need for this argument? */
- reg_demand = (len / REGISTER_SIZE) + (len % REGISTER_SIZE != 0 ? 1 : 0);
+ reg_demand = (len / DEPRECATED_REGISTER_SIZE) + (len % DEPRECATED_REGISTER_SIZE != 0 ? 1 : 0);
- if (len <= (2 * REGISTER_SIZE)
+ if (len <= (2 * DEPRECATED_REGISTER_SIZE)
&& (argreg + reg_demand - 1 <= ARG4_REGNUM))
{
/* Data passed by value. Fits in available register(s). */
@@ -1442,10 +1443,10 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
{
write_register (argreg, *(unsigned long *) val);
argreg++;
- val += REGISTER_SIZE;
+ val += DEPRECATED_REGISTER_SIZE;
}
}
- else if (len <= (2 * REGISTER_SIZE) && argreg <= ARG4_REGNUM)
+ else if (len <= (2 * DEPRECATED_REGISTER_SIZE) && argreg <= ARG4_REGNUM)
{
/* Data passed by value. Does not fit in available register(s).
Use the register(s) first, then the stack. */
@@ -1455,28 +1456,29 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
{
write_register (argreg, *(unsigned long *) val);
argreg++;
- val += REGISTER_SIZE;
+ val += DEPRECATED_REGISTER_SIZE;
}
else
{
- /* I guess this memory write could write the remaining data
- all at once instead of in REGISTER_SIZE chunks. */
- write_memory (fp_arg, val, REGISTER_SIZE);
- fp_arg += REGISTER_SIZE;
- val += REGISTER_SIZE;
+ /* I guess this memory write could write the
+ remaining data all at once instead of in
+ DEPRECATED_REGISTER_SIZE chunks. */
+ write_memory (fp_arg, val, DEPRECATED_REGISTER_SIZE);
+ fp_arg += DEPRECATED_REGISTER_SIZE;
+ val += DEPRECATED_REGISTER_SIZE;
}
}
}
- else if (len > (2 * REGISTER_SIZE))
+ else if (len > (2 * DEPRECATED_REGISTER_SIZE))
{
/* Data passed by reference. Put it on the stack. */
write_memory (fp_mem, val, len);
- write_memory (fp_arg, (char *) (&fp_mem), REGISTER_SIZE);
+ write_memory (fp_arg, (char *) (&fp_mem), DEPRECATED_REGISTER_SIZE);
/* fp_mem need not be word-aligned since it's just a chunk of
memory being pointed at. That is, += len would do. */
- fp_mem += reg_demand * REGISTER_SIZE;
- fp_arg += REGISTER_SIZE;
+ fp_mem += reg_demand * DEPRECATED_REGISTER_SIZE;
+ fp_arg += DEPRECATED_REGISTER_SIZE;
}
else
{
@@ -1486,7 +1488,7 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* fp_arg must be word-aligned (i.e., don't += len) to match
the function prologue. */
- fp_arg += reg_demand * REGISTER_SIZE;
+ fp_arg += reg_demand * DEPRECATED_REGISTER_SIZE;
}
}
@@ -1536,7 +1538,7 @@ cris_pop_frame (void)
/* Restore general registers R0 - R7. They were pushed on the stack
after SP was saved. */
- for (regno = 0; regno < FP_REGNUM; regno++)
+ for (regno = 0; regno < DEPRECATED_FP_REGNUM; regno++)
{
if (get_frame_saved_regs (fi)[regno])
{
@@ -1545,12 +1547,12 @@ cris_pop_frame (void)
}
}
- if (get_frame_saved_regs (fi)[FP_REGNUM])
+ if (get_frame_saved_regs (fi)[DEPRECATED_FP_REGNUM])
{
/* Pop the frame pointer (R8). It was pushed before SP
was saved. */
- write_register (FP_REGNUM,
- read_memory_integer (get_frame_saved_regs (fi)[FP_REGNUM], 4));
+ write_register (DEPRECATED_FP_REGNUM,
+ read_memory_integer (get_frame_saved_regs (fi)[DEPRECATED_FP_REGNUM], 4));
stack_offset += 4;
/* Not a leaf function. */
@@ -1561,7 +1563,7 @@ cris_pop_frame (void)
}
/* Restore the SP and adjust for R8 and (possibly) SRP. */
- write_register (SP_REGNUM, get_frame_saved_regs (fi)[FP_REGNUM] + stack_offset);
+ write_register (SP_REGNUM, get_frame_saved_regs (fi)[DEPRECATED_FP_REGNUM] + stack_offset);
}
else
{
@@ -3548,7 +3550,7 @@ static void cris_gdb_func (enum cris_op_type op_type, unsigned short inst,
static int
cris_delayed_get_disassembler (bfd_vma addr, disassemble_info *info)
{
- tm_print_insn = cris_get_disassembler (exec_bfd);
+ deprecated_tm_print_insn = cris_get_disassembler (exec_bfd);
return TARGET_PRINT_INSN (addr, info);
}
@@ -3861,7 +3863,7 @@ _initialize_cris_tdep (void)
gdbarch_register (bfd_arch_cris, cris_gdbarch_init, cris_dump_tdep);
/* Used in disassembly. */
- tm_print_insn = cris_delayed_get_disassembler;
+ deprecated_tm_print_insn = cris_delayed_get_disassembler;
/* CRIS-specific user-commands. */
c = add_set_cmd ("cris-version", class_support, var_integer,
@@ -4182,14 +4184,14 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* There are 32 registers (some of which may not be implemented). */
set_gdbarch_num_regs (gdbarch, 32);
set_gdbarch_sp_regnum (gdbarch, 14);
- set_gdbarch_fp_regnum (gdbarch, 8);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, 8);
set_gdbarch_pc_regnum (gdbarch, 15);
set_gdbarch_register_name (gdbarch, cris_register_name);
/* Length of ordinary registers used in push_word and a few other places.
REGISTER_RAW_SIZE is the real way to know how big a register is. */
- set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_deprecated_register_size (gdbarch, 4);
/* NEW */
set_gdbarch_register_bytes_ok (gdbarch, cris_register_bytes_ok);
@@ -4260,8 +4262,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Defined to 1 to indicate that the target supports inferior function
calls. */
- set_gdbarch_call_dummy_words (gdbarch, 0);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, 0);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index 45ac6820a1a..c184b4457e7 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -43,6 +43,7 @@
#include "floatformat.h"
#include "gdb/sim-d10v.h"
#include "sim-regno.h"
+#include "disasm.h"
#include "gdb_assert.h"
@@ -50,8 +51,8 @@ struct gdbarch_tdep
{
int a0_regnum;
int nr_dmap_regs;
- unsigned long (*dmap_register) (int nr);
- unsigned long (*imap_register) (int nr);
+ unsigned long (*dmap_register) (void *regcache, int nr);
+ unsigned long (*imap_register) (void *regcache, int nr);
};
/* These are the addresses the D10V-EVA board maps data and
@@ -71,9 +72,9 @@ enum
R3_REGNUM = 3,
D10V_FP_REGNUM = 11,
LR_REGNUM = 13,
- _SP_REGNUM = 15,
+ D10V_SP_REGNUM = 15,
PSW_REGNUM = 16,
- _PC_REGNUM = 18,
+ D10V_PC_REGNUM = 18,
NR_IMAP_REGS = 2,
NR_A_REGS = 2,
TS2_NUM_REGS = 37,
@@ -84,8 +85,17 @@ enum
RET1_REGNUM = R0_REGNUM,
};
-#define NR_DMAP_REGS (gdbarch_tdep (current_gdbarch)->nr_dmap_regs)
-#define A0_REGNUM (gdbarch_tdep (current_gdbarch)->a0_regnum)
+int
+nr_dmap_regs (struct gdbarch *gdbarch)
+{
+ return gdbarch_tdep (gdbarch)->nr_dmap_regs;
+}
+
+int
+a0_regnum (struct gdbarch *gdbarch)
+{
+ return gdbarch_tdep (gdbarch)->a0_regnum;
+}
/* Local functions */
@@ -93,16 +103,16 @@ extern void _initialize_d10v_tdep (void);
static CORE_ADDR d10v_read_sp (void);
-static CORE_ADDR d10v_read_fp (void);
-
static void d10v_eva_prepare_to_trace (void);
static void d10v_eva_get_trace_data (void);
static CORE_ADDR
-d10v_stack_align (CORE_ADDR len)
+d10v_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
{
- return (len + 1) & ~1;
+ /* Align to the size of an instruction (so that they can safely be
+ pushed onto the stack. */
+ return sp & ~3;
}
/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
@@ -226,7 +236,7 @@ d10v_ts3_register_name (int reg_nr)
one of the segments. */
static unsigned long
-d10v_ts2_dmap_register (int reg_nr)
+d10v_ts2_dmap_register (void *regcache, int reg_nr)
{
switch (reg_nr)
{
@@ -234,40 +244,38 @@ d10v_ts2_dmap_register (int reg_nr)
case 1:
return 0x2000;
case 2:
- return read_register (TS2_DMAP_REGNUM);
+ {
+ ULONGEST reg;
+ regcache_cooked_read_unsigned (regcache, TS2_DMAP_REGNUM, &reg);
+ return reg;
+ }
default:
return 0;
}
}
static unsigned long
-d10v_ts3_dmap_register (int reg_nr)
-{
- return read_register (TS3_DMAP0_REGNUM + reg_nr);
-}
-
-static unsigned long
-d10v_dmap_register (int reg_nr)
+d10v_ts3_dmap_register (void *regcache, int reg_nr)
{
- return gdbarch_tdep (current_gdbarch)->dmap_register (reg_nr);
+ ULONGEST reg;
+ regcache_cooked_read_unsigned (regcache, TS3_DMAP0_REGNUM + reg_nr, &reg);
+ return reg;
}
static unsigned long
-d10v_ts2_imap_register (int reg_nr)
+d10v_ts2_imap_register (void *regcache, int reg_nr)
{
- return read_register (TS2_IMAP0_REGNUM + reg_nr);
+ ULONGEST reg;
+ regcache_cooked_read_unsigned (regcache, TS2_IMAP0_REGNUM + reg_nr, &reg);
+ return reg;
}
static unsigned long
-d10v_ts3_imap_register (int reg_nr)
+d10v_ts3_imap_register (void *regcache, int reg_nr)
{
- return read_register (TS3_IMAP0_REGNUM + reg_nr);
-}
-
-static unsigned long
-d10v_imap_register (int reg_nr)
-{
- return gdbarch_tdep (current_gdbarch)->imap_register (reg_nr);
+ ULONGEST reg;
+ regcache_cooked_read_unsigned (regcache, TS3_IMAP0_REGNUM + reg_nr, &reg);
+ return reg;
}
/* MAP GDB's internal register numbering (determined by the layout fo
@@ -307,49 +315,18 @@ d10v_ts3_register_sim_regno (int nr)
return nr;
}
-/* Index within `registers' of the first byte of the space for
- register REG_NR. */
-
-static int
-d10v_register_byte (int reg_nr)
-{
- if (reg_nr < A0_REGNUM)
- return (reg_nr * 2);
- else if (reg_nr < (A0_REGNUM + NR_A_REGS))
- return (A0_REGNUM * 2
- + (reg_nr - A0_REGNUM) * 8);
- else
- return (A0_REGNUM * 2
- + NR_A_REGS * 8
- + (reg_nr - A0_REGNUM - NR_A_REGS) * 2);
-}
-
-/* Number of bytes of storage in the actual machine representation for
- register REG_NR. */
-
-static int
-d10v_register_raw_size (int reg_nr)
-{
- if (reg_nr < A0_REGNUM)
- return 2;
- else if (reg_nr < (A0_REGNUM + NR_A_REGS))
- return 8;
- else
- return 2;
-}
-
/* Return the GDB type object for the "standard" data type
of data in register N. */
static struct type *
d10v_register_type (struct gdbarch *gdbarch, int reg_nr)
{
- if (reg_nr == PC_REGNUM)
+ if (reg_nr == D10V_PC_REGNUM)
return builtin_type_void_func_ptr;
- if (reg_nr == _SP_REGNUM || reg_nr == D10V_FP_REGNUM)
+ if (reg_nr == D10V_SP_REGNUM || reg_nr == D10V_FP_REGNUM)
return builtin_type_void_data_ptr;
- else if (reg_nr >= A0_REGNUM
- && reg_nr < (A0_REGNUM + NR_A_REGS))
+ else if (reg_nr >= a0_regnum (gdbarch)
+ && reg_nr < (a0_regnum (gdbarch) + NR_A_REGS))
return builtin_type_int64;
else
return builtin_type_int16;
@@ -415,8 +392,7 @@ d10v_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr)
static CORE_ADDR
d10v_pointer_to_address (struct type *type, const void *buf)
{
- CORE_ADDR addr = extract_address (buf, TYPE_LENGTH (type));
-
+ CORE_ADDR addr = extract_unsigned_integer (buf, TYPE_LENGTH (type));
/* Is it a code address? */
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC
|| TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD
@@ -702,7 +678,7 @@ d10v_frame_unwind_cache (struct frame_info *next_frame,
info = FRAME_OBSTACK_ZALLOC (struct d10v_unwind_cache);
(*this_prologue_cache) = info;
- info->saved_regs = frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS);
+ info->saved_regs = FRAME_OBSTACK_CALLOC (NUM_REGS, CORE_ADDR);
info->size = 0;
info->return_pc = 0;
@@ -773,20 +749,20 @@ d10v_frame_unwind_cache (struct frame_info *next_frame,
to before the first saved register giving the SP. */
prev_sp = this_base + info->size;
}
- else if (info->saved_regs[SP_REGNUM])
+ else if (info->saved_regs[D10V_SP_REGNUM])
{
/* The SP was saved (which is very unusual), the frame base is
just the PREV's frame's TOP-OF-STACK. */
- this_base = read_memory_unsigned_integer (info->saved_regs[SP_REGNUM],
+ this_base = read_memory_unsigned_integer (info->saved_regs[D10V_SP_REGNUM],
register_size (current_gdbarch,
- SP_REGNUM));
+ D10V_SP_REGNUM));
prev_sp = this_base;
}
else
{
/* Assume that the FP is this frame's SP but with that pushed
stack space added back. */
- frame_unwind_unsigned_register (next_frame, SP_REGNUM, &this_base);
+ frame_unwind_unsigned_register (next_frame, D10V_SP_REGNUM, &this_base);
prev_sp = this_base + info->size;
}
@@ -815,9 +791,9 @@ d10v_frame_unwind_cache (struct frame_info *next_frame,
info->return_pc = d10v_make_iaddr (return_pc);
}
- /* The SP_REGNUM is special. Instead of the address of the SP, the
+ /* The D10V_SP_REGNUM is special. Instead of the address of the SP, the
previous frame's SP value is saved. */
- info->saved_regs[SP_REGNUM] = info->prev_sp;
+ info->saved_regs[D10V_SP_REGNUM] = info->prev_sp;
return info;
}
@@ -826,6 +802,7 @@ static void
d10v_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
struct frame_info *frame, int regnum, int all)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (regnum >= 0)
{
default_print_registers_info (gdbarch, file, frame, regnum, all);
@@ -834,7 +811,7 @@ d10v_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
{
ULONGEST pc, psw, rpt_s, rpt_e, rpt_c;
- frame_read_unsigned_register (frame, PC_REGNUM, &pc);
+ frame_read_unsigned_register (frame, D10V_PC_REGNUM, &pc);
frame_read_unsigned_register (frame, PSW_REGNUM, &psw);
frame_read_unsigned_register (frame, frame_map_name_to_regnum ("rpt_s", -1), &rpt_s);
frame_read_unsigned_register (frame, frame_map_name_to_regnum ("rpt_e", -1), &rpt_e);
@@ -869,31 +846,34 @@ d10v_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
{
if (a > 0)
fprintf_filtered (file, " ");
- fprintf_filtered (file, "IMAP%d %04lx", a, d10v_imap_register (a));
+ fprintf_filtered (file, "IMAP%d %04lx", a,
+ tdep->imap_register (current_regcache, a));
}
- if (NR_DMAP_REGS == 1)
+ if (nr_dmap_regs (gdbarch) == 1)
/* Registers DMAP0 and DMAP1 are constant. Just return dmap2. */
- fprintf_filtered (file, " DMAP %04lx\n", d10v_dmap_register (2));
+ fprintf_filtered (file, " DMAP %04lx\n",
+ tdep->dmap_register (current_regcache, 2));
else
{
- for (a = 0; a < NR_DMAP_REGS; a++)
+ for (a = 0; a < nr_dmap_regs (gdbarch); a++)
{
- fprintf_filtered (file, " DMAP%d %04lx", a, d10v_dmap_register (a));
+ fprintf_filtered (file, " DMAP%d %04lx", a,
+ tdep->dmap_register (current_regcache, a));
}
fprintf_filtered (file, "\n");
}
}
{
- char *num = alloca (max_register_size (gdbarch));
+ char num[MAX_REGISTER_SIZE];
int a;
fprintf_filtered (file, "A0-A%d", NR_A_REGS - 1);
- for (a = A0_REGNUM; a < A0_REGNUM + NR_A_REGS; a++)
+ for (a = a0_regnum (gdbarch); a < a0_regnum (gdbarch) + NR_A_REGS; a++)
{
int i;
fprintf_filtered (file, " ");
- frame_register_read (frame, a, num);
- for (i = 0; i < max_register_size (current_gdbarch); i++)
+ frame_read_register (frame, a, num);
+ for (i = 0; i < register_size (current_gdbarch, a); i++)
{
fprintf_filtered (file, "%02x", (num[i] & 0xff));
}
@@ -918,7 +898,7 @@ d10v_read_pc (ptid_t ptid)
save_ptid = inferior_ptid;
inferior_ptid = ptid;
- pc = (int) read_register (PC_REGNUM);
+ pc = (int) read_register (D10V_PC_REGNUM);
inferior_ptid = save_ptid;
retval = d10v_make_iaddr (pc);
return retval;
@@ -931,20 +911,14 @@ d10v_write_pc (CORE_ADDR val, ptid_t ptid)
save_ptid = inferior_ptid;
inferior_ptid = ptid;
- write_register (PC_REGNUM, d10v_convert_iaddr_to_raw (val));
+ write_register (D10V_PC_REGNUM, d10v_convert_iaddr_to_raw (val));
inferior_ptid = save_ptid;
}
static CORE_ADDR
d10v_read_sp (void)
{
- return (d10v_make_daddr (read_register (SP_REGNUM)));
-}
-
-static CORE_ADDR
-d10v_read_fp (void)
-{
- return (d10v_make_daddr (read_register (D10V_FP_REGNUM)));
+ return (d10v_make_daddr (read_register (D10V_SP_REGNUM)));
}
/* When arguments must be pushed onto the stack, they go on in reverse
@@ -984,6 +958,25 @@ pop_stack_item (struct stack_item *si)
static CORE_ADDR
+d10v_push_dummy_code (struct gdbarch *gdbarch,
+ CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc,
+ struct value **args, int nargs,
+ struct type *value_type,
+ CORE_ADDR *real_pc, CORE_ADDR *bp_addr)
+{
+ /* Allocate space sufficient for a breakpoint. */
+ sp = (sp - 4) & ~3;
+ /* Store the address of that breakpoint taking care to first convert
+ it into a code (IADDR) address from a stack (DADDR) address.
+ This of course assumes that the two virtual addresses map onto
+ the same real address. */
+ (*bp_addr) = d10v_make_iaddr (d10v_convert_iaddr_to_raw (sp));
+ /* d10v always starts the call at the callee's entry point. */
+ (*real_pc) = funaddr;
+ return sp;
+}
+
+static CORE_ADDR
d10v_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
CORE_ADDR dummy_addr, int nargs, struct value **args,
CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
@@ -1056,7 +1049,7 @@ d10v_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
}
/* Finally, update the SP register. */
- regcache_cooked_write_unsigned (regcache, SP_REGNUM,
+ regcache_cooked_write_unsigned (regcache, D10V_SP_REGNUM,
d10v_convert_daddr_to_raw (sp));
return sp;
@@ -1071,12 +1064,6 @@ d10v_extract_return_value (struct type *type, struct regcache *regcache,
void *valbuf)
{
int len;
-#if 0
- printf("RET: TYPE=%d len=%d r%d=0x%x\n", TYPE_CODE (type),
- TYPE_LENGTH (type), RET1_REGNUM - R0_REGNUM,
- (int) extract_unsigned_integer (regbuf + REGISTER_BYTE(RET1_REGNUM),
- register_size (current_gdbarch, RET1_REGNUM)));
-#endif
if (TYPE_LENGTH (type) == 1)
{
ULONGEST c;
@@ -1115,15 +1102,16 @@ d10v_extract_return_value (struct type *type, struct regcache *regcache,
VM system works, we just call that to do the translation. */
static void
-remote_d10v_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes,
+remote_d10v_translate_xfer_address (struct gdbarch *gdbarch,
+ struct regcache *regcache,
+ CORE_ADDR memaddr, int nr_bytes,
CORE_ADDR *targ_addr, int *targ_len)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
long out_addr;
long out_len;
- out_len = sim_d10v_translate_addr (memaddr, nr_bytes,
- &out_addr,
- d10v_dmap_register,
- d10v_imap_register);
+ out_len = sim_d10v_translate_addr (memaddr, nr_bytes, &out_addr, regcache,
+ tdep->dmap_register, tdep->imap_register);
*targ_addr = out_addr;
*targ_len = out_len;
}
@@ -1195,9 +1183,9 @@ trace_command (char *args, int from_tty)
/* Clear the host-side trace buffer, allocating space if needed. */
trace_data.size = 0;
if (trace_data.counts == NULL)
- trace_data.counts = (short *) xmalloc (65536 * sizeof (short));
+ trace_data.counts = XCALLOC (65536, short);
if (trace_data.addrs == NULL)
- trace_data.addrs = (CORE_ADDR *) xmalloc (65536 * sizeof (CORE_ADDR));
+ trace_data.addrs = XCALLOC (65536, CORE_ADDR);
tracing = 1;
@@ -1236,31 +1224,13 @@ trace_info (char *args, int from_tty)
printf_filtered ("Tracing is currently %s.\n", (tracing ? "on" : "off"));
}
-/* Print the instruction at address MEMADDR in debugged memory,
- on STREAM. Returns length of the instruction, in bytes. */
-
-static int
-print_insn (CORE_ADDR memaddr, struct ui_file *stream)
-{
- /* If there's no disassembler, something is very wrong. */
- if (tm_print_insn == NULL)
- internal_error (__FILE__, __LINE__,
- "print_insn: no disassembler");
-
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- tm_print_insn_info.endian = BFD_ENDIAN_BIG;
- else
- tm_print_insn_info.endian = BFD_ENDIAN_LITTLE;
- return TARGET_PRINT_INSN (memaddr, &tm_print_insn_info);
-}
-
static void
d10v_eva_prepare_to_trace (void)
{
if (!tracing)
return;
- last_pc = read_register (PC_REGNUM);
+ last_pc = read_register (D10V_PC_REGNUM);
}
/* Collect trace data from the target board and format it into a form
@@ -1414,7 +1384,7 @@ display_trace (int low, int high)
printf_filtered (":");
printf_filtered ("\t");
wrap_here (" ");
- next_address = next_address + print_insn (next_address, gdb_stdout);
+ next_address += gdb_print_insn (next_address, gdb_stdout);
printf_filtered ("\n");
gdb_flush (gdb_stdout);
}
@@ -1425,7 +1395,7 @@ static CORE_ADDR
d10v_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
ULONGEST pc;
- frame_unwind_unsigned_register (next_frame, PC_REGNUM, &pc);
+ frame_unwind_unsigned_register (next_frame, D10V_PC_REGNUM, &pc);
return d10v_make_iaddr (pc);
}
@@ -1481,7 +1451,7 @@ saved_regs_unwinder (struct frame_info *next_frame,
{
if (this_saved_regs[regnum] != 0)
{
- if (regnum == SP_REGNUM)
+ if (regnum == D10V_SP_REGNUM)
{
/* SP register treated specially. */
*optimizedp = 0;
@@ -1489,8 +1459,9 @@ saved_regs_unwinder (struct frame_info *next_frame,
*addrp = 0;
*realnump = -1;
if (bufferp != NULL)
- store_address (bufferp, register_size (current_gdbarch, regnum),
- this_saved_regs[regnum]);
+ store_unsigned_integer (bufferp,
+ register_size (current_gdbarch, regnum),
+ this_saved_regs[regnum]);
}
else
{
@@ -1528,7 +1499,7 @@ d10v_frame_prev_register (struct frame_info *next_frame,
{
struct d10v_unwind_cache *info
= d10v_frame_unwind_cache (next_frame, this_prologue_cache);
- if (regnum == PC_REGNUM)
+ if (regnum == D10V_PC_REGNUM)
{
/* The call instruction saves the caller's PC in LR. The
function prologue of the callee may then save the LR on the
@@ -1579,7 +1550,7 @@ static struct frame_id
d10v_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
ULONGEST base;
- frame_unwind_unsigned_register (next_frame, SP_REGNUM, &base);
+ frame_unwind_unsigned_register (next_frame, D10V_SP_REGNUM, &base);
return frame_id_build (d10v_make_daddr (base), frame_pc_unwind (next_frame));
}
@@ -1629,18 +1600,11 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_read_pc (gdbarch, d10v_read_pc);
set_gdbarch_write_pc (gdbarch, d10v_write_pc);
- set_gdbarch_read_fp (gdbarch, d10v_read_fp);
set_gdbarch_read_sp (gdbarch, d10v_read_sp);
set_gdbarch_num_regs (gdbarch, d10v_num_regs);
- set_gdbarch_sp_regnum (gdbarch, 15);
- set_gdbarch_pc_regnum (gdbarch, 18);
+ set_gdbarch_sp_regnum (gdbarch, D10V_SP_REGNUM);
set_gdbarch_register_name (gdbarch, d10v_register_name);
- set_gdbarch_register_size (gdbarch, 2);
- set_gdbarch_register_bytes (gdbarch, (d10v_num_regs - 2) * 2 + 16);
- set_gdbarch_register_byte (gdbarch, d10v_register_byte);
- set_gdbarch_register_raw_size (gdbarch, d10v_register_raw_size);
- set_gdbarch_register_virtual_size (gdbarch, generic_register_size);
set_gdbarch_register_type (gdbarch, d10v_register_type);
set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT);
@@ -1675,6 +1639,7 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
}
set_gdbarch_extract_return_value (gdbarch, d10v_extract_return_value);
+ set_gdbarch_push_dummy_code (gdbarch, d10v_push_dummy_code);
set_gdbarch_push_dummy_call (gdbarch, d10v_push_dummy_call);
set_gdbarch_store_return_value (gdbarch, d10v_store_return_value);
set_gdbarch_extract_struct_value_address (gdbarch, d10v_extract_struct_value_address);
@@ -1692,7 +1657,7 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue);
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
- set_gdbarch_stack_align (gdbarch, d10v_stack_align);
+ set_gdbarch_frame_align (gdbarch, d10v_frame_align);
set_gdbarch_register_sim_regno (gdbarch, d10v_register_sim_regno);
@@ -1708,6 +1673,8 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Return the unwound PC value. */
set_gdbarch_unwind_pc (gdbarch, d10v_unwind_pc);
+ set_gdbarch_print_insn (gdbarch, print_insn_d10v);
+
return gdbarch;
}
@@ -1716,8 +1683,6 @@ _initialize_d10v_tdep (void)
{
register_gdbarch_init (bfd_arch_d10v, d10v_gdbarch_init);
- tm_print_insn = print_insn_d10v;
-
target_resume_hook = d10v_eva_prepare_to_trace;
target_wait_loop_hook = d10v_eva_get_trace_data;
@@ -1738,13 +1703,13 @@ as reported by info trace (NOT addresses!).");
add_info ("itrace", trace_info,
"Display info about the trace data buffer.");
- add_show_from_set (add_set_cmd ("itracedisplay", no_class,
- var_integer, (char *) &trace_display,
- "Set automatic display of trace.\n", &setlist),
- &showlist);
- add_show_from_set (add_set_cmd ("itracesource", no_class,
- var_integer, (char *) &default_trace_show_source,
- "Set display of source code with trace.\n", &setlist),
- &showlist);
-
+ add_setshow_boolean_cmd ("itracedisplay", no_class, &trace_display,
+ "Set automatic display of trace.\n",
+ "Show automatic display of trace.\n",
+ NULL, NULL, &setlist, &showlist);
+ add_setshow_boolean_cmd ("itracesource", no_class,
+ &default_trace_show_source,
+ "Set display of source code with trace.\n",
+ "Show display of source code with trace.\n",
+ NULL, NULL, &setlist, &showlist);
}
diff --git a/gdb/defs.h b/gdb/defs.h
index 35d23df9caa..d4427830639 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -211,7 +211,8 @@ enum language
language_m2, /* Modula-2 */
language_asm, /* Assembly language */
language_scm, /* Scheme / Guile */
- language_pascal /* Pascal */
+ language_pascal, /* Pascal */
+ language_minimal /* All other languages, minimal support only */
};
enum precision_type
@@ -1085,28 +1086,10 @@ extern void *alloca ();
#include "arch-utils.h"
#endif
-/* FIXME: cagney/2003-03-01: Hack to prop up old targets while they
- migrate to the overhauled register cache.
-
- The problem is that some architectures specify different sized raw
- and cooked (nee virtual) register sizes. They shouldn't. Instead,
- all architectures should just implement a gdbarch_register_type().
- That can be used to compute all needed register attributes. While
- waiting for the conversion, provide compatibility macros that keep
- old code working. */
-
-#ifdef MAX_REGISTER_RAW_SIZE
-#error MAX_REGISTER_RAW_SIZE defined
-#endif
-extern int legacy_max_register_raw_size (void);
-#define MAX_REGISTER_RAW_SIZE legacy_max_register_raw_size ()
-
-#ifdef MAX_REGISTER_VIRTUAL_SIZE
-#error MAX_REGISTER_VIRTUAL_SIZE defined
-#endif
-extern int legacy_max_register_virtual_size (void);
-#define MAX_REGISTER_VIRTUAL_SIZE legacy_max_register_virtual_size ()
+/* Maximum size of a register. Something small, but large enough for
+ all known ISAs. If it turns out to be too small, make it bigger. */
+enum { MAX_REGISTER_SIZE = 16 };
/* Static target-system-dependent parameters for GDB. */
diff --git a/gdb/disasm.c b/gdb/disasm.c
index 511855b5901..c8a2029bae8 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -24,8 +24,8 @@
#include "value.h"
#include "ui-out.h"
#include "gdb_string.h"
-
#include "disasm.h"
+#include "gdbcore.h"
/* Disassemble functions.
FIXME: We should get rid of all the duplicate code in gdb that does
@@ -43,27 +43,26 @@ struct dis_line_entry
CORE_ADDR end_pc;
};
-/* This variable determines where memory used for disassembly is read from. */
-int gdb_disassemble_from_exec = -1;
-
-/* This is the memory_read_func for gdb_disassemble when we are
- disassembling from the exec file. */
+/* Like target_read_memory, but slightly different parameters. */
static int
-gdb_dis_asm_read_memory (bfd_vma memaddr, bfd_byte * myaddr,
- unsigned int len, disassemble_info * info)
+dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr, unsigned int len,
+ disassemble_info *info)
+{
+ return target_read_memory (memaddr, (char *) myaddr, len);
+}
+
+/* Like memory_error with slightly different parameters. */
+static void
+dis_asm_memory_error (int status, bfd_vma memaddr, disassemble_info *info)
+{
+ memory_error (status, memaddr);
+}
+
+/* Like print_address with slightly different parameters. */
+static void
+dis_asm_print_address (bfd_vma addr, struct disassemble_info *info)
{
- extern struct target_ops exec_ops;
- int res;
-
- errno = 0;
- res = xfer_memory (memaddr, myaddr, len, 0, 0, &exec_ops);
-
- if (res == len)
- return 0;
- else if (errno == 0)
- return EIO;
- else
- return errno;
+ print_address (addr, info->stream);
}
static int
@@ -308,6 +307,32 @@ do_assembly_only (struct ui_out *uiout, disassemble_info * di,
do_cleanups (ui_out_chain);
}
+/* Initialize the disassemble info struct ready for the specified
+ stream. */
+
+static disassemble_info
+gdb_disassemble_info (struct gdbarch *gdbarch, struct ui_file *file)
+{
+ disassemble_info di;
+ INIT_DISASSEMBLE_INFO_NO_ARCH (di, file,
+ (fprintf_ftype) fprintf_unfiltered);
+ di.flavour = bfd_target_unknown_flavour;
+ di.memory_error_func = dis_asm_memory_error;
+ di.print_address_func = dis_asm_print_address;
+ /* NOTE: cagney/2003-04-28: The original code, from the old Insight
+ disassembler had a local optomization here. By default it would
+ access the executable file, instead of the target memory (there
+ was a growing list of exceptions though). Unfortunatly, the
+ heuristic was flawed. Commands like "disassemble &variable"
+ didn't work as they relied on the access going to the target.
+ Further, it has been supperseeded by trust-read-only-sections
+ (although that should be superseeded by target_trust..._p()). */
+ di.read_memory_func = dis_asm_read_memory;
+ di.mach = gdbarch_bfd_arch_info (gdbarch)->mach;
+ di.endian = gdbarch_byte_order (gdbarch);
+ return di;
+}
+
void
gdb_disassembly (struct ui_out *uiout,
char *file_string,
@@ -315,62 +340,14 @@ gdb_disassembly (struct ui_out *uiout,
int mixed_source_and_assembly,
int how_many, CORE_ADDR low, CORE_ADDR high)
{
- static disassemble_info di;
- static int di_initialized;
+ struct ui_stream *stb = ui_out_stream_new (uiout);
+ struct cleanup *cleanups = make_cleanup_ui_out_stream_delete (stb);
+ disassemble_info di = gdb_disassemble_info (current_gdbarch, stb->stream);
/* To collect the instruction outputted from opcodes. */
- static struct ui_stream *stb = NULL;
struct symtab *symtab = NULL;
struct linetable_entry *le = NULL;
int nlines = -1;
- if (!di_initialized)
- {
- /* We don't add a cleanup for this, because the allocation of
- the stream is done once only for each gdb run, and we need to
- keep it around until the end. Hopefully there won't be any
- errors in the init code below, that make this function bail
- out. */
- stb = ui_out_stream_new (uiout);
- INIT_DISASSEMBLE_INFO_NO_ARCH (di, stb->stream,
- (fprintf_ftype) fprintf_unfiltered);
- di.flavour = bfd_target_unknown_flavour;
- di.memory_error_func = dis_asm_memory_error;
- di.print_address_func = dis_asm_print_address;
- di_initialized = 1;
- }
-
- di.mach = gdbarch_bfd_arch_info (current_gdbarch)->mach;
- di.endian = gdbarch_byte_order (current_gdbarch);
-
- /* If gdb_disassemble_from_exec == -1, then we use the following heuristic to
- determine whether or not to do disassembly from target memory or from the
- exec file:
-
- If we're debugging a local process, read target memory, instead of the
- exec file. This makes disassembly of functions in shared libs work
- correctly. Also, read target memory if we are debugging native threads.
-
- Else, we're debugging a remote process, and should disassemble from the
- exec file for speed. However, this is no good if the target modifies its
- code (for relocation, or whatever). */
-
- if (gdb_disassemble_from_exec == -1)
- {
- if (strcmp (target_shortname, "child") == 0
- || strcmp (target_shortname, "procfs") == 0
- || strcmp (target_shortname, "vxprocess") == 0
- || strcmp (target_shortname, "core") == 0
- || strstr (target_shortname, "-thread") != NULL)
- gdb_disassemble_from_exec = 0; /* It's a child process, read inferior mem */
- else
- gdb_disassemble_from_exec = 1; /* It's remote, read the exec file */
- }
-
- if (gdb_disassemble_from_exec)
- di.read_memory_func = gdb_dis_asm_read_memory;
- else
- di.read_memory_func = dis_asm_read_memory;
-
/* Assume symtab is valid for whole PC range */
symtab = find_pc_symtab (low);
@@ -389,5 +366,35 @@ gdb_disassembly (struct ui_out *uiout,
do_mixed_source_and_assembly (uiout, &di, nlines, le, low,
high, symtab, how_many, stb);
+ do_cleanups (cleanups);
gdb_flush (gdb_stdout);
}
+
+/* Print the instruction at address MEMADDR in debugged memory,
+ on STREAM. Returns length of the instruction, in bytes. */
+
+int
+gdb_print_insn (CORE_ADDR memaddr, struct ui_file *stream)
+{
+ disassemble_info di = gdb_disassemble_info (current_gdbarch, stream);
+ return TARGET_PRINT_INSN (memaddr, &di);
+}
+
+
+/* FIXME: cagney/2003-04-28: This global deprecated_tm_print_insn_info
+ is going away. */
+disassemble_info deprecated_tm_print_insn_info;
+
+extern void _initialize_disasm (void);
+
+void
+_initialize_disasm (void)
+{
+
+ INIT_DISASSEMBLE_INFO_NO_ARCH (deprecated_tm_print_insn_info, gdb_stdout,
+ (fprintf_ftype)fprintf_filtered);
+ deprecated_tm_print_insn_info.flavour = bfd_target_unknown_flavour;
+ deprecated_tm_print_insn_info.read_memory_func = dis_asm_read_memory;
+ deprecated_tm_print_insn_info.memory_error_func = dis_asm_memory_error;
+ deprecated_tm_print_insn_info.print_address_func = dis_asm_print_address;
+}
diff --git a/gdb/disasm.h b/gdb/disasm.h
index 6a6df7e0b57..e4674d87d2d 100644
--- a/gdb/disasm.h
+++ b/gdb/disasm.h
@@ -28,4 +28,10 @@ extern void gdb_disassembly (struct ui_out *uiout,
int line_num,
int mixed_source_and_assembly,
int how_many, CORE_ADDR low, CORE_ADDR high);
+
+/* Print the instruction at address MEMADDR in debugged memory, on
+ STREAM. Returns length of the instruction, in bytes. */
+
+extern int gdb_print_insn (CORE_ADDR memaddr, struct ui_file *stream);
+
#endif
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 473eb155d0e..e5258378b61 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,59 @@
+2003-05-08 Jim Blandy <jimb@redhat.com>
+
+ * gdb.texinfo (Dump/Restore Files): Update documentation for
+ 'dump', 'append', and 'restore': note that format argument is
+ optional; simplify presentation of the command variants; and be
+ more precise about the formats.
+
+2003-05-07 Jim Blandy <jimb@redhat.com>
+
+ * gdb.texinfo (Symbols): Update documentation: 'maint list
+ symtabs' and 'maint list psymtabs' have been renamed 'maint info
+ symtabs' and 'maint info psymtabs'.
+
+2003-05-05 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Make
+ CALL_DUMMY_WORDS, SIZEOF_CALL_DUMMY_WORDS, CALL_DUMMY_LENGTH,
+ FIX_CALL_DUMMY, CALL_DUMMY_BREAKPOINT_OFFSET and
+ CALL_DUMMY_BREAKPOINT_OFFSET deprecated.
+
+2003-05-04 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.texinfo (Maintenance Commands): Document "maint print
+ dummy-frames".
+
+2003-05-04 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.texinfo (GDB/MI Symbol Query): Use @{ and @}.
+
+2003-05-03 J. Brobecker <brobecker@gnat.com>
+
+ Thierry Schneider <tpschneider1@yahoo.com>
+ * gdb.texinfo (section GDB/MI Symbol Query): Add documentation
+ for new MI command.
+
+2003-05-03 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Document
+ push_dummy_code. Add cross references.
+
+2003-05-02 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.texinfo (Character Sets): Update to reflect new behavior of
+ set/show charsets commands.
+
+2003-04-28 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Replace
+ read_fp, TARGET_READ_FP and FP_REGNUM, with deprecated_read_fp,
+ DEPRECATED_TARGET_READ_FP and DEPRECATED_REGNUM.
+
+2003-04-28 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Rename
+ "tm_print_insn" to "deprecated_tm_print_insn".
+
2003-04-09 Jim Blandy <jimb@redhat.com>
* gdb.texinfo (Symbols): Document 'maint list symtabs' and 'maint
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 00a4ac7f9fc..9136e653773 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -5861,62 +5861,53 @@ Disable @value{GDBN} from caching target memory. This is the default.
@cindex append data to a file
@cindex dump data to a file
@cindex restore data from a file
-@kindex dump
-@kindex append
-@kindex restore
-The commands @code{dump}, @code{append}, and @code{restore} are used
-for copying data between target memory and a file. Data is written
-into a file using @code{dump} or @code{append}, and restored from a
-file into memory by using @code{restore}. Files may be binary, srec,
-intel hex, or tekhex (but only binary files can be appended).
+You can use the commands @code{dump}, @code{append}, and
+@code{restore} to copy data between target memory and a file. The
+@code{dump} and @code{append} commands write data to a file, and the
+@code{restore} command reads data from a file back into the inferior's
+memory. Files may be in binary, Motorola S-record, Intel hex, or
+Tektronix Hex format; however, @value{GDBN} can only append to binary
+files.
@table @code
-@kindex dump binary
-@kindex append binary
-@item dump binary memory @var{filename} @var{start_addr} @var{end_addr}
-Dump contents of memory from @var{start_addr} to @var{end_addr} into
-raw binary format file @var{filename}.
-
-@item append binary memory @var{filename} @var{start_addr} @var{end_addr}
-Append contents of memory from @var{start_addr} to @var{end_addr} to
-raw binary format file @var{filename}.
-
-@item dump binary value @var{filename} @var{expression}
-Dump value of @var{expression} into raw binary format file @var{filename}.
-@item append binary memory @var{filename} @var{expression}
-Append value of @var{expression} to raw binary format file @var{filename}.
-
-@kindex dump ihex
-@item dump ihex memory @var{filename} @var{start_addr} @var{end_addr}
-Dump contents of memory from @var{start_addr} to @var{end_addr} into
-intel hex format file @var{filename}.
-
-@item dump ihex value @var{filename} @var{expression}
-Dump value of @var{expression} into intel hex format file @var{filename}.
-
-@kindex dump srec
-@item dump srec memory @var{filename} @var{start_addr} @var{end_addr}
-Dump contents of memory from @var{start_addr} to @var{end_addr} into
-srec format file @var{filename}.
+@kindex dump
+@item dump @r{[}@var{format}@r{]} memory @var{filename} @var{start_addr} @var{end_addr}
+@itemx dump @r{[}@var{format}@r{]} value @var{filename} @var{expr}
+Dump the contents of memory from @var{start_addr} to @var{end_addr},
+or the value of @var{expr}, to @var{filename} in the given format.
-@item dump srec value @var{filename} @var{expression}
-Dump value of @var{expression} into srec format file @var{filename}.
+The @var{format} parameter may be any one of:
+@table @code
+@item binary
+Raw binary form.
+@item ihex
+Intel hex format.
+@item srec
+Motorola S-record format.
+@item tekhex
+Tektronix Hex format.
+@end table
-@kindex dump tekhex
-@item dump tekhex memory @var{filename} @var{start_addr} @var{end_addr}
-Dump contents of memory from @var{start_addr} to @var{end_addr} into
-tekhex format file @var{filename}.
+@value{GDBN} uses the same definitions of these formats as the
+@sc{gnu} binary utilities, like @samp{objdump} and @samp{objcopy}. If
+@var{format} is omitted, @value{GDBN} dumps the data in raw binary
+form.
-@item dump tekhex value @var{filename} @var{expression}
-Dump value of @var{expression} into tekhex format file @var{filename}.
+@kindex append
+@item append @r{[}binary@r{]} memory @var{filename} @var{start_addr} @var{end_addr}
+@itemx append @r{[}binary@r{]} value @var{filename} @var{expr}
+Append the contents of memory from @var{start_addr} to @var{end_addr},
+or the value of @var{expr}, to @var{filename}, in raw binary form.
+(@value{GDBN} can only append data to files in raw binary form.)
-@item restore @var{filename} [@var{binary}] @var{bias} @var{start} @var{end}
-Restore the contents of file @var{filename} into memory. The @code{restore}
-command can automatically recognize any known bfd file format, except for
-raw binary. To restore a raw binary file you must use the optional argument
-@var{binary} after the filename.
+@kindex restore
+@item restore @var{filename} @r{[}binary@r{]} @var{bias} @var{start} @var{end}
+Restore the contents of file @var{filename} into memory. The
+@code{restore} command can automatically recognize any known @sc{bfd}
+file format, except for raw binary. To restore a raw binary file you
+must specify the optional keyword @code{binary} after the filename.
If @var{bias} is non-zero, its value will be added to the addresses
contained in the file. Binary files always start at address zero, so
@@ -5952,7 +5943,7 @@ remote protocol (@pxref{Remote,Remote Debugging}) to debug a program
running on an IBM mainframe, which uses the @sc{ebcdic} character set,
then the host character set is Latin-1, and the target character set is
@sc{ebcdic}. If you give @value{GDBN} the command @code{set
-target-charset ebcdic-us}, then @value{GDBN} translates between
+target-charset EBCDIC-US}, then @value{GDBN} translates between
@sc{ebcdic} and Latin 1 as you print character or string values, or use
character and string literals in expressions.
@@ -5967,9 +5958,9 @@ support:
@item set target-charset @var{charset}
@kindex set target-charset
Set the current target character set to @var{charset}. We list the
-character set names @value{GDBN} recognizes below, but if you invoke the
-@code{set target-charset} command with no argument, @value{GDBN} lists
-the character sets it supports.
+character set names @value{GDBN} recognizes below, but if you type
+@code{set target-charset} followed by @key{TAB}@key{TAB}, @value{GDBN} will
+list the target character sets it supports.
@end table
@table @code
@@ -5983,28 +5974,29 @@ system it is running on; you can override that default using the
@value{GDBN} can only use certain character sets as its host character
set. We list the character set names @value{GDBN} recognizes below, and
-indicate which can be host character sets, but if you invoke the
-@code{set host-charset} command with no argument, @value{GDBN} lists the
-character sets it supports, placing an asterisk (@samp{*}) after those
-it can use as a host character set.
+indicate which can be host character sets, but if you type
+@code{set target-charset} followed by @key{TAB}@key{TAB}, @value{GDBN} will
+list the host character sets it supports.
@item set charset @var{charset}
@kindex set charset
-Set the current host and target character sets to @var{charset}. If you
-invoke the @code{set charset} command with no argument, it lists the
-character sets it supports. @value{GDBN} can only use certain character
-sets as its host character set; it marks those in the list with an
-asterisk (@samp{*}).
+Set the current host and target character sets to @var{charset}. As
+above, if you type @code{set charset} followed by @key{TAB}@key{TAB},
+@value{GDBN} will list the name of the character sets that can be used
+for both host and target.
+
@item show charset
-@itemx show host-charset
-@itemx show target-charset
@kindex show charset
+Show the names of the current host and target charsets.
+
+@itemx show host-charset
@kindex show host-charset
+Show the name of the current host charset.
+
+@itemx show target-charset
@kindex show target-charset
-Show the current host and target charsets. The @code{show host-charset}
-and @code{show target-charset} commands are synonyms for @code{show
-charset}.
+Show the name of the current target charset.
@end table
@@ -6021,7 +6013,7 @@ character set.
@item ISO-8859-1
@cindex ISO 8859-1 character set
@cindex ISO Latin 1 character set
-The ISO Latin 1 character set. This extends ASCII with accented
+The ISO Latin 1 character set. This extends @sc{ascii} with accented
characters needed for French, German, and Spanish. @value{GDBN} can use
this as its host character set.
@@ -6080,16 +6072,16 @@ strings:
@smallexample
(gdb) show charset
-The current host and target character set is `iso-8859-1'.
+The current host and target character set is `ISO-8859-1'.
(gdb)
@end smallexample
For the sake of printing this manual, let's use @sc{ascii} as our
initial character set:
@smallexample
-(gdb) set charset ascii
+(gdb) set charset ASCII
(gdb) show charset
-The current host and target character set is `ascii'.
+The current host and target character set is `ASCII'.
(gdb)
@end smallexample
@@ -6131,17 +6123,13 @@ $5 = 200 '\310'
(gdb)
@end smallexample
-If we invoke the @code{set target-charset} command without an argument,
+If we invoke the @code{set target-charset} followed by @key{TAB}@key{TAB},
@value{GDBN} tells us the character sets it supports:
@smallexample
(gdb) set target-charset
-Valid character sets are:
- ascii *
- iso-8859-1 *
- ebcdic-us
- ibm1047
-* - can be used as a host character set
+ASCII EBCDIC-US IBM1047 ISO-8859-1
+(gdb) set target-charset
@end smallexample
We can select @sc{ibm1047} as our target character set, and examine the
@@ -6151,10 +6139,10 @@ target character set, @sc{ibm1047}, to the host character set,
@sc{ascii}, and they display correctly:
@smallexample
-(gdb) set target-charset ibm1047
+(gdb) set target-charset IBM1047
(gdb) show charset
-The current host character set is `ascii'.
-The current target character set is `ibm1047'.
+The current host character set is `ASCII'.
+The current target character set is `IBM1047'.
(gdb) print ascii_hello
$6 = 0x401698 "\110\145%%?\054\040\167?\162%\144\041\012"
(gdb) print ascii_hello[0]
@@ -6175,7 +6163,7 @@ $10 = 78 '+'
(gdb)
@end smallexample
-The IBM1047 character set uses the number 78 to encode the @samp{+}
+The @sc{ibm1047} character set uses the number 78 to encode the @samp{+}
character.
@@ -9034,14 +9022,14 @@ required for each object file from which @value{GDBN} has read some symbols.
@xref{Files, ,Commands to specify files}, for a discussion of how
@value{GDBN} reads symbols (in the description of @code{symbol-file}).
-@kindex maint list symtabs
-@kindex maint list psymtabs
+@kindex maint info symtabs
+@kindex maint info psymtabs
@cindex listing @value{GDBN}'s internal symbol tables
@cindex symbol tables, listing @value{GDBN}'s internal
@cindex full symbol tables, listing @value{GDBN}'s internal
@cindex partial symbol tables, listing @value{GDBN}'s internal
-@item maint list symtabs @r{[} @var{regexp} @r{]}
-@itemx maint list psymtabs @r{[} @var{regexp} @r{]}
+@item maint info symtabs @r{[} @var{regexp} @r{]}
+@itemx maint info psymtabs @r{[} @var{regexp} @r{]}
List the @code{struct symtab} or @code{struct partial_symtab}
structures whose names match @var{regexp}. If @var{regexp} is not
@@ -9050,7 +9038,7 @@ copy into a @value{GDBN} debugging this one to examine a particular
structure in more detail. For example:
@smallexample
-(@value{GDBP}) maint list psymtabs dwarf2read
+(@value{GDBP}) maint info psymtabs dwarf2read
@{ objfile /home/gnu/build/gdb/gdb
((struct objfile *) 0x82e69d0)
@{ psymtab /home/gnu/src/gdb/dwarf2read.c
@@ -9063,7 +9051,7 @@ structure in more detail. For example:
dependencies (none)
@}
@}
-(@value{GDBP}) maint list symtabs
+(@value{GDBP}) maint info symtabs
(@value{GDBP})
@end smallexample
@noindent
@@ -9077,7 +9065,7 @@ read the symtab for the compilation unit containing that function:
(@value{GDBP}) break dwarf2_psymtab_to_symtab
Breakpoint 1 at 0x814e5da: file /home/gnu/src/gdb/dwarf2read.c,
line 1574.
-(@value{GDBP}) maint list symtabs
+(@value{GDBP}) maint info symtabs
@{ objfile /home/gnu/build/gdb/gdb
((struct objfile *) 0x82e69d0)
@{ symtab /home/gnu/src/gdb/dwarf2read.c
@@ -17117,6 +17105,32 @@ List the functions in the executable.
N.A.
+@subheading The @code{-symbol-list-lines} Command
+@findex -symbol-list-lines
+
+@subsubheading Synopsis
+
+@smallexample
+ -symbol-list-lines @var{filename}
+@end smallexample
+
+Print the list of lines that contain code and their associated program
+addresses for the given source filename. The entries are sorted in
+ascending PC order.
+
+@subsubheading @value{GDBN} Command
+
+There is no corresponding @value{GDBN} command.
+
+@subsubheading Example
+@smallexample
+(@value{GDBP})
+-symbol-list-lines basics.c
+^done,lines=[@{pc="0x08048554",line="7"@},@{pc="0x0804855a",line="8"@}]
+(@value{GDBP})
+@end smallexample
+
+
@subheading The @code{-symbol-list-types} Command
@findex -symbol-list-types
@@ -19350,6 +19364,28 @@ Create a core file? (y or n) @kbd{n}
Takes an optional parameter that is used as the text of the error or
warning message.
+@kindex maint print dummy-frames
+@item maint print dummy-frames
+
+Prints the contents of @value{GDBN}'s internal dummy-frame stack.
+
+@smallexample
+(gdb) @kbd{b add}
+@dots{}
+(gdb) @kbd{print add(2,3)}
+Breakpoint 2, add (a=2, b=3) at @dots{}
+58 return (a + b);
+The program being debugged stopped while in a function called from GDB.
+@dots{}
+(gdb) @kbd{maint print dummy-frames}
+0x1a57c80: pc=0x01014068 fp=0x0200bddc sp=0x0200bdd6
+ top=0x0200bdd4 id=@{stack=0x200bddc,code=0x101405c@}
+ call_lo=0x01014000 call_hi=0x01014001
+(gdb)
+@end smallexample
+
+Takes an optional file parameter.
+
@kindex maint print registers
@kindex maint print raw-registers
@kindex maint print cooked-registers
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 4ca81f6777d..28cdc82242a 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -241,16 +241,17 @@ machine-independent part of @value{GDBN}, except that it is used when
setting up a new frame from scratch, as follows:
@smallexample
-create_new_frame (read_register (FP_REGNUM), read_pc ()));
+create_new_frame (read_register (DEPRECATED_FP_REGNUM), read_pc ()));
@end smallexample
@cindex frame pointer register
-Other than that, all the meaning imparted to @code{FP_REGNUM} is
-imparted by the machine-dependent code. So, @code{FP_REGNUM} can have
-any value that is convenient for the code that creates new frames.
-(@code{create_new_frame} calls @code{DEPRECATED_INIT_EXTRA_FRAME_INFO}
-if it is defined; that is where you should use the @code{FP_REGNUM}
-value, if your frames are nonstandard.)
+Other than that, all the meaning imparted to @code{DEPRECATED_FP_REGNUM}
+is imparted by the machine-dependent code. So,
+@code{DEPRECATED_FP_REGNUM} can have any value that is convenient for
+the code that creates new frames. (@code{create_new_frame} calls
+@code{DEPRECATED_INIT_EXTRA_FRAME_INFO} if it is defined; that is where
+you should use the @code{DEPRECATED_FP_REGNUM} value, if your frames are
+nonstandard.)
@cindex frame chain
Given a @value{GDBN} frame, define @code{DEPRECATED_FRAME_CHAIN} to
@@ -3084,8 +3085,8 @@ custom breakpoint insertion and removal routines if
@code{BREAKPOINT_FROM_PC} needs to read the target's memory for some
reason.
-@item CALL_DUMMY_WORDS
-@findex CALL_DUMMY_WORDS
+@item DEPRECATED_CALL_DUMMY_WORDS
+@findex DEPRECATED_CALL_DUMMY_WORDS
Pointer to an array of @code{LONGEST} words of data containing
host-byte-ordered @code{REGISTER_BYTES} sized values that partially
specify the sequence of instructions needed for an inferior function
@@ -3094,19 +3095,32 @@ call.
Should be deprecated in favor of a macro that uses target-byte-ordered
data.
-@item SIZEOF_CALL_DUMMY_WORDS
-@findex SIZEOF_CALL_DUMMY_WORDS
-The size of @code{CALL_DUMMY_WORDS}. This must return a positive value.
-See also @code{CALL_DUMMY_LENGTH}.
+This method has been replaced by @code{push_dummy_code}
+(@pxref{push_dummy_code}).
+
+@item DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
+@findex DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
+The size of @code{DEPRECATED_CALL_DUMMY_WORDS}. This must return a
+positive value. See also @code{DEPRECATED_CALL_DUMMY_LENGTH}.
+
+This method has been replaced by @code{push_dummy_code}
+(@pxref{push_dummy_code}).
@item CALL_DUMMY
@findex CALL_DUMMY
-A static initializer for @code{CALL_DUMMY_WORDS}. Deprecated.
+A static initializer for @code{DEPRECATED_CALL_DUMMY_WORDS}.
+Deprecated.
+
+This method has been replaced by @code{push_dummy_code}
+(@pxref{push_dummy_code}).
@item CALL_DUMMY_LOCATION
@findex CALL_DUMMY_LOCATION
See the file @file{inferior.h}.
+This method has been replaced by @code{push_dummy_code}
+(@pxref{push_dummy_code}).
+
@item DEPRECATED_CALL_DUMMY_STACK_ADJUST
@findex DEPRECATED_CALL_DUMMY_STACK_ADJUST
Stack adjustment needed when performing an inferior function call. This
@@ -3217,13 +3231,13 @@ If not defined, @code{EXTRACT_RETURN_VALUE} is used.
@findex EXTRACT_STRUCT_VALUE_ADDRESS_P
Predicate for @code{EXTRACT_STRUCT_VALUE_ADDRESS}.
-@item FP_REGNUM
-@findex FP_REGNUM
+@item DEPRECATED_FP_REGNUM
+@findex DEPRECATED_FP_REGNUM
If the virtual frame pointer is kept in a register, then define this
macro to be the number (greater than or equal to zero) of that register.
-This should only need to be defined if @code{TARGET_READ_FP} is not
-defined.
+This should only need to be defined if @code{DEPRECATED_TARGET_READ_FP}
+is not defined.
@item FRAMELESS_FUNCTION_INVOCATION(@var{fi})
@findex FRAMELESS_FUNCTION_INVOCATION
@@ -3706,6 +3720,28 @@ Returns the updated top-of-stack pointer.
This method replaces @code{DEPRECATED_PUSH_ARGUMENTS}.
+@item CORE_ADDR push_dummy_code (@var{gdbarch}, @var{sp}, @var{funaddr}, @var{using_gcc}, @var{args}, @var{nargs}, @var{value_type}, @var{real_pc}, @var{bp_addr})
+@findex push_dummy_code
+@findex DEPRECATED_FIX_CALL_DUMMY
+@anchor{push_dummy_code} Given a stack based call dummy, push the
+instruction sequence (including space for a breakpoint) to which the
+called function should return.
+
+Set @var{bp_addr} to the address at which the breakpoint instruction
+should be inserted, @var{real_pc} to the resume address when starting
+the call sequence, and return the updated inner-most stack address.
+
+By default, the stack is grown sufficient to hold a frame-aligned
+(@pxref{frame_align}) breakpoint, @var{bp_addr} is set to the address
+reserved for that breakpoint, and @var{real_pc} set to @var{funaddr}.
+
+This method replaces @code{DEPRECATED_CALL_DUMMY_WORDS},
+@code{DEPRECATED_SIZEOF_CALL_DUMMY_WORDS}, @code{CALL_DUMMY},
+@code{CALL_DUMMY_LOCATION}, @code{DEPRECATED_REGISTER_SIZE},
+@code{GDB_TARGET_IS_HPPA},
+@code{DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET}, and
+@code{DEPRECATED_FIX_CALL_DUMMY}.
+
@item DEPRECATED_PUSH_DUMMY_FRAME
@findex DEPRECATED_PUSH_DUMMY_FRAME
Used in @samp{call_function_by_hand} to create an artificial stack frame.
@@ -3882,9 +3918,9 @@ Number of bits in a short integer; defaults to @code{2 * TARGET_CHAR_BIT}.
@findex read_sp
@findex read_fp
These change the behavior of @code{read_pc}, @code{write_pc},
-@code{read_sp} and @code{read_fp}. For most targets, these may be left
-undefined. @value{GDBN} will call the read and write register functions
-with the relevant @code{_REGNUM} argument.
+@code{read_sp} and @code{deprecated_read_fp}. For most targets, these
+may be left undefined. @value{GDBN} will call the read and write
+register functions with the relevant @code{_REGNUM} argument.
These macros are useful when a target keeps one of these registers in a
hard to get at place; for example, part in a segment register and part
@@ -3892,10 +3928,10 @@ in an ordinary register.
@item TARGET_VIRTUAL_FRAME_POINTER(@var{pc}, @var{regp}, @var{offsetp})
@findex TARGET_VIRTUAL_FRAME_POINTER
-Returns a @code{(register, offset)} pair representing the virtual
-frame pointer in use at the code address @var{pc}. If virtual
-frame pointers are not used, a default definition simply returns
-@code{FP_REGNUM}, with an offset of zero.
+Returns a @code{(register, offset)} pair representing the virtual frame
+pointer in use at the code address @var{pc}. If virtual frame pointers
+are not used, a default definition simply returns
+@code{DEPRECATED_FP_REGNUM}, with an offset of zero.
@item TARGET_HAS_HARDWARE_WATCHPOINTS
If non-zero, the target has support for hardware-assisted
@@ -3908,11 +3944,12 @@ This is the function used by @value{GDBN} to print an assembly
instruction. It prints the instruction at address @var{addr} in
debugged memory and returns the length of the instruction, in bytes. If
a target doesn't define its own printing routine, it defaults to an
-accessor function for the global pointer @code{tm_print_insn}. This
-usually points to a function in the @code{opcodes} library (@pxref{Support
-Libraries, ,Opcodes}). @var{info} is a structure (of type
-@code{disassemble_info}) defined in @file{include/dis-asm.h} used to
-pass information to the instruction decoding routine.
+accessor function for the global pointer
+@code{deprecated_tm_print_insn}. This usually points to a function in
+the @code{opcodes} library (@pxref{Support Libraries, ,Opcodes}).
+@var{info} is a structure (of type @code{disassemble_info}) defined in
+@file{include/dis-asm.h} used to pass information to the instruction
+decoding routine.
@item struct frame_id unwind_dummy_id (struct frame_info *@var{frame})
@findex unwind_dummy_id
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index a320b7d3b9f..e16056c4412 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -29,6 +29,8 @@
#include "inferior.h"
#include "gdb_assert.h"
#include "frame-unwind.h"
+#include "command.h"
+#include "gdbcmd.h"
static void dummy_frame_this_id (struct frame_info *next_frame,
void **this_prologue_cache,
@@ -149,8 +151,9 @@ generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
figure out what the real PC (as in the resume address) is BEFORE
calling this function (Oh, and I'm not even sure that this function
is called with an decremented PC, the call to pc_in_call_dummy() in
- that file is conditional on !CALL_DUMMY_BREAKPOINT_OFFSET_P yet
- generic dummy targets set CALL_DUMMY_BREAKPOINT_OFFSET. True?). */
+ that file is conditional on
+ !DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET_P yet generic dummy
+ targets set DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET. True?). */
int
pc_in_dummy_frame (CORE_ADDR pc)
@@ -374,7 +377,7 @@ dummy_frame_this_id (struct frame_info *next_frame,
same sequence as is found a traditional unwinder. Once all
architectures supply the unwind_dummy_id method, this code
can go away. */
- (*this_id) = frame_id_build (read_fp (), read_pc ());
+ (*this_id) = frame_id_build (deprecated_read_fp (), read_pc ());
}
else if (legacy_frame_p (current_gdbarch)
&& get_prev_frame (next_frame))
@@ -418,3 +421,49 @@ dummy_frame_p (CORE_ADDR pc)
else
return NULL;
}
+
+static void
+fprint_dummy_frames (struct ui_file *file)
+{
+ struct dummy_frame *s;
+ for (s = dummy_frame_stack; s != NULL; s = s->next)
+ {
+ gdb_print_host_address (s, file);
+ fprintf_unfiltered (file, ":");
+ fprintf_unfiltered (file, " pc=0x%s", paddr (s->pc));
+ fprintf_unfiltered (file, " fp=0x%s", paddr (s->fp));
+ fprintf_unfiltered (file, " sp=0x%s", paddr (s->sp));
+ fprintf_unfiltered (file, " top=0x%s", paddr (s->top));
+ fprintf_unfiltered (file, " id=");
+ fprint_frame_id (file, s->id);
+ fprintf_unfiltered (file, " call_lo=0x%s", paddr (s->call_lo));
+ fprintf_unfiltered (file, " call_hi=0x%s", paddr (s->call_hi));
+ fprintf_unfiltered (file, "\n");
+ }
+}
+
+static void
+maintenance_print_dummy_frames (char *args, int from_tty)
+{
+ if (args == NULL)
+ fprint_dummy_frames (gdb_stdout);
+ else
+ {
+ struct ui_file *file = gdb_fopen (args, "w");
+ if (file == NULL)
+ perror_with_name ("maintenance print dummy-frames");
+ fprint_dummy_frames (file);
+ ui_file_delete (file);
+ }
+}
+
+extern void _initialize_dummy_frame (void);
+
+void
+_initialize_dummy_frame (void)
+{
+ add_cmd ("dummy-frames", class_maintenance, maintenance_print_dummy_frames,
+ "Print the contents of the internal dummy-frame stack.",
+ &maintenanceprintlist);
+
+}
diff --git a/gdb/dummy-frame.h b/gdb/dummy-frame.h
index bb41e8d7988..3d38cc436cc 100644
--- a/gdb/dummy-frame.h
+++ b/gdb/dummy-frame.h
@@ -37,12 +37,13 @@ struct frame_id;
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 DEPRECATED_FRAME_CHAIN_VALID as
+ is probably to define CALL_DUMMY to be empty,
+ DEPRECATED_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 DEPRECATED_FRAME_CHAIN_VALID as
generic_{file,func}_frame_chain_valid and do not set
- FIX_CALL_DUMMY. */
+ DEPRECATED_FIX_CALL_DUMMY. */
/* If the PC falls in a dummy frame, return a dummy frame
unwinder. */
diff --git a/gdb/dve3900-rom.c b/gdb/dve3900-rom.c
index e7329f8988a..02a273c10e1 100644
--- a/gdb/dve3900-rom.c
+++ b/gdb/dve3900-rom.c
@@ -455,7 +455,7 @@ static void
fetch_bitmapped_register (int regno, struct bit_field *bf)
{
unsigned long val;
- unsigned char *regbuf = alloca (max_register_size (current_gdbarch));
+ unsigned char regbuf[MAX_REGISTER_SIZE];
char *regname = NULL;
if (regno >= sizeof (r3900_regnames) / sizeof (r3900_regnames[0]))
diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c
index 81fa2071307..085c91cd311 100644
--- a/gdb/dwarf2cfi.c
+++ b/gdb/dwarf2cfi.c
@@ -1751,7 +1751,7 @@ cfi_write_fp (CORE_ADDR val)
void
cfi_pop_frame (struct frame_info *fi)
{
- char *regbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char regbuf[MAX_REGISTER_SIZE];
int regnum;
for (regnum = 0; regnum < NUM_REGS; regnum++)
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 8927e8798b5..c236c11f37c 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -223,7 +223,10 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
result = dwarf_expr_fetch (ctx, 0);
if (ctx->in_reg)
- retval = value_from_register (SYMBOL_TYPE (var), result, frame);
+ {
+ int regnum = DWARF2_REG_TO_REGNUM (result);
+ retval = value_from_register (SYMBOL_TYPE (var), regnum, frame);
+ }
else
{
retval = allocate_value (SYMBOL_TYPE (var));
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 32a9f44b566..a0a2f9beaaa 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -4548,7 +4548,7 @@ set_cu_language (unsigned int lang)
case DW_LANG_Pascal83:
case DW_LANG_Modula2:
default:
- cu_language = language_unknown;
+ cu_language = language_minimal;
break;
}
cu_language_defn = language_def (cu_language);
@@ -4878,8 +4878,8 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
* lh->minimum_instruction_length;
line += lh->line_base + (adj_opcode % lh->line_range);
/* append row to matrix using current values */
- address = check_cu_functions (address);
- record_line (current_subfile, line, address);
+ record_line (current_subfile, line,
+ check_cu_functions (address));
basic_block = 1;
}
else switch (op_code)
@@ -4925,8 +4925,8 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
}
break;
case DW_LNS_copy:
- address = check_cu_functions (address);
- record_line (current_subfile, line, address);
+ record_line (current_subfile, line,
+ check_cu_functions (address));
basic_block = 0;
break;
case DW_LNS_advance_pc:
diff --git a/gdb/eval.c b/gdb/eval.c
index d5d08927893..c266cd1e33e 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -32,6 +32,9 @@
#include "language.h" /* For CAST_IS_CONVERSION */
#include "f-lang.h" /* for array bound stuff */
#include "cp-abi.h"
+#include "infcall.h"
+#include "objc-lang.h"
+#include "block.h"
/* Defined in symtab.c */
extern int hp_som_som_object_present;
@@ -471,6 +474,15 @@ evaluate_subexp_standard (struct type *expect_type,
goto nosideret;
return value_string (&exp->elts[pc + 2].string, tem);
+ case OP_OBJC_NSSTRING: /* Objective C Foundation Class NSString constant. */
+ tem = longest_to_int (exp->elts[pc + 1].longconst);
+ (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
+ if (noside == EVAL_SKIP)
+ {
+ goto nosideret;
+ }
+ return (struct value *) value_nsstring (&exp->elts[pc + 2].string, tem + 1);
+
case OP_BITSTRING:
tem = longest_to_int (exp->elts[pc + 1].longconst);
(*pos)
@@ -667,6 +679,275 @@ evaluate_subexp_standard (struct type *expect_type,
return arg2;
}
+ case OP_OBJC_SELECTOR:
+ { /* Objective C @selector operator. */
+ char *sel = &exp->elts[pc + 2].string;
+ int len = longest_to_int (exp->elts[pc + 1].longconst);
+
+ (*pos) += 3 + BYTES_TO_EXP_ELEM (len + 1);
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+
+ if (sel[len] != 0)
+ sel[len] = 0; /* Make sure it's terminated. */
+ return value_from_longest (lookup_pointer_type (builtin_type_void),
+ lookup_child_selector (sel));
+ }
+
+ case OP_OBJC_MSGCALL:
+ { /* Objective C message (method) call. */
+
+ static unsigned long responds_selector = 0;
+ static unsigned long method_selector = 0;
+
+ unsigned long selector = 0;
+
+ int using_gcc = 0;
+ int struct_return = 0;
+ int sub_no_side = 0;
+
+ static struct value *msg_send = NULL;
+ static struct value *msg_send_stret = NULL;
+ static int gnu_runtime = 0;
+
+ struct value *target = NULL;
+ struct value *method = NULL;
+ struct value *called_method = NULL;
+
+ struct type *selector_type = NULL;
+
+ struct value *ret = NULL;
+ CORE_ADDR addr = 0;
+
+ selector = exp->elts[pc + 1].longconst;
+ nargs = exp->elts[pc + 2].longconst;
+ argvec = (struct value **) alloca (sizeof (struct value *)
+ * (nargs + 5));
+
+ (*pos) += 3;
+
+ selector_type = lookup_pointer_type (builtin_type_void);
+ if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ sub_no_side = EVAL_NORMAL;
+ else
+ sub_no_side = noside;
+
+ target = evaluate_subexp (selector_type, exp, pos, sub_no_side);
+
+ if (value_as_long (target) == 0)
+ return value_from_longest (builtin_type_long, 0);
+
+ if (lookup_minimal_symbol ("objc_msg_lookup", 0, 0))
+ gnu_runtime = 1;
+
+ /* Find the method dispatch (Apple runtime) or method lookup
+ (GNU runtime) function for Objective-C. These will be used
+ to lookup the symbol information for the method. If we
+ can't find any symbol information, then we'll use these to
+ call the method, otherwise we can call the method
+ directly. The msg_send_stret function is used in the special
+ case of a method that returns a structure (Apple runtime
+ only). */
+ if (gnu_runtime)
+ {
+ msg_send = find_function_in_inferior ("objc_msg_lookup");
+ msg_send_stret = find_function_in_inferior ("objc_msg_lookup");
+ }
+ else
+ {
+ msg_send = find_function_in_inferior ("objc_msgSend");
+ /* Special dispatcher for methods returning structs */
+ msg_send_stret = find_function_in_inferior ("objc_msgSend_stret");
+ }
+
+ /* Verify the target object responds to this method. The
+ standard top-level 'Object' class uses a different name for
+ the verification method than the non-standard, but more
+ often used, 'NSObject' class. Make sure we check for both. */
+
+ responds_selector = lookup_child_selector ("respondsToSelector:");
+ if (responds_selector == 0)
+ responds_selector = lookup_child_selector ("respondsTo:");
+
+ if (responds_selector == 0)
+ error ("no 'respondsTo:' or 'respondsToSelector:' method");
+
+ method_selector = lookup_child_selector ("methodForSelector:");
+ if (method_selector == 0)
+ method_selector = lookup_child_selector ("methodFor:");
+
+ if (method_selector == 0)
+ error ("no 'methodFor:' or 'methodForSelector:' method");
+
+ /* Call the verification method, to make sure that the target
+ class implements the desired method. */
+
+ argvec[0] = msg_send;
+ argvec[1] = target;
+ argvec[2] = value_from_longest (builtin_type_long, responds_selector);
+ argvec[3] = value_from_longest (builtin_type_long, selector);
+ argvec[4] = 0;
+
+ ret = call_function_by_hand (argvec[0], 3, argvec + 1);
+ if (gnu_runtime)
+ {
+ /* Function objc_msg_lookup returns a pointer. */
+ argvec[0] = ret;
+ ret = call_function_by_hand (argvec[0], 3, argvec + 1);
+ }
+ if (value_as_long (ret) == 0)
+ error ("Target does not respond to this message selector.");
+
+ /* Call "methodForSelector:" method, to get the address of a
+ function method that implements this selector for this
+ class. If we can find a symbol at that address, then we
+ know the return type, parameter types etc. (that's a good
+ thing). */
+
+ argvec[0] = msg_send;
+ argvec[1] = target;
+ argvec[2] = value_from_longest (builtin_type_long, method_selector);
+ argvec[3] = value_from_longest (builtin_type_long, selector);
+ argvec[4] = 0;
+
+ ret = call_function_by_hand (argvec[0], 3, argvec + 1);
+ if (gnu_runtime)
+ {
+ argvec[0] = ret;
+ ret = call_function_by_hand (argvec[0], 3, argvec + 1);
+ }
+
+ /* ret should now be the selector. */
+
+ addr = value_as_long (ret);
+ if (addr)
+ {
+ struct symbol *sym = NULL;
+ /* Is it a high_level symbol? */
+
+ sym = find_pc_function (addr);
+ if (sym != NULL)
+ method = value_of_variable (sym, 0);
+ }
+
+ /* If we found a method with symbol information, check to see
+ if it returns a struct. Otherwise assume it doesn't. */
+
+ if (method)
+ {
+ struct block *b;
+ CORE_ADDR funaddr;
+ struct type *value_type;
+
+ funaddr = find_function_addr (method, &value_type);
+
+ b = block_for_pc (funaddr);
+
+ /* If compiled without -g, assume GCC 2. */
+ using_gcc = (b == NULL ? 2 : BLOCK_GCC_COMPILED (b));
+
+ CHECK_TYPEDEF (value_type);
+
+ if ((value_type == NULL)
+ || (TYPE_CODE(value_type) == TYPE_CODE_ERROR))
+ {
+ if (expect_type != NULL)
+ value_type = expect_type;
+ }
+
+ struct_return = using_struct_return (method, funaddr, value_type, using_gcc);
+ }
+ else if (expect_type != NULL)
+ {
+ struct_return = using_struct_return (NULL, addr, check_typedef (expect_type), using_gcc);
+ }
+
+ /* Found a function symbol. Now we will substitute its
+ value in place of the message dispatcher (obj_msgSend),
+ so that we call the method directly instead of thru
+ the dispatcher. The main reason for doing this is that
+ we can now evaluate the return value and parameter values
+ according to their known data types, in case we need to
+ do things like promotion, dereferencing, special handling
+ of structs and doubles, etc.
+
+ We want to use the type signature of 'method', but still
+ jump to objc_msgSend() or objc_msgSend_stret() to better
+ mimic the behavior of the runtime. */
+
+ if (method)
+ {
+ if (TYPE_CODE (VALUE_TYPE (method)) != TYPE_CODE_FUNC)
+ error ("method address has symbol information with non-function type; skipping");
+ if (struct_return)
+ VALUE_ADDRESS (method) = value_as_address (msg_send_stret);
+ else
+ VALUE_ADDRESS (method) = value_as_address (msg_send);
+ called_method = method;
+ }
+ else
+ {
+ if (struct_return)
+ called_method = msg_send_stret;
+ else
+ called_method = msg_send;
+ }
+
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+
+ if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ {
+ /* If the return type doesn't look like a function type,
+ call an error. This can happen if somebody tries to
+ turn a variable into a function call. This is here
+ because people often want to call, eg, strcmp, which
+ gdb doesn't know is a function. If gdb isn't asked for
+ it's opinion (ie. through "whatis"), it won't offer
+ it. */
+
+ struct type *type = VALUE_TYPE (called_method);
+ if (type && TYPE_CODE (type) == TYPE_CODE_PTR)
+ type = TYPE_TARGET_TYPE (type);
+ type = TYPE_TARGET_TYPE (type);
+
+ if (type)
+ {
+ if ((TYPE_CODE (type) == TYPE_CODE_ERROR) && expect_type)
+ return allocate_value (expect_type);
+ else
+ return allocate_value (type);
+ }
+ else
+ error ("Expression of type other than \"method returning ...\" used as a method");
+ }
+
+ /* Now depending on whether we found a symbol for the method,
+ we will either call the runtime dispatcher or the method
+ directly. */
+
+ argvec[0] = called_method;
+ argvec[1] = target;
+ argvec[2] = value_from_longest (builtin_type_long, selector);
+ /* User-supplied arguments. */
+ for (tem = 0; tem < nargs; tem++)
+ argvec[tem + 3] = evaluate_subexp_with_coercion (exp, pos, noside);
+ argvec[tem + 3] = 0;
+
+ if (gnu_runtime && (method != NULL))
+ {
+ ret = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
+ /* Function objc_msg_lookup returns a pointer. */
+ argvec[0] = ret;
+ ret = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
+ }
+ else
+ ret = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
+
+ return ret;
+ }
+ break;
+
case OP_FUNCALL:
(*pos) += 2;
op = exp->elts[*pos].opcode;
@@ -1749,6 +2030,10 @@ evaluate_subexp_standard (struct type *expect_type,
(*pos) += 1;
return value_of_this (1);
+ case OP_OBJC_SELF:
+ (*pos) += 1;
+ return value_of_local ("self", 1);
+
case OP_TYPE:
error ("Attempt to use a type name as an expression");
diff --git a/gdb/findvar.c b/gdb/findvar.c
index beab9fb8fe5..ca371d21e03 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -300,7 +300,7 @@ value_of_register (int regnum, struct frame_info *frame)
int optim;
struct value *reg_val;
int realnum;
- char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
enum lval_type lval;
/* Builtin registers lie completly outside of the range of normal
@@ -664,7 +664,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
struct value *
value_from_register (struct type *type, int regnum, struct frame_info *frame)
{
- char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
CORE_ADDR addr;
int optim;
struct value *v = allocate_value (type);
@@ -699,7 +699,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
CORE_ADDR last_addr = 0;
CORE_ADDR first_addr = 0;
- value_bytes = (char *) alloca (len + MAX_REGISTER_RAW_SIZE);
+ value_bytes = (char *) alloca (len + MAX_REGISTER_SIZE);
/* Copy all of the data out, whereever it may be. */
diff --git a/gdb/fork-child.c b/gdb/fork-child.c
index 1dc28e822d4..e1d32b06452 100644
--- a/gdb/fork-child.c
+++ b/gdb/fork-child.c
@@ -88,6 +88,29 @@ breakup_args (char *scratch, char **argv)
}
+/* When executing a command under the given shell, return non-zero
+ if the '!' character should be escaped when embedded in a quoted
+ command-line argument. */
+
+static int
+escape_bang_in_quoted_argument (const char *shell_file)
+{
+ const int shell_file_len = strlen (shell_file);
+
+ /* Bang should be escaped only in C Shells. For now, simply check
+ that the shell name ends with 'csh', which covers at least csh
+ and tcsh. This should be good enough for now. */
+
+ if (shell_file_len < 3)
+ return 0;
+
+ if (shell_file[shell_file_len - 3] == 'c'
+ && shell_file[shell_file_len - 2] == 's'
+ && shell_file[shell_file_len - 1] == 'h')
+ return 1;
+
+ return 0;
+}
/* Start an inferior Unix child process and sets inferior_ptid to its pid.
EXEC_FILE is the file to run.
@@ -171,6 +194,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
char *p;
int need_to_quote;
+ const int escape_bang = escape_bang_in_quoted_argument (shell_file);
strcat (shell_command, "exec ");
@@ -215,7 +239,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
{
if (*p == '\'')
strcat (shell_command, "'\\''");
- else if (*p == '!')
+ else if (*p == '!' && escape_bang)
strcat (shell_command, "\\!");
else
strncat (shell_command, p, 1);
@@ -404,9 +428,6 @@ startup_inferior (int ntraps)
inferior_ignoring_leading_exec_events =
target_reported_exec_events_per_exec_call () - 1;
-#ifdef STARTUP_INFERIOR
- STARTUP_INFERIOR (pending_execs);
-#else
while (1)
{
/* Make wait_for_inferior be quiet */
@@ -444,6 +465,5 @@ startup_inferior (int ntraps)
resume (0, TARGET_SIGNAL_0); /* Just make it go on */
}
}
-#endif /* STARTUP_INFERIOR */
stop_soon = NO_STOP_QUIETLY;
}
diff --git a/gdb/frame.c b/gdb/frame.c
index 3871aa1d5fc..a664b97999b 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -139,7 +139,7 @@ static int frame_debug;
static int backtrace_below_main;
-static void
+void
fprint_frame_id (struct ui_file *file, struct frame_id id)
{
fprintf_unfiltered (file, "{stack=0x%s,code=0x%s}",
@@ -295,10 +295,8 @@ frame_id_eq (struct frame_id l, struct frame_id r)
/* The .stack and .code are identical, the ID's are identical. */
eq = 1;
else
- /* FIXME: cagney/2003-04-06: This should be zero. Can't yet do
- this because most frame ID's are not being initialized
- correctly. */
- eq = 1;
+ /* No luck. */
+ eq = 0;
if (frame_debug)
{
fprintf_unfiltered (gdb_stdlog, "{ frame_id_eq (l=");
@@ -620,7 +618,7 @@ void
frame_unwind_signed_register (struct frame_info *frame, int regnum,
LONGEST *val)
{
- void *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
frame_unwind_register (frame, regnum, buf);
(*val) = extract_signed_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
}
@@ -629,7 +627,7 @@ void
frame_unwind_unsigned_register (struct frame_info *frame, int regnum,
ULONGEST *val)
{
- void *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
frame_unwind_register (frame, regnum, buf);
(*val) = extract_unsigned_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
}
@@ -1388,7 +1386,8 @@ legacy_get_prev_frame (struct frame_info *this_frame)
using the same sequence as is found a traditional
unwinder. Once all architectures supply the
unwind_dummy_id method, this code can go away. */
- prev->this_id.value = frame_id_build (read_fp (), read_pc ());
+ prev->this_id.value = frame_id_build (deprecated_read_fp (),
+ read_pc ());
}
/* Check that the unwound ID is valid. */
@@ -1543,8 +1542,9 @@ legacy_get_prev_frame (struct frame_info *this_frame)
DEPRECATED_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.
+ (deprecated_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;
@@ -2069,7 +2069,12 @@ get_frame_type (struct frame_info *frame)
if (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES
&& deprecated_frame_in_dummy (frame))
return DUMMY_FRAME;
- if (frame->unwind == NULL)
+
+ /* Some legacy code, e.g, mips_init_extra_frame_info() wants
+ to determine the frame's type prior to it being completely
+ initialized. Don't attempt to lazily initialize ->unwind for
+ legacy code. It will be initialized in legacy_get_prev_frame(). */
+ if (frame->unwind == NULL && !legacy_frame_p (current_gdbarch))
{
/* Initialize the frame's unwinder because it is that which
provides the frame's type. */
diff --git a/gdb/frame.h b/gdb/frame.h
index f33755a99ca..a8f05f35f8b 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -95,6 +95,10 @@ extern int frame_id_eq (struct frame_id l, struct frame_id r);
above about frameless functions. */
extern int frame_id_inner (struct frame_id l, struct frame_id r);
+/* Write the internal representation of a frame ID on the specified
+ stream. */
+extern void fprint_frame_id (struct ui_file *file, struct frame_id id);
+
/* For every stopped thread, GDB tracks two frames: current and
selected. Current frame is the inner most frame of the selected
@@ -369,6 +373,7 @@ enum print_what
extern void *frame_obstack_zalloc (unsigned long size);
#define FRAME_OBSTACK_ZALLOC(TYPE) ((TYPE *) frame_obstack_zalloc (sizeof (TYPE)))
+#define FRAME_OBSTACK_CALLOC(NUMBER,TYPE) ((TYPE *) frame_obstack_zalloc ((NUMBER) * sizeof (TYPE)))
/* If legacy_frame_chain_valid() returns zero it means that the given
frame is the outermost one and has no caller.
@@ -556,9 +561,9 @@ extern void deprecated_update_frame_pc_hack (struct frame_info *frame,
/* FIXME: cagney/2002-12-18: Has the frame's base changed? Or to be
more exact, whas that initial guess at the frame's base as returned
- by read_fp() wrong. If it was, fix it. This shouldn't be
- necessary since the code should be getting the frame's base correct
- from the outset.
+ by deprecated_read_fp() wrong. If it was, fix it. This shouldn't
+ be necessary since the code should be getting the frame's base
+ correct from the outset.
This replaced: frame->frame = ....; */
extern void deprecated_update_frame_base_hack (struct frame_info *frame,
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index bab37760ad0..ce02b7fc6a8 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -1053,11 +1053,11 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_num_regs (gdbarch, frv_num_regs);
set_gdbarch_sp_regnum (gdbarch, sp_regnum);
- set_gdbarch_fp_regnum (gdbarch, fp_regnum);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, fp_regnum);
set_gdbarch_pc_regnum (gdbarch, pc_regnum);
set_gdbarch_register_name (gdbarch, frv_register_name);
- set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_deprecated_register_size (gdbarch, 4);
set_gdbarch_register_bytes (gdbarch, frv_num_regs * 4);
set_gdbarch_register_byte (gdbarch, frv_register_byte);
set_gdbarch_register_raw_size (gdbarch, frv_register_raw_size);
@@ -1092,8 +1092,8 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_push_return_address (gdbarch, frv_push_return_address);
set_gdbarch_deprecated_pop_frame (gdbarch, frv_pop_frame);
- set_gdbarch_call_dummy_words (gdbarch, frv_call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (frv_call_dummy_words));
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, frv_call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (frv_call_dummy_words));
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, frv_init_extra_frame_info);
/* Settings that should be unnecessary. */
@@ -1101,7 +1101,6 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_read_pc (gdbarch, generic_target_read_pc);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
- set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
@@ -1147,7 +1146,7 @@ _initialize_frv_tdep (void)
{
register_gdbarch_init (bfd_arch_frv, frv_gdbarch_init);
- tm_print_insn = print_insn_frv;
+ deprecated_tm_print_insn = print_insn_frv;
}
diff --git a/gdb/gcore.c b/gdb/gcore.c
index 5ad17e83f83..6a0edbf51e1 100644
--- a/gdb/gcore.c
+++ b/gdb/gcore.c
@@ -26,6 +26,7 @@
#include "elf-bfd.h"
#include "symfile.h"
#include "objfiles.h"
+#include "infcall.h"
static char *default_gcore_target (void);
static enum bfd_architecture default_gcore_arch (void);
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 3b5a80762c3..db9e76e9671 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -147,7 +147,7 @@ struct gdbarch
int char_signed;
gdbarch_read_pc_ftype *read_pc;
gdbarch_write_pc_ftype *write_pc;
- gdbarch_read_fp_ftype *read_fp;
+ gdbarch_deprecated_target_read_fp_ftype *deprecated_target_read_fp;
gdbarch_read_sp_ftype *read_sp;
gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp;
gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
@@ -156,7 +156,7 @@ struct gdbarch
int num_regs;
int num_pseudo_regs;
int sp_regnum;
- int fp_regnum;
+ int deprecated_fp_regnum;
int pc_regnum;
int ps_regnum;
int fp0_regnum;
@@ -167,7 +167,7 @@ struct gdbarch
gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
gdbarch_register_name_ftype *register_name;
- int register_size;
+ int deprecated_register_size;
int register_bytes;
gdbarch_register_byte_ftype *register_byte;
gdbarch_register_raw_size_ftype *register_raw_size;
@@ -188,14 +188,15 @@ struct gdbarch
int deprecated_use_generic_dummy_frames;
int call_dummy_location;
gdbarch_call_dummy_address_ftype *call_dummy_address;
- CORE_ADDR call_dummy_start_offset;
- CORE_ADDR call_dummy_breakpoint_offset;
- int call_dummy_length;
+ CORE_ADDR deprecated_call_dummy_start_offset;
+ CORE_ADDR deprecated_call_dummy_breakpoint_offset;
+ int deprecated_call_dummy_length;
gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy;
- LONGEST * call_dummy_words;
- int sizeof_call_dummy_words;
+ LONGEST * deprecated_call_dummy_words;
+ int deprecated_sizeof_call_dummy_words;
int deprecated_call_dummy_stack_adjust;
- gdbarch_fix_call_dummy_ftype *fix_call_dummy;
+ gdbarch_deprecated_fix_call_dummy_ftype *deprecated_fix_call_dummy;
+ gdbarch_push_dummy_code_ftype *push_dummy_code;
gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first;
gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc;
int believe_pcc_promotion;
@@ -401,6 +402,7 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
+ generic_remote_translate_xfer_address,
0,
0,
0,
@@ -499,12 +501,11 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->char_signed = -1;
current_gdbarch->read_pc = generic_target_read_pc;
current_gdbarch->write_pc = generic_target_write_pc;
- current_gdbarch->read_fp = generic_target_read_fp;
current_gdbarch->read_sp = generic_target_read_sp;
current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
current_gdbarch->num_regs = -1;
current_gdbarch->sp_regnum = -1;
- current_gdbarch->fp_regnum = -1;
+ current_gdbarch->deprecated_fp_regnum = -1;
current_gdbarch->pc_regnum = -1;
current_gdbarch->ps_regnum = -1;
current_gdbarch->fp0_regnum = -1;
@@ -515,8 +516,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
current_gdbarch->register_name = legacy_register_name;
- current_gdbarch->register_size = -1;
- current_gdbarch->register_bytes = -1;
current_gdbarch->register_byte = generic_register_byte;
current_gdbarch->register_raw_size = generic_register_size;
current_gdbarch->register_virtual_size = generic_register_size;
@@ -528,8 +527,8 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
current_gdbarch->call_dummy_address = entry_point_address;
current_gdbarch->deprecated_pc_in_call_dummy = generic_pc_in_call_dummy;
- current_gdbarch->call_dummy_words = legacy_call_dummy_words;
- current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
+ current_gdbarch->deprecated_call_dummy_words = legacy_call_dummy_words;
+ current_gdbarch->deprecated_sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
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;
@@ -622,7 +621,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
gdbarch->char_signed = 1;
/* Skip verify of read_pc, invalid_p == 0 */
/* Skip verify of write_pc, invalid_p == 0 */
- /* Skip verify of read_fp, invalid_p == 0 */
+ /* Skip verify of deprecated_target_read_fp, has predicate */
/* Skip verify of read_sp, invalid_p == 0 */
/* Skip verify of deprecated_dummy_write_sp, has predicate */
/* Skip verify of virtual_frame_pointer, invalid_p == 0 */
@@ -633,7 +632,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
fprintf_unfiltered (log, "\n\tnum_regs");
/* Skip verify of num_pseudo_regs, invalid_p == 0 */
/* Skip verify of sp_regnum, invalid_p == 0 */
- /* Skip verify of fp_regnum, invalid_p == 0 */
+ /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
/* Skip verify of pc_regnum, invalid_p == 0 */
/* Skip verify of ps_regnum, invalid_p == 0 */
/* Skip verify of fp0_regnum, invalid_p == 0 */
@@ -644,13 +643,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
/* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
/* Skip verify of register_name, invalid_p == 0 */
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->register_size == -1))
- fprintf_unfiltered (log, "\n\tregister_size");
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->register_bytes == -1))
- fprintf_unfiltered (log, "\n\tregister_bytes");
- /* Skip verify of register_byte, invalid_p == 0 */
+ /* Skip verify of register_byte, has predicate */
/* Skip verify of register_raw_size, invalid_p == 0 */
/* Skip verify of deprecated_max_register_raw_size, has predicate */
/* Skip verify of register_virtual_size, invalid_p == 0 */
@@ -670,10 +663,11 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of call_dummy_location, invalid_p == 0 */
/* Skip verify of call_dummy_address, invalid_p == 0 */
/* Skip verify of deprecated_pc_in_call_dummy, has predicate */
- /* Skip verify of call_dummy_words, invalid_p == 0 */
- /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
+ /* Skip verify of deprecated_call_dummy_words, invalid_p == 0 */
+ /* Skip verify of deprecated_sizeof_call_dummy_words, invalid_p == 0 */
/* Skip verify of deprecated_call_dummy_stack_adjust, has predicate */
- /* Skip verify of fix_call_dummy, has predicate */
+ /* Skip verify of deprecated_fix_call_dummy, has predicate */
+ /* Skip verify of push_dummy_code, has predicate */
/* Skip verify of deprecated_init_frame_pc_first, has predicate */
/* Skip verify of deprecated_init_frame_pc, has predicate */
/* Skip verify of deprecated_get_saved_register, has predicate */
@@ -922,22 +916,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->call_dummy_address
/*CALL_DUMMY_ADDRESS ()*/);
#endif
-#ifdef CALL_DUMMY_BREAKPOINT_OFFSET
- fprintf_unfiltered (file,
- "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
- XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET));
- fprintf_unfiltered (file,
- "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = %ld\n",
- (long) CALL_DUMMY_BREAKPOINT_OFFSET);
-#endif
-#ifdef CALL_DUMMY_LENGTH
- fprintf_unfiltered (file,
- "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n",
- XSTRING (CALL_DUMMY_LENGTH));
- fprintf_unfiltered (file,
- "gdbarch_dump: CALL_DUMMY_LENGTH = %d\n",
- CALL_DUMMY_LENGTH);
-#endif
#ifdef CALL_DUMMY_LOCATION
fprintf_unfiltered (file,
"gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
@@ -946,22 +924,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: CALL_DUMMY_LOCATION = %d\n",
CALL_DUMMY_LOCATION);
#endif
-#ifdef CALL_DUMMY_START_OFFSET
- fprintf_unfiltered (file,
- "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n",
- XSTRING (CALL_DUMMY_START_OFFSET));
- fprintf_unfiltered (file,
- "gdbarch_dump: CALL_DUMMY_START_OFFSET = %ld\n",
- (long) CALL_DUMMY_START_OFFSET);
-#endif
-#ifdef CALL_DUMMY_WORDS
- fprintf_unfiltered (file,
- "gdbarch_dump: CALL_DUMMY_WORDS # %s\n",
- XSTRING (CALL_DUMMY_WORDS));
- fprintf_unfiltered (file,
- "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n",
- (long) CALL_DUMMY_WORDS);
-#endif
#ifdef CANNOT_FETCH_REGISTER
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1040,6 +1002,22 @@ 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_CALL_DUMMY_BREAKPOINT_OFFSET
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
+ XSTRING (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET = %ld\n",
+ (long) DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET);
+#endif
+#ifdef DEPRECATED_CALL_DUMMY_LENGTH
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_CALL_DUMMY_LENGTH # %s\n",
+ XSTRING (DEPRECATED_CALL_DUMMY_LENGTH));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_CALL_DUMMY_LENGTH = %d\n",
+ DEPRECATED_CALL_DUMMY_LENGTH);
+#endif
#ifdef DEPRECATED_CALL_DUMMY_STACK_ADJUST_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1057,6 +1035,22 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: DEPRECATED_CALL_DUMMY_STACK_ADJUST = %d\n",
DEPRECATED_CALL_DUMMY_STACK_ADJUST);
#endif
+#ifdef DEPRECATED_CALL_DUMMY_START_OFFSET
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_CALL_DUMMY_START_OFFSET # %s\n",
+ XSTRING (DEPRECATED_CALL_DUMMY_START_OFFSET));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_CALL_DUMMY_START_OFFSET = %ld\n",
+ (long) DEPRECATED_CALL_DUMMY_START_OFFSET);
+#endif
+#ifdef DEPRECATED_CALL_DUMMY_WORDS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_CALL_DUMMY_WORDS # %s\n",
+ XSTRING (DEPRECATED_CALL_DUMMY_WORDS));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_CALL_DUMMY_WORDS = 0x%08lx\n",
+ (long) DEPRECATED_CALL_DUMMY_WORDS);
+#endif
#ifdef DEPRECATED_DO_REGISTERS_INFO_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1145,6 +1139,37 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED = %d\n",
DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED);
#endif
+#ifdef DEPRECATED_FIX_CALL_DUMMY_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_FIX_CALL_DUMMY_P()",
+ XSTRING (DEPRECATED_FIX_CALL_DUMMY_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_FIX_CALL_DUMMY_P() = %d\n",
+ DEPRECATED_FIX_CALL_DUMMY_P ());
+#endif
+#ifdef DEPRECATED_FIX_CALL_DUMMY
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
+ XSTRING (DEPRECATED_FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_FIX_CALL_DUMMY = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_fix_call_dummy
+ /*DEPRECATED_FIX_CALL_DUMMY ()*/);
+#endif
+#ifdef DEPRECATED_FP_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
+ XSTRING (DEPRECATED_FP_REGNUM));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_FP_REGNUM = %d\n",
+ DEPRECATED_FP_REGNUM);
+#endif
#ifdef DEPRECATED_FRAME_CHAIN_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1454,6 +1479,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->deprecated_push_return_address
/*DEPRECATED_PUSH_RETURN_ADDRESS ()*/);
#endif
+#ifdef DEPRECATED_REGISTER_SIZE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
+ XSTRING (DEPRECATED_REGISTER_SIZE));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_REGISTER_SIZE = %d\n",
+ DEPRECATED_REGISTER_SIZE);
+#endif
#ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1474,6 +1507,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->deprecated_saved_pc_after_call
/*DEPRECATED_SAVED_PC_AFTER_CALL ()*/);
#endif
+#ifdef DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_SIZEOF_CALL_DUMMY_WORDS # %s\n",
+ XSTRING (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_SIZEOF_CALL_DUMMY_WORDS = %d\n",
+ DEPRECATED_SIZEOF_CALL_DUMMY_WORDS);
+#endif
#ifdef DEPRECATED_STORE_RETURN_VALUE
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -1511,6 +1552,26 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->deprecated_store_struct_return
/*DEPRECATED_STORE_STRUCT_RETURN ()*/);
#endif
+#ifdef DEPRECATED_TARGET_READ_FP_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_TARGET_READ_FP_P()",
+ XSTRING (DEPRECATED_TARGET_READ_FP_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_TARGET_READ_FP_P() = %d\n",
+ DEPRECATED_TARGET_READ_FP_P ());
+#endif
+#ifdef DEPRECATED_TARGET_READ_FP
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_TARGET_READ_FP()",
+ XSTRING (DEPRECATED_TARGET_READ_FP ()));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_TARGET_READ_FP = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_target_read_fp
+ /*DEPRECATED_TARGET_READ_FP ()*/);
+#endif
#ifdef DEPRECATED_USE_GENERIC_DUMMY_FRAMES
fprintf_unfiltered (file,
"gdbarch_dump: DEPRECATED_USE_GENERIC_DUMMY_FRAMES # %s\n",
@@ -1623,29 +1684,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->extract_struct_value_address
/*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
#endif
-#ifdef FIX_CALL_DUMMY_P
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "FIX_CALL_DUMMY_P()",
- XSTRING (FIX_CALL_DUMMY_P ()));
- fprintf_unfiltered (file,
- "gdbarch_dump: FIX_CALL_DUMMY_P() = %d\n",
- FIX_CALL_DUMMY_P ());
-#endif
-#ifdef FIX_CALL_DUMMY
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
- XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: FIX_CALL_DUMMY = <0x%08lx>\n",
- (long) current_gdbarch->fix_call_dummy
- /*FIX_CALL_DUMMY ()*/);
-#endif
#ifdef FP0_REGNUM
fprintf_unfiltered (file,
"gdbarch_dump: FP0_REGNUM # %s\n",
@@ -1654,14 +1692,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: FP0_REGNUM = %d\n",
FP0_REGNUM);
#endif
-#ifdef FP_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: FP_REGNUM # %s\n",
- XSTRING (FP_REGNUM));
- fprintf_unfiltered (file,
- "gdbarch_dump: FP_REGNUM = %d\n",
- FP_REGNUM);
-#endif
#ifdef FRAMELESS_FUNCTION_INVOCATION
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1953,6 +1983,23 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"gdbarch_dump: push_dummy_call = 0x%08lx\n",
(long) current_gdbarch->push_dummy_call);
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
+ gdbarch_push_dummy_code_p (current_gdbarch));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: push_dummy_code = 0x%08lx\n",
+ (long) current_gdbarch->push_dummy_code);
+#ifdef REGISTER_BYTE_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REGISTER_BYTE_P()",
+ XSTRING (REGISTER_BYTE_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_BYTE_P() = %d\n",
+ REGISTER_BYTE_P ());
+#endif
#ifdef REGISTER_BYTE
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -2064,14 +2111,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->register_sim_regno
/*REGISTER_SIM_REGNO ()*/);
#endif
-#ifdef REGISTER_SIZE
- fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_SIZE # %s\n",
- XSTRING (REGISTER_SIZE));
- fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_SIZE = %d\n",
- REGISTER_SIZE);
-#endif
#ifdef REGISTER_TO_VALUE
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -2145,20 +2184,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->reg_struct_has_addr
/*REG_STRUCT_HAS_ADDR ()*/);
#endif
-#ifdef REMOTE_TRANSLATE_XFER_ADDRESS
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)",
- XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len)));
-#endif
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
- "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = <0x%08lx>\n",
- (long) current_gdbarch->remote_translate_xfer_address
- /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
-#endif
+ "gdbarch_dump: remote_translate_xfer_address = 0x%08lx\n",
+ (long) current_gdbarch->remote_translate_xfer_address);
#ifdef RETURN_VALUE_ON_STACK
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -2244,14 +2273,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->sigtramp_start
/*SIGTRAMP_START ()*/);
#endif
-#ifdef SIZEOF_CALL_DUMMY_WORDS
- fprintf_unfiltered (file,
- "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n",
- XSTRING (SIZEOF_CALL_DUMMY_WORDS));
- fprintf_unfiltered (file,
- "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = %d\n",
- SIZEOF_CALL_DUMMY_WORDS);
-#endif
#ifdef SKIP_PROLOGUE
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -2501,17 +2522,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: TARGET_PTR_BIT = %d\n",
TARGET_PTR_BIT);
#endif
-#ifdef TARGET_READ_FP
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "TARGET_READ_FP()",
- XSTRING (TARGET_READ_FP ()));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_READ_FP = <0x%08lx>\n",
- (long) current_gdbarch->read_fp
- /*TARGET_READ_FP ()*/);
-#endif
#ifdef TARGET_READ_PC
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -2880,23 +2890,30 @@ set_gdbarch_write_pc (struct gdbarch *gdbarch,
gdbarch->write_pc = write_pc;
}
+int
+gdbarch_deprecated_target_read_fp_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->deprecated_target_read_fp != 0;
+}
+
CORE_ADDR
-gdbarch_read_fp (struct gdbarch *gdbarch)
+gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- if (gdbarch->read_fp == 0)
+ if (gdbarch->deprecated_target_read_fp == 0)
internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_read_fp invalid");
+ "gdbarch: gdbarch_deprecated_target_read_fp invalid");
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n");
- return gdbarch->read_fp ();
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_target_read_fp called\n");
+ return gdbarch->deprecated_target_read_fp ();
}
void
-set_gdbarch_read_fp (struct gdbarch *gdbarch,
- gdbarch_read_fp_ftype read_fp)
+set_gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch,
+ gdbarch_deprecated_target_read_fp_ftype deprecated_target_read_fp)
{
- gdbarch->read_fp = read_fp;
+ gdbarch->deprecated_target_read_fp = deprecated_target_read_fp;
}
CORE_ADDR
@@ -3069,20 +3086,20 @@ set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
}
int
-gdbarch_fp_regnum (struct gdbarch *gdbarch)
+gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Skip verify of fp_regnum, invalid_p == 0 */
+ /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
- return gdbarch->fp_regnum;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
+ return gdbarch->deprecated_fp_regnum;
}
void
-set_gdbarch_fp_regnum (struct gdbarch *gdbarch,
- int fp_regnum)
+set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
+ int deprecated_fp_regnum)
{
- gdbarch->fp_regnum = fp_regnum;
+ gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
}
int
@@ -3268,31 +3285,25 @@ set_gdbarch_register_name (struct gdbarch *gdbarch,
}
int
-gdbarch_register_size (struct gdbarch *gdbarch)
+gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- if (gdbarch->register_size == -1)
- internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_register_size invalid");
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n");
- return gdbarch->register_size;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
+ return gdbarch->deprecated_register_size;
}
void
-set_gdbarch_register_size (struct gdbarch *gdbarch,
- int register_size)
+set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
+ int deprecated_register_size)
{
- gdbarch->register_size = register_size;
+ gdbarch->deprecated_register_size = deprecated_register_size;
}
int
gdbarch_register_bytes (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- if (gdbarch->register_bytes == -1)
- internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_register_bytes invalid");
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n");
return gdbarch->register_bytes;
@@ -3306,12 +3317,20 @@ set_gdbarch_register_bytes (struct gdbarch *gdbarch,
}
int
+gdbarch_register_byte_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->register_byte != generic_register_byte;
+}
+
+int
gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
{
gdb_assert (gdbarch != NULL);
if (gdbarch->register_byte == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_byte invalid");
+ /* Ignore predicate (gdbarch->register_byte != generic_register_byte). */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n");
return gdbarch->register_byte (reg_nr);
@@ -3720,51 +3739,51 @@ set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
}
CORE_ADDR
-gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch)
+gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n");
- return gdbarch->call_dummy_start_offset;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_start_offset called\n");
+ return gdbarch->deprecated_call_dummy_start_offset;
}
void
-set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch,
- CORE_ADDR call_dummy_start_offset)
+set_gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch,
+ CORE_ADDR deprecated_call_dummy_start_offset)
{
- gdbarch->call_dummy_start_offset = call_dummy_start_offset;
+ gdbarch->deprecated_call_dummy_start_offset = deprecated_call_dummy_start_offset;
}
CORE_ADDR
-gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
+gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n");
- return gdbarch->call_dummy_breakpoint_offset;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_breakpoint_offset called\n");
+ return gdbarch->deprecated_call_dummy_breakpoint_offset;
}
void
-set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
- CORE_ADDR call_dummy_breakpoint_offset)
+set_gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
+ CORE_ADDR deprecated_call_dummy_breakpoint_offset)
{
- gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset;
+ gdbarch->deprecated_call_dummy_breakpoint_offset = deprecated_call_dummy_breakpoint_offset;
}
int
-gdbarch_call_dummy_length (struct gdbarch *gdbarch)
+gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n");
- return gdbarch->call_dummy_length;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_length called\n");
+ return gdbarch->deprecated_call_dummy_length;
}
void
-set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
- int call_dummy_length)
+set_gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch,
+ int deprecated_call_dummy_length)
{
- gdbarch->call_dummy_length = call_dummy_length;
+ gdbarch->deprecated_call_dummy_length = deprecated_call_dummy_length;
}
int
@@ -3795,37 +3814,37 @@ set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch,
}
LONGEST *
-gdbarch_call_dummy_words (struct gdbarch *gdbarch)
+gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Skip verify of call_dummy_words, invalid_p == 0 */
+ /* Skip verify of deprecated_call_dummy_words, invalid_p == 0 */
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
- return gdbarch->call_dummy_words;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_words called\n");
+ return gdbarch->deprecated_call_dummy_words;
}
void
-set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
- LONGEST * call_dummy_words)
+set_gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch,
+ LONGEST * deprecated_call_dummy_words)
{
- gdbarch->call_dummy_words = call_dummy_words;
+ gdbarch->deprecated_call_dummy_words = deprecated_call_dummy_words;
}
int
-gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
+gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
+ /* Skip verify of deprecated_sizeof_call_dummy_words, invalid_p == 0 */
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
- return gdbarch->sizeof_call_dummy_words;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_sizeof_call_dummy_words called\n");
+ return gdbarch->deprecated_sizeof_call_dummy_words;
}
void
-set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch,
- int sizeof_call_dummy_words)
+set_gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch,
+ int deprecated_sizeof_call_dummy_words)
{
- gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words;
+ gdbarch->deprecated_sizeof_call_dummy_words = deprecated_sizeof_call_dummy_words;
}
int
@@ -3852,29 +3871,55 @@ set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch,
}
int
-gdbarch_fix_call_dummy_p (struct gdbarch *gdbarch)
+gdbarch_deprecated_fix_call_dummy_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- return gdbarch->fix_call_dummy != 0;
+ return gdbarch->deprecated_fix_call_dummy != 0;
}
void
-gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p)
+gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p)
{
gdb_assert (gdbarch != NULL);
- if (gdbarch->fix_call_dummy == 0)
+ if (gdbarch->deprecated_fix_call_dummy == 0)
internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_fix_call_dummy invalid");
+ "gdbarch: gdbarch_deprecated_fix_call_dummy invalid");
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n");
- gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fix_call_dummy called\n");
+ gdbarch->deprecated_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
}
void
-set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
- gdbarch_fix_call_dummy_ftype fix_call_dummy)
+set_gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch,
+ gdbarch_deprecated_fix_call_dummy_ftype deprecated_fix_call_dummy)
{
- gdbarch->fix_call_dummy = fix_call_dummy;
+ gdbarch->deprecated_fix_call_dummy = deprecated_fix_call_dummy;
+}
+
+int
+gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->push_dummy_code != 0;
+}
+
+CORE_ADDR
+gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->push_dummy_code == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_push_dummy_code invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
+ return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr);
+}
+
+void
+set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
+ gdbarch_push_dummy_code_ftype push_dummy_code)
+{
+ gdbarch->push_dummy_code = push_dummy_code;
}
int
@@ -4711,7 +4756,7 @@ set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
}
void
-gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
+gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
{
gdb_assert (gdbarch != NULL);
if (gdbarch->remote_translate_xfer_address == 0)
@@ -4719,7 +4764,7 @@ gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_ad
"gdbarch: gdbarch_remote_translate_xfer_address invalid");
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
- gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len);
+ gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len);
}
void
@@ -6203,9 +6248,7 @@ gdbarch_update_p (struct gdbarch_info info)
/* Disassembler */
/* Pointer to the target-dependent disassembly function. */
-int (*tm_print_insn) (bfd_vma, disassemble_info *);
-disassemble_info tm_print_insn_info;
-
+int (*deprecated_tm_print_insn) (bfd_vma, disassemble_info *);
extern void _initialize_gdbarch (void);
@@ -6214,12 +6257,6 @@ _initialize_gdbarch (void)
{
struct cmd_list_element *c;
- INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
- tm_print_insn_info.flavour = bfd_target_unknown_flavour;
- tm_print_insn_info.read_memory_func = dis_asm_read_memory;
- tm_print_insn_info.memory_error_func = dis_asm_memory_error;
- tm_print_insn_info.print_address_func = dis_asm_print_address;
-
add_show_from_set (add_set_cmd ("arch",
class_maintenance,
var_zinteger,
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 7b2641b4c1e..1a8e386e1a0 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -345,20 +345,43 @@ extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftyp
#endif
#endif
+/* This is simply not needed. See value_of_builtin_frame_fp_reg and
+ call_function_by_hand. */
+
+#if defined (DEPRECATED_TARGET_READ_FP)
+/* Legacy for systems yet to multi-arch DEPRECATED_TARGET_READ_FP */
+#if !defined (DEPRECATED_TARGET_READ_FP_P)
+#define DEPRECATED_TARGET_READ_FP_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_TARGET_READ_FP_P)
+#define DEPRECATED_TARGET_READ_FP_P() (0)
+#endif
+
+extern int gdbarch_deprecated_target_read_fp_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_TARGET_READ_FP_P)
+#error "Non multi-arch definition of DEPRECATED_TARGET_READ_FP"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_TARGET_READ_FP_P)
+#define DEPRECATED_TARGET_READ_FP_P() (gdbarch_deprecated_target_read_fp_p (current_gdbarch))
+#endif
+
/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_FP)
-#define TARGET_READ_FP() (generic_target_read_fp ())
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_TARGET_READ_FP)
+#define DEPRECATED_TARGET_READ_FP() (internal_error (__FILE__, __LINE__, "DEPRECATED_TARGET_READ_FP"), 0)
#endif
-typedef CORE_ADDR (gdbarch_read_fp_ftype) (void);
-extern CORE_ADDR gdbarch_read_fp (struct gdbarch *gdbarch);
-extern void set_gdbarch_read_fp (struct gdbarch *gdbarch, gdbarch_read_fp_ftype *read_fp);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_FP)
-#error "Non multi-arch definition of TARGET_READ_FP"
+typedef CORE_ADDR (gdbarch_deprecated_target_read_fp_ftype) (void);
+extern CORE_ADDR gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch, gdbarch_deprecated_target_read_fp_ftype *deprecated_target_read_fp);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_TARGET_READ_FP)
+#error "Non multi-arch definition of DEPRECATED_TARGET_READ_FP"
#endif
#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_FP)
-#define TARGET_READ_FP() (gdbarch_read_fp (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_TARGET_READ_FP)
+#define DEPRECATED_TARGET_READ_FP() (gdbarch_deprecated_target_read_fp (current_gdbarch))
#endif
#endif
@@ -503,19 +526,22 @@ extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
#endif
#endif
+/* This is simply not needed. See value_of_builtin_frame_fp_reg and
+ call_function_by_hand. */
+
/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (FP_REGNUM)
-#define FP_REGNUM (-1)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FP_REGNUM)
+#define DEPRECATED_FP_REGNUM (-1)
#endif
-extern int gdbarch_fp_regnum (struct gdbarch *gdbarch);
-extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP_REGNUM)
-#error "Non multi-arch definition of FP_REGNUM"
+extern int gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, int deprecated_fp_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FP_REGNUM)
+#error "Non multi-arch definition of DEPRECATED_FP_REGNUM"
#endif
#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP_REGNUM)
-#define FP_REGNUM (gdbarch_fp_regnum (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FP_REGNUM)
+#define DEPRECATED_FP_REGNUM (gdbarch_deprecated_fp_regnum (current_gdbarch))
#endif
#endif
@@ -695,15 +721,13 @@ extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register
#endif
#endif
-extern int gdbarch_register_size (struct gdbarch *gdbarch);
-extern void set_gdbarch_register_size (struct gdbarch *gdbarch, int register_size);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIZE)
-#error "Non multi-arch definition of REGISTER_SIZE"
-#endif
-#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIZE)
-#define REGISTER_SIZE (gdbarch_register_size (current_gdbarch))
+extern int gdbarch_deprecated_register_size (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, int deprecated_register_size);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_SIZE)
+#error "Non multi-arch definition of DEPRECATED_REGISTER_SIZE"
#endif
+#if !defined (DEPRECATED_REGISTER_SIZE)
+#define DEPRECATED_REGISTER_SIZE (gdbarch_deprecated_register_size (current_gdbarch))
#endif
extern int gdbarch_register_bytes (struct gdbarch *gdbarch);
@@ -711,10 +735,34 @@ extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_by
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES)
#error "Non multi-arch definition of REGISTER_BYTES"
#endif
-#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES)
+#if !defined (REGISTER_BYTES)
#define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch))
#endif
+
+/* NOTE: cagney/2002-05-02: This function with predicate has a valid
+ (callable) initial value. As a consequence, even when the predicate
+ is false, the corresponding function works. This simplifies the
+ migration process - old code, calling REGISTER_BYTE, doesn't need to
+ be modified. */
+
+#if defined (REGISTER_BYTE)
+/* Legacy for systems yet to multi-arch REGISTER_BYTE */
+#if !defined (REGISTER_BYTE_P)
+#define REGISTER_BYTE_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE_P)
+#define REGISTER_BYTE_P() (0)
+#endif
+
+extern int gdbarch_register_byte_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE_P)
+#error "Non multi-arch definition of REGISTER_BYTE"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE_P)
+#define REGISTER_BYTE_P() (gdbarch_register_byte_p (current_gdbarch))
#endif
/* Default (function) for non- multi-arch platforms. */
@@ -734,10 +782,8 @@ extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register
#endif
#endif
-/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
- MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
- REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
- by REGISTER_TYPE. */
+/* The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
+ REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE. */
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (REGISTER_RAW_SIZE)
@@ -756,10 +802,9 @@ extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_regi
#endif
#endif
-/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
- MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
- REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
- by REGISTER_TYPE. */
+/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
+ DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by
+ MAX_REGISTER_SIZE (a constant). */
#if defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_RAW_SIZE */
@@ -797,10 +842,8 @@ extern void set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarc
#endif
#endif
-/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
- MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
- REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
- by REGISTER_TYPE. */
+/* The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
+ REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE. */
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_SIZE)
@@ -819,10 +862,9 @@ extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_
#endif
#endif
-/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
- MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
- REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
- by REGISTER_TYPE. */
+/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
+ DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by
+ MAX_REGISTER_SIZE (a constant). */
#if defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE */
@@ -860,10 +902,8 @@ extern void set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gd
#endif
#endif
-/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
- MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
- REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE have all being replaced
- by REGISTER_TYPE. */
+/* The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
+ REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE. */
#if defined (REGISTER_VIRTUAL_TYPE)
/* Legacy for systems yet to multi-arch REGISTER_VIRTUAL_TYPE */
@@ -1113,6 +1153,8 @@ extern void set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdb
#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (gdbarch_deprecated_use_generic_dummy_frames (current_gdbarch))
#endif
+/* Replaced by push_dummy_code. */
+
/* Default (value) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_LOCATION)
#define CALL_DUMMY_LOCATION (AT_ENTRY_POINT)
@@ -1127,6 +1169,8 @@ extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_d
#define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch))
#endif
+/* Replaced by push_dummy_code. */
+
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_ADDRESS)
#define CALL_DUMMY_ADDRESS() (entry_point_address ())
@@ -1144,31 +1188,37 @@ extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_cal
#endif
#endif
-extern CORE_ADDR gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch);
-extern void set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_START_OFFSET)
-#error "Non multi-arch definition of CALL_DUMMY_START_OFFSET"
+/* Replaced by push_dummy_code. */
+
+extern CORE_ADDR gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_call_dummy_start_offset);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_START_OFFSET)
+#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_START_OFFSET"
#endif
-#if !defined (CALL_DUMMY_START_OFFSET)
-#define CALL_DUMMY_START_OFFSET (gdbarch_call_dummy_start_offset (current_gdbarch))
+#if !defined (DEPRECATED_CALL_DUMMY_START_OFFSET)
+#define DEPRECATED_CALL_DUMMY_START_OFFSET (gdbarch_deprecated_call_dummy_start_offset (current_gdbarch))
#endif
-extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch);
-extern void set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET)
-#error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET"
+/* Replaced by push_dummy_code. */
+
+extern CORE_ADDR gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_call_dummy_breakpoint_offset);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET)
+#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET"
#endif
-#if !defined (CALL_DUMMY_BREAKPOINT_OFFSET)
-#define CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_call_dummy_breakpoint_offset (current_gdbarch))
+#if !defined (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET)
+#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch))
#endif
-extern int gdbarch_call_dummy_length (struct gdbarch *gdbarch);
-extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dummy_length);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LENGTH)
-#error "Non multi-arch definition of CALL_DUMMY_LENGTH"
+/* Replaced by push_dummy_code. */
+
+extern int gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch, int deprecated_call_dummy_length);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_LENGTH)
+#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_LENGTH"
#endif
-#if !defined (CALL_DUMMY_LENGTH)
-#define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch))
+#if !defined (DEPRECATED_CALL_DUMMY_LENGTH)
+#define DEPRECATED_CALL_DUMMY_LENGTH (gdbarch_deprecated_call_dummy_length (current_gdbarch))
#endif
/* NOTE: cagney/2002-11-24: This function with predicate has a valid
@@ -1214,34 +1264,40 @@ extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gd
#endif
#endif
+/* Replaced by push_dummy_code. */
+
/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_WORDS)
-#define CALL_DUMMY_WORDS (legacy_call_dummy_words)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_WORDS)
+#define DEPRECATED_CALL_DUMMY_WORDS (legacy_call_dummy_words)
#endif
-extern LONGEST * gdbarch_call_dummy_words (struct gdbarch *gdbarch);
-extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * call_dummy_words);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_WORDS)
-#error "Non multi-arch definition of CALL_DUMMY_WORDS"
+extern LONGEST * gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch, LONGEST * deprecated_call_dummy_words);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_WORDS)
+#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_WORDS"
#endif
-#if !defined (CALL_DUMMY_WORDS)
-#define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch))
+#if !defined (DEPRECATED_CALL_DUMMY_WORDS)
+#define DEPRECATED_CALL_DUMMY_WORDS (gdbarch_deprecated_call_dummy_words (current_gdbarch))
#endif
+/* Replaced by push_dummy_code. */
+
/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (SIZEOF_CALL_DUMMY_WORDS)
-#define SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
+#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words)
#endif
-extern int gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch);
-extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int sizeof_call_dummy_words);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIZEOF_CALL_DUMMY_WORDS)
-#error "Non multi-arch definition of SIZEOF_CALL_DUMMY_WORDS"
+extern int gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch, int deprecated_sizeof_call_dummy_words);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
+#error "Non multi-arch definition of DEPRECATED_SIZEOF_CALL_DUMMY_WORDS"
#endif
-#if !defined (SIZEOF_CALL_DUMMY_WORDS)
-#define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch))
+#if !defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
+#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS (gdbarch_deprecated_sizeof_call_dummy_words (current_gdbarch))
#endif
+/* Replaced by push_dummy_code. */
+
#if defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST)
/* Legacy for systems yet to multi-arch DEPRECATED_CALL_DUMMY_STACK_ADJUST */
#if !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P)
@@ -1278,43 +1334,53 @@ extern void set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdba
#endif
#endif
-#if defined (FIX_CALL_DUMMY)
-/* Legacy for systems yet to multi-arch FIX_CALL_DUMMY */
-#if !defined (FIX_CALL_DUMMY_P)
-#define FIX_CALL_DUMMY_P() (1)
+/* Replaced by push_dummy_code. */
+
+#if defined (DEPRECATED_FIX_CALL_DUMMY)
+/* Legacy for systems yet to multi-arch DEPRECATED_FIX_CALL_DUMMY */
+#if !defined (DEPRECATED_FIX_CALL_DUMMY_P)
+#define DEPRECATED_FIX_CALL_DUMMY_P() (1)
#endif
#endif
/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (FIX_CALL_DUMMY_P)
-#define FIX_CALL_DUMMY_P() (0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FIX_CALL_DUMMY_P)
+#define DEPRECATED_FIX_CALL_DUMMY_P() (0)
#endif
-extern int gdbarch_fix_call_dummy_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY_P)
-#error "Non multi-arch definition of FIX_CALL_DUMMY"
+extern int gdbarch_deprecated_fix_call_dummy_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FIX_CALL_DUMMY_P)
+#error "Non multi-arch definition of DEPRECATED_FIX_CALL_DUMMY"
#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY_P)
-#define FIX_CALL_DUMMY_P() (gdbarch_fix_call_dummy_p (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FIX_CALL_DUMMY_P)
+#define DEPRECATED_FIX_CALL_DUMMY_P() (gdbarch_deprecated_fix_call_dummy_p (current_gdbarch))
#endif
/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (FIX_CALL_DUMMY)
-#define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (internal_error (__FILE__, __LINE__, "FIX_CALL_DUMMY"), 0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FIX_CALL_DUMMY)
+#define DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (internal_error (__FILE__, __LINE__, "DEPRECATED_FIX_CALL_DUMMY"), 0)
#endif
-typedef void (gdbarch_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
-extern void gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
-extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY)
-#error "Non multi-arch definition of FIX_CALL_DUMMY"
+typedef void (gdbarch_deprecated_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
+extern void gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
+extern void set_gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_fix_call_dummy_ftype *deprecated_fix_call_dummy);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FIX_CALL_DUMMY)
+#error "Non multi-arch definition of DEPRECATED_FIX_CALL_DUMMY"
#endif
#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY)
-#define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FIX_CALL_DUMMY)
+#define DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_deprecated_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p))
#endif
#endif
+/* This is a replacement for DEPRECATED_FIX_CALL_DUMMY et.al. */
+
+extern int gdbarch_push_dummy_code_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr);
+extern CORE_ADDR gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr);
+extern void set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype *push_dummy_code);
+
#if defined (DEPRECATED_INIT_FRAME_PC_FIRST)
/* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC_FIRST */
#if !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
@@ -2187,22 +2253,9 @@ extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADD
#endif
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (REMOTE_TRANSLATE_XFER_ADDRESS)
-#define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (generic_remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len))
-#endif
-
-typedef void (gdbarch_remote_translate_xfer_address_ftype) (CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
-extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
+typedef void (gdbarch_remote_translate_xfer_address_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
+extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REMOTE_TRANSLATE_XFER_ADDRESS)
-#error "Non multi-arch definition of REMOTE_TRANSLATE_XFER_ADDRESS"
-#endif
-#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REMOTE_TRANSLATE_XFER_ADDRESS)
-#define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (gdbarch_remote_translate_xfer_address (current_gdbarch, gdb_addr, gdb_len, rem_addr, rem_len))
-#endif
-#endif
extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch);
extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip);
@@ -3355,22 +3408,11 @@ extern const struct bfd_arch_info *target_architecture;
/* The target-system-dependent disassembler is semi-dynamic */
-extern int dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr,
- unsigned int len, disassemble_info *info);
-
-extern void dis_asm_memory_error (int status, bfd_vma memaddr,
- disassemble_info *info);
-
-extern void dis_asm_print_address (bfd_vma addr,
- disassemble_info *info);
-
-extern int (*tm_print_insn) (bfd_vma, disassemble_info*);
-extern disassemble_info tm_print_insn_info;
-#ifndef TARGET_PRINT_INSN_INFO
-#define TARGET_PRINT_INSN_INFO (&tm_print_insn_info)
-#endif
-
+/* Use gdb_disassemble, and gdbarch_print_insn instead. */
+extern int (*deprecated_tm_print_insn) (bfd_vma, disassemble_info*);
+/* Use set_gdbarch_print_insn instead. */
+extern disassemble_info deprecated_tm_print_insn_info;
/* Set the dynamic target-system-dependent parameters (architecture,
byte-order, ...) using information found in the BFD */
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 7a17b63c3d9..16165a9858a 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -428,7 +428,9 @@ v:2:TARGET_CHAR_SIGNED:int:char_signed::::1:-1:1::::
#
f:2:TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid::0:generic_target_read_pc::0
f:2:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, ptid_t ptid:val, ptid::0:generic_target_write_pc::0
-f:2:TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:generic_target_read_fp::0
+# This is simply not needed. See value_of_builtin_frame_fp_reg and
+# call_function_by_hand.
+F::DEPRECATED_TARGET_READ_FP:CORE_ADDR:deprecated_target_read_fp:void
f:2:TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:generic_target_read_sp::0
# The dummy call frame SP should be set by push_dummy_call.
F:2:DEPRECATED_DUMMY_WRITE_SP:void:deprecated_dummy_write_sp:CORE_ADDR val:val
@@ -451,7 +453,9 @@ v:2:NUM_PSEUDO_REGS:int:num_pseudo_regs::::0:0::0:::
# a real register or a pseudo (computed) register or not be defined at
# all (-1).
v:2:SP_REGNUM:int:sp_regnum::::-1:-1::0
-v:2:FP_REGNUM:int:fp_regnum::::-1:-1::0
+# This is simply not needed. See value_of_builtin_frame_fp_reg and
+# call_function_by_hand.
+v:2:DEPRECATED_FP_REGNUM:int:deprecated_fp_regnum::::-1:-1::0
v:2:PC_REGNUM:int:pc_regnum::::-1:-1::0
v:2:PS_REGNUM:int:ps_regnum::::-1:-1::0
v:2:FP0_REGNUM:int:fp0_regnum::::0:-1::0
@@ -468,33 +472,30 @@ f:2:DWARF_REG_TO_REGNUM:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr:::no
f:2:SDB_REG_TO_REGNUM:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr:::no_op_reg_to_regnum::0
f:2:DWARF2_REG_TO_REGNUM:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr:::no_op_reg_to_regnum::0
f:2:REGISTER_NAME:const char *:register_name:int regnr:regnr:::legacy_register_name::0
-v:2:REGISTER_SIZE:int:register_size::::0:-1
-v:2:REGISTER_BYTES:int:register_bytes::::0:-1
-f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte::0
-# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
-# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
-# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
-# by REGISTER_TYPE.
+v::DEPRECATED_REGISTER_SIZE:int:deprecated_register_size
+v::REGISTER_BYTES:int:register_bytes
+# NOTE: cagney/2002-05-02: This function with predicate has a valid
+# (callable) initial value. As a consequence, even when the predicate
+# is false, the corresponding function works. This simplifies the
+# migration process - old code, calling REGISTER_BYTE, doesn't need to
+# be modified.
+F::REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte
+# The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
+# REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE.
f:2:REGISTER_RAW_SIZE:int:register_raw_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0
-# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
-# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
-# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
-# by REGISTER_TYPE.
+# The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
+# DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by
+# MAX_REGISTER_SIZE (a constant).
V:2:DEPRECATED_MAX_REGISTER_RAW_SIZE:int:deprecated_max_register_raw_size
-# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
-# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
-# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
-# by REGISTER_TYPE.
+# The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
+# REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE.
f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0
-# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
-# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
-# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
-# by REGISTER_TYPE.
+# The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
+# DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by
+# MAX_REGISTER_SIZE (a constant).
V:2:DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE:int:deprecated_max_register_virtual_size
-# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
-# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
-# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE have all being replaced
-# by REGISTER_TYPE.
+# The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
+# REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE.
F:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0
M:2:REGISTER_TYPE:struct type *:register_type:int reg_nr:reg_nr::0:
#
@@ -519,21 +520,32 @@ F:2:GET_LONGJMP_TARGET:int:get_longjmp_target:CORE_ADDR *pc:pc::0:0
# reqires that these methods be set up from the word go. This also
# avoids any potential problems with moving beyond multi-arch partial.
v::DEPRECATED_USE_GENERIC_DUMMY_FRAMES:int:deprecated_use_generic_dummy_frames:::::1::0
+# Replaced by push_dummy_code.
v::CALL_DUMMY_LOCATION:int:call_dummy_location:::::AT_ENTRY_POINT::0
+# Replaced by push_dummy_code.
f::CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void::::entry_point_address::0
-v::CALL_DUMMY_START_OFFSET:CORE_ADDR:call_dummy_start_offset
-v::CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset
-v::CALL_DUMMY_LENGTH:int:call_dummy_length
+# Replaced by push_dummy_code.
+v::DEPRECATED_CALL_DUMMY_START_OFFSET:CORE_ADDR:deprecated_call_dummy_start_offset
+# Replaced by push_dummy_code.
+v::DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:deprecated_call_dummy_breakpoint_offset
+# Replaced by push_dummy_code.
+v::DEPRECATED_CALL_DUMMY_LENGTH:int:deprecated_call_dummy_length
# NOTE: cagney/2002-11-24: This function with predicate has a valid
# (callable) initial value. As a consequence, even when the predicate
# is false, the corresponding function works. This simplifies the
# migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(),
# doesn't need to be modified.
F::DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::generic_pc_in_call_dummy:generic_pc_in_call_dummy
-v::CALL_DUMMY_WORDS:LONGEST *:call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx
-v::SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0
+# Replaced by push_dummy_code.
+v::DEPRECATED_CALL_DUMMY_WORDS:LONGEST *:deprecated_call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx
+# Replaced by push_dummy_code.
+v::DEPRECATED_SIZEOF_CALL_DUMMY_WORDS:int:deprecated_sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0
+# Replaced by push_dummy_code.
V:2:DEPRECATED_CALL_DUMMY_STACK_ADJUST:int:deprecated_call_dummy_stack_adjust::::0
-F::FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p
+# Replaced by push_dummy_code.
+F::DEPRECATED_FIX_CALL_DUMMY:void:deprecated_fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p
+# This is a replacement for DEPRECATED_FIX_CALL_DUMMY et.al.
+M::PUSH_DUMMY_CODE:CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr:sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr:
F:2:DEPRECATED_INIT_FRAME_PC_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev
F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev
#
@@ -586,7 +598,7 @@ v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1
f:2:PREPARE_TO_PROCEED:int:prepare_to_proceed:int select_it:select_it::0:default_prepare_to_proceed::0
v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:-1
#
-f:2:REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0
+m::REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:regcache, gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0
#
v:2:FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:-1
f:2:FRAMELESS_FUNCTION_INVOCATION:int:frameless_function_invocation:struct frame_info *fi:fi:::generic_frameless_function_invocation_not::0
@@ -1209,22 +1221,11 @@ extern const struct bfd_arch_info *target_architecture;
/* The target-system-dependent disassembler is semi-dynamic */
-extern int dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr,
- unsigned int len, disassemble_info *info);
-
-extern void dis_asm_memory_error (int status, bfd_vma memaddr,
- disassemble_info *info);
-
-extern void dis_asm_print_address (bfd_vma addr,
- disassemble_info *info);
-
-extern int (*tm_print_insn) (bfd_vma, disassemble_info*);
-extern disassemble_info tm_print_insn_info;
-#ifndef TARGET_PRINT_INSN_INFO
-#define TARGET_PRINT_INSN_INFO (&tm_print_insn_info)
-#endif
-
+/* Use gdb_disassemble, and gdbarch_print_insn instead. */
+extern int (*deprecated_tm_print_insn) (bfd_vma, disassemble_info*);
+/* Use set_gdbarch_print_insn instead. */
+extern disassemble_info deprecated_tm_print_insn_info;
/* Set the dynamic target-system-dependent parameters (architecture,
byte-order, ...) using information found in the BFD */
@@ -2377,9 +2378,7 @@ gdbarch_update_p (struct gdbarch_info info)
/* Disassembler */
/* Pointer to the target-dependent disassembly function. */
-int (*tm_print_insn) (bfd_vma, disassemble_info *);
-disassemble_info tm_print_insn_info;
-
+int (*deprecated_tm_print_insn) (bfd_vma, disassemble_info *);
extern void _initialize_gdbarch (void);
@@ -2388,12 +2387,6 @@ _initialize_gdbarch (void)
{
struct cmd_list_element *c;
- INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
- tm_print_insn_info.flavour = bfd_target_unknown_flavour;
- tm_print_insn_info.read_memory_func = dis_asm_read_memory;
- tm_print_insn_info.memory_error_func = dis_asm_memory_error;
- tm_print_insn_info.print_address_func = dis_asm_print_address;
-
add_show_from_set (add_set_cmd ("arch",
class_maintenance,
var_zinteger,
diff --git a/gdb/gdbcmd.h b/gdb/gdbcmd.h
index e626eb5f9e4..8c4490ec940 100644
--- a/gdb/gdbcmd.h
+++ b/gdb/gdbcmd.h
@@ -98,10 +98,6 @@ extern struct cmd_list_element *maintenanceinfolist;
extern struct cmd_list_element *maintenanceprintlist;
-/* Chain containing all defined "maintenance list" subcommands. */
-
-extern struct cmd_list_element *maintenancelistlist;
-
extern struct cmd_list_element *setprintlist;
extern struct cmd_list_element *showprintlist;
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 63ec899245a..9df8a2a4807 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2003-04-24 Andrew Cagney <cagney@redhat.com>
+
+ * low-nbsd.c (fetch_inferior_registers):
+ (store_inferior_registers):
+
2003-03-26 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c (linux_create_inferior): Use __SIGRTMIN.
diff --git a/gdb/gdbserver/low-nbsd.c b/gdb/gdbserver/low-nbsd.c
index 9046d635604..8bec0d98e57 100644
--- a/gdb/gdbserver/low-nbsd.c
+++ b/gdb/gdbserver/low-nbsd.c
@@ -394,7 +394,7 @@ fetch_inferior_registers (int regno)
RF (R0_REGNUM + 7, inferior_registers.r_r7);
RF (SP_REGNUM, inferior_registers.r_sp);
- RF (FP_REGNUM, inferior_registers.r_fp);
+ RF (DEPRECATED_FP_REGNUM, inferior_registers.r_fp);
RF (PC_REGNUM, inferior_registers.r_pc);
RF (PS_REGNUM, inferior_registers.r_psr);
@@ -429,7 +429,7 @@ store_inferior_registers (int regno)
RS (R0_REGNUM + 7, inferior_registers.r_r7);
RS (SP_REGNUM, inferior_registers.r_sp);
- RS (FP_REGNUM, inferior_registers.r_fp);
+ RS (DEPRECATED_FP_REGNUM, inferior_registers.r_fp);
RS (PC_REGNUM, inferior_registers.r_pc);
RS (PS_REGNUM, inferior_registers.r_psr);
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index f336d91f48d..09dea26ca8c 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -44,7 +44,6 @@ struct thread_info
int num; /* Convenient handle (GDB thread id) */
/* State from wait_for_inferior */
CORE_ADDR prev_pc;
- char *prev_func_name;
struct breakpoint *step_resume_breakpoint;
struct breakpoint *through_sigtramp_breakpoint;
CORE_ADDR step_range_start;
@@ -117,7 +116,6 @@ extern struct thread_info *iterate_over_threads (thread_callback_func, void *);
/* infrun context switch: save the debugger state for the given thread. */
extern void save_infrun_state (ptid_t ptid,
CORE_ADDR prev_pc,
- char *prev_func_name,
int trap_expected,
struct breakpoint *step_resume_breakpoint,
struct breakpoint *through_sigtramp_breakpoint,
@@ -137,7 +135,6 @@ extern void save_infrun_state (ptid_t ptid,
for the given thread. */
extern void load_infrun_state (ptid_t ptid,
CORE_ADDR *prev_pc,
- char **prev_func_name,
int *trap_expected,
struct breakpoint **step_resume_breakpoint,
struct breakpoint **through_sigtramp_breakpoint,
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 2423a9a40a5..3e12afdb7ff 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -1101,10 +1101,10 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_num_regs (gdbarch, E_NUM_REGS);
set_gdbarch_num_pseudo_regs (gdbarch, 0);
set_gdbarch_sp_regnum (gdbarch, E_SP_REGNUM);
- set_gdbarch_fp_regnum (gdbarch, E_FP_REGNUM);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, E_FP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
set_gdbarch_register_name (gdbarch, h8300_register_name);
- set_gdbarch_register_size (gdbarch, BINWORD);
+ set_gdbarch_deprecated_register_size (gdbarch, BINWORD);
set_gdbarch_register_bytes (gdbarch, E_NUM_REGS * BINWORD);
set_gdbarch_register_byte (gdbarch, h8300_register_byte);
set_gdbarch_register_raw_size (gdbarch, h8300_register_raw_size);
@@ -1156,8 +1156,8 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_store_return_value (gdbarch, h8300_store_return_value);
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, h8300_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, h8300_use_struct_convention);
- set_gdbarch_call_dummy_words (gdbarch, call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_breakpoint_from_pc (gdbarch, h8300_breakpoint_from_pc);
set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT);
@@ -1177,6 +1177,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
void
_initialize_h8300_tdep (void)
{
- tm_print_insn = gdb_print_insn_h8300;
+ deprecated_tm_print_insn = gdb_print_insn_h8300;
register_gdbarch_init (bfd_arch_h8300, h8300_gdbarch_init);
}
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 27cfedfd648..d524bae33c1 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -36,6 +36,7 @@
#include "infttrace.h"
/* For argument passing to the inferior */
#include "symtab.h"
+#include "infcall.h"
#ifdef USG
#include <sys/types.h>
@@ -199,7 +200,7 @@ extern int exception_catchpoints_are_fragile;
int
hppa_use_struct_convention (int gcc_p, struct type *type)
{
- return (TYPE_LENGTH (type) > 2 * REGISTER_SIZE);
+ return (TYPE_LENGTH (type) > 2 * DEPRECATED_REGISTER_SIZE);
}
@@ -903,16 +904,16 @@ hppa_frame_saved_pc (struct frame_info *frame)
/* A call dummy is sized in words, but it is actually a
series of instructions. Account for that scaling
factor. */
- + ((REGISTER_SIZE / INSTRUCTION_SIZE)
- * CALL_DUMMY_LENGTH)
+ + ((DEPRECATED_REGISTER_SIZE / INSTRUCTION_SIZE)
+ * DEPRECATED_CALL_DUMMY_LENGTH)
/* Similarly we have to account for 64bit wide register
saves. */
- + (32 * REGISTER_SIZE)
+ + (32 * DEPRECATED_REGISTER_SIZE)
/* We always consider FP regs 8 bytes long. */
+ (NUM_REGS - FP0_REGNUM) * 8
/* Similarly we have to account for 64bit wide register
saves. */
- + (6 * REGISTER_SIZE)))))
+ + (6 * DEPRECATED_REGISTER_SIZE)))))
{
return read_memory_integer ((get_frame_base (frame)
+ (TARGET_PTR_BIT == 64 ? -16 : -20)),
@@ -1084,7 +1085,7 @@ hppa_init_extra_frame_info (int fromleaf, struct frame_info *frame)
frame. (we always want frame->frame to point at the lowest address
in the frame). */
if (framesize == -1)
- deprecated_update_frame_base_hack (frame, TARGET_READ_FP ());
+ deprecated_update_frame_base_hack (frame, deprecated_read_fp ());
else
deprecated_update_frame_base_hack (frame, get_frame_base (frame) - framesize);
return;
@@ -1105,7 +1106,7 @@ hppa_init_extra_frame_info (int fromleaf, struct frame_info *frame)
sorts, and its base is the high address in its parent's frame. */
framesize = find_proc_framesize (get_frame_pc (frame));
if (framesize == -1)
- deprecated_update_frame_base_hack (frame, TARGET_READ_FP ());
+ deprecated_update_frame_base_hack (frame, deprecated_read_fp ());
else
deprecated_update_frame_base_hack (frame, read_register (SP_REGNUM) - framesize);
}
@@ -1263,7 +1264,7 @@ hppa_frame_chain (struct frame_info *frame)
saved_regs_frame = tmp_frame;
/* If we have an address for r3, that's good. */
- if (saved_regs[FP_REGNUM])
+ if (saved_regs[DEPRECATED_FP_REGNUM])
break;
}
}
@@ -1325,7 +1326,7 @@ hppa_frame_chain (struct frame_info *frame)
u = find_unwind_entry (DEPRECATED_FRAME_SAVED_PC (frame));
if (!u)
{
- return read_memory_integer (saved_regs[FP_REGNUM],
+ return read_memory_integer (saved_regs[DEPRECATED_FP_REGNUM],
TARGET_PTR_BIT / 8);
}
else
@@ -1334,7 +1335,7 @@ hppa_frame_chain (struct frame_info *frame)
}
}
- return read_memory_integer (saved_regs[FP_REGNUM],
+ return read_memory_integer (saved_regs[DEPRECATED_FP_REGNUM],
TARGET_PTR_BIT / 8);
}
}
@@ -1363,7 +1364,7 @@ hppa_frame_chain (struct frame_info *frame)
u = find_unwind_entry (DEPRECATED_FRAME_SAVED_PC (frame));
if (!u)
{
- return read_memory_integer (saved_regs[FP_REGNUM],
+ return read_memory_integer (saved_regs[DEPRECATED_FP_REGNUM],
TARGET_PTR_BIT / 8);
}
else
@@ -1374,7 +1375,7 @@ hppa_frame_chain (struct frame_info *frame)
/* The value in %r3 was never saved into the stack (thus %r3 still
holds the value of the previous frame pointer). */
- return TARGET_READ_FP ();
+ return deprecated_read_fp ();
}
}
@@ -1466,24 +1467,24 @@ hppa_push_dummy_frame (void)
/* The 32bit and 64bit ABIs save the return pointer into different
stack slots. */
- if (REGISTER_SIZE == 8)
- write_memory (sp - 16, (char *) &int_buffer, REGISTER_SIZE);
+ if (DEPRECATED_REGISTER_SIZE == 8)
+ write_memory (sp - 16, (char *) &int_buffer, DEPRECATED_REGISTER_SIZE);
else
- write_memory (sp - 20, (char *) &int_buffer, REGISTER_SIZE);
+ write_memory (sp - 20, (char *) &int_buffer, DEPRECATED_REGISTER_SIZE);
- int_buffer = TARGET_READ_FP ();
- write_memory (sp, (char *) &int_buffer, REGISTER_SIZE);
+ int_buffer = deprecated_read_fp ();
+ write_memory (sp, (char *) &int_buffer, DEPRECATED_REGISTER_SIZE);
- write_register (FP_REGNUM, sp);
+ write_register (DEPRECATED_FP_REGNUM, sp);
- sp += 2 * REGISTER_SIZE;
+ sp += 2 * DEPRECATED_REGISTER_SIZE;
for (regnum = 1; regnum < 32; regnum++)
- if (regnum != RP_REGNUM && regnum != FP_REGNUM)
+ if (regnum != RP_REGNUM && regnum != DEPRECATED_FP_REGNUM)
sp = push_word (sp, read_register (regnum));
/* This is not necessary for the 64bit ABI. In fact it is dangerous. */
- if (REGISTER_SIZE != 8)
+ if (DEPRECATED_REGISTER_SIZE != 8)
sp += 4;
for (regnum = FP0_REGNUM; regnum < NUM_REGS; regnum++)
@@ -1509,37 +1510,37 @@ find_dummy_frame_regs (struct frame_info *frame,
int i;
/* The 32bit and 64bit ABIs save RP into different locations. */
- if (REGISTER_SIZE == 8)
+ if (DEPRECATED_REGISTER_SIZE == 8)
frame_saved_regs[RP_REGNUM] = (fp - 16) & ~0x3;
else
frame_saved_regs[RP_REGNUM] = (fp - 20) & ~0x3;
- frame_saved_regs[FP_REGNUM] = fp;
+ frame_saved_regs[DEPRECATED_FP_REGNUM] = fp;
- frame_saved_regs[1] = fp + (2 * REGISTER_SIZE);
+ frame_saved_regs[1] = fp + (2 * DEPRECATED_REGISTER_SIZE);
- for (fp += 3 * REGISTER_SIZE, i = 3; i < 32; i++)
+ for (fp += 3 * DEPRECATED_REGISTER_SIZE, i = 3; i < 32; i++)
{
- if (i != FP_REGNUM)
+ if (i != DEPRECATED_FP_REGNUM)
{
frame_saved_regs[i] = fp;
- fp += REGISTER_SIZE;
+ fp += DEPRECATED_REGISTER_SIZE;
}
}
/* This is not necessary or desirable for the 64bit ABI. */
- if (REGISTER_SIZE != 8)
+ if (DEPRECATED_REGISTER_SIZE != 8)
fp += 4;
for (i = FP0_REGNUM; i < NUM_REGS; i++, fp += 8)
frame_saved_regs[i] = fp;
frame_saved_regs[IPSW_REGNUM] = fp;
- frame_saved_regs[SAR_REGNUM] = fp + REGISTER_SIZE;
- frame_saved_regs[PCOQ_HEAD_REGNUM] = fp + 2 * REGISTER_SIZE;
- frame_saved_regs[PCSQ_HEAD_REGNUM] = fp + 3 * REGISTER_SIZE;
- frame_saved_regs[PCOQ_TAIL_REGNUM] = fp + 4 * REGISTER_SIZE;
- frame_saved_regs[PCSQ_TAIL_REGNUM] = fp + 5 * REGISTER_SIZE;
+ frame_saved_regs[SAR_REGNUM] = fp + DEPRECATED_REGISTER_SIZE;
+ frame_saved_regs[PCOQ_HEAD_REGNUM] = fp + 2 * DEPRECATED_REGISTER_SIZE;
+ frame_saved_regs[PCSQ_HEAD_REGNUM] = fp + 3 * DEPRECATED_REGISTER_SIZE;
+ frame_saved_regs[PCOQ_TAIL_REGNUM] = fp + 4 * DEPRECATED_REGISTER_SIZE;
+ frame_saved_regs[PCSQ_TAIL_REGNUM] = fp + 5 * DEPRECATED_REGISTER_SIZE;
}
void
@@ -1563,7 +1564,7 @@ hppa_pop_frame (void)
for (regnum = 31; regnum > 0; regnum--)
if (fsr[regnum])
write_register (regnum, read_memory_integer (fsr[regnum],
- REGISTER_SIZE));
+ DEPRECATED_REGISTER_SIZE));
for (regnum = NUM_REGS - 1; regnum >= FP0_REGNUM; regnum--)
if (fsr[regnum])
@@ -1576,18 +1577,18 @@ hppa_pop_frame (void)
if (fsr[IPSW_REGNUM])
write_register (IPSW_REGNUM,
read_memory_integer (fsr[IPSW_REGNUM],
- REGISTER_SIZE));
+ DEPRECATED_REGISTER_SIZE));
if (fsr[SAR_REGNUM])
write_register (SAR_REGNUM,
read_memory_integer (fsr[SAR_REGNUM],
- REGISTER_SIZE));
+ DEPRECATED_REGISTER_SIZE));
/* If the PC was explicitly saved, then just restore it. */
if (fsr[PCOQ_TAIL_REGNUM])
{
npc = read_memory_integer (fsr[PCOQ_TAIL_REGNUM],
- REGISTER_SIZE);
+ DEPRECATED_REGISTER_SIZE);
write_register (PCOQ_TAIL_REGNUM, npc);
}
/* Else use the value in %rp to set the new PC. */
@@ -1597,7 +1598,7 @@ hppa_pop_frame (void)
write_pc (npc);
}
- write_register (FP_REGNUM, read_memory_integer (fp, REGISTER_SIZE));
+ write_register (DEPRECATED_FP_REGNUM, read_memory_integer (fp, DEPRECATED_REGISTER_SIZE));
if (fsr[IPSW_REGNUM]) /* call dummy */
write_register (SP_REGNUM, fp - 48);
@@ -1666,7 +1667,7 @@ restore_pc_queue (CORE_ADDR *fsr)
right place. */
write_register (21, read_memory_integer (fsr[PCSQ_HEAD_REGNUM],
- REGISTER_SIZE));
+ DEPRECATED_REGISTER_SIZE));
write_register (22, new_pc);
for (insn_count = 0; insn_count < 3; insn_count++)
@@ -1746,7 +1747,7 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
the left. We do this by promoting them to full-width,
although the ABI says to pad them with garbage. */
if (is_integral_type (arg_type)
- && TYPE_LENGTH (arg_type) < REGISTER_SIZE)
+ && TYPE_LENGTH (arg_type) < DEPRECATED_REGISTER_SIZE)
{
args[i] = value_cast ((TYPE_UNSIGNED (arg_type)
? builtin_type_unsigned_long
@@ -1759,7 +1760,7 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* Align the size of the argument to the word size for this
target. */
- bytes_reserved = (lengths[i] + REGISTER_SIZE - 1) & -REGISTER_SIZE;
+ bytes_reserved = (lengths[i] + DEPRECATED_REGISTER_SIZE - 1) & -DEPRECATED_REGISTER_SIZE;
offset[i] = cum_bytes_reserved;
@@ -1771,8 +1772,8 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
if (bytes_reserved > 8)
{
/* Round up the offset to a multiple of two slots. */
- int new_offset = ((offset[i] + 2*REGISTER_SIZE-1)
- & -(2*REGISTER_SIZE));
+ int new_offset = ((offset[i] + 2*DEPRECATED_REGISTER_SIZE-1)
+ & -(2*DEPRECATED_REGISTER_SIZE));
/* Note the space we've wasted, if any. */
bytes_reserved += new_offset - offset[i];
@@ -1859,15 +1860,15 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* Align the size of the argument to the word size for this
target. */
- bytes_reserved = (lengths[i] + REGISTER_SIZE - 1) & -REGISTER_SIZE;
+ bytes_reserved = (lengths[i] + DEPRECATED_REGISTER_SIZE - 1) & -DEPRECATED_REGISTER_SIZE;
offset[i] = (cum_bytes_reserved
+ (lengths[i] > 4 ? bytes_reserved : lengths[i]));
/* If the argument is a double word argument, then it needs to be
double word aligned. */
- if ((bytes_reserved == 2 * REGISTER_SIZE)
- && (offset[i] % 2 * REGISTER_SIZE))
+ if ((bytes_reserved == 2 * DEPRECATED_REGISTER_SIZE)
+ && (offset[i] % 2 * DEPRECATED_REGISTER_SIZE))
{
int new_offset = 0;
/* BYTES_RESERVED is already aligned to the word, so we put
@@ -1875,13 +1876,13 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
This will leave one empty word on the stack, and one unused
register as mandated by the ABI. */
- new_offset = ((offset[i] + 2 * REGISTER_SIZE - 1)
- & -(2 * REGISTER_SIZE));
+ new_offset = ((offset[i] + 2 * DEPRECATED_REGISTER_SIZE - 1)
+ & -(2 * DEPRECATED_REGISTER_SIZE));
- if ((new_offset - offset[i]) >= 2 * REGISTER_SIZE)
+ if ((new_offset - offset[i]) >= 2 * DEPRECATED_REGISTER_SIZE)
{
- bytes_reserved += REGISTER_SIZE;
- offset[i] += REGISTER_SIZE;
+ bytes_reserved += DEPRECATED_REGISTER_SIZE;
+ offset[i] += DEPRECATED_REGISTER_SIZE;
}
}
@@ -2036,9 +2037,9 @@ cover_find_stub_with_shl_get (void *args_untyped)
into a call sequence of the above form stored at DUMMYNAME.
On the hppa we need to call the stack dummy through $$dyncall.
- Therefore our version of FIX_CALL_DUMMY takes an extra argument,
- real_pc, which is the location where gdb should start up the
- inferior to do the function call.
+ Therefore our version of DEPRECATED_FIX_CALL_DUMMY takes an extra
+ argument, real_pc, which is the location where gdb should start up
+ the inferior to do the function call.
This has to work across several versions of hpux, bsd, osf1. It has to
work regardless of what compiler was used to build the inferior program.
@@ -2194,7 +2195,7 @@ hppa_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
at *(fun+4). Note the call dummy is *NOT* allowed to
trash %r19 before calling the target function. */
write_register (19, read_memory_integer ((fun & ~0x3) + 4,
- REGISTER_SIZE));
+ DEPRECATED_REGISTER_SIZE));
/* Now get the real address for the function we are calling, it's
at *fun. */
@@ -2441,8 +2442,8 @@ hppa_read_fp (int pid)
}
/* This is the only site that may directly read_register () the FP
- register. All others must use TARGET_READ_FP (). */
- return read_register (FP_REGNUM);
+ register. All others must use deprecated_read_fp (). */
+ return read_register (DEPRECATED_FP_REGNUM);
}
CORE_ADDR
@@ -2629,7 +2630,7 @@ pa_register_look_aside (char *raw_regs, int regnum, long *raw_val)
int start;
- char *buf = alloca (max_register_size (current_gdbarch));
+ char buf[MAX_REGISTER_SIZE];
long long reg_val;
if (!know_which)
@@ -2826,8 +2827,8 @@ pa_strcat_registers (char *raw_regs, int regnum, int fpregs,
static void
pa_print_fp_reg (int i)
{
- char *raw_buffer = alloca (max_register_size (current_gdbarch));
- char *virtual_buffer = alloca (max_register_size (current_gdbarch));
+ char raw_buffer[MAX_REGISTER_SIZE];
+ char virtual_buffer[MAX_REGISTER_SIZE];
/* Get 32bits of data. */
frame_register_read (deprecated_selected_frame, i, raw_buffer);
@@ -2869,8 +2870,8 @@ pa_print_fp_reg (int i)
static void
pa_strcat_fp_reg (int i, struct ui_file *stream, enum precision_type precision)
{
- char *raw_buffer = alloca (max_register_size (current_gdbarch));
- char *virtual_buffer = alloca (max_register_size (current_gdbarch));
+ char raw_buffer[MAX_REGISTER_SIZE];
+ char virtual_buffer[MAX_REGISTER_SIZE];
fputs_filtered (REGISTER_NAME (i), stream);
print_spaces_filtered (8 - strlen (REGISTER_NAME (i)), stream);
@@ -2884,7 +2885,7 @@ pa_strcat_fp_reg (int i, struct ui_file *stream, enum precision_type precision)
if (precision == double_precision && (i % 2) == 0)
{
- char *raw_buf = alloca (max_register_size (current_gdbarch));
+ char raw_buf[MAX_REGISTER_SIZE];
/* Get the data in raw format for the 2nd half. */
frame_register_read (deprecated_selected_frame, i + 1, raw_buf);
@@ -3589,7 +3590,7 @@ restart:
for (i = 3; i < u->Entry_GR + 3; i++)
{
/* Frame pointer gets saved into a special location. */
- if (u->Save_SP && i == FP_REGNUM)
+ if (u->Save_SP && i == DEPRECATED_FP_REGNUM)
continue;
save_gr |= (1 << i);
@@ -3881,16 +3882,16 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
/* A call dummy is sized in words, but it is actually a
series of instructions. Account for that scaling
factor. */
- + ((REGISTER_SIZE / INSTRUCTION_SIZE)
- * CALL_DUMMY_LENGTH)
+ + ((DEPRECATED_REGISTER_SIZE / INSTRUCTION_SIZE)
+ * DEPRECATED_CALL_DUMMY_LENGTH)
/* Similarly we have to account for 64bit wide register
saves. */
- + (32 * REGISTER_SIZE)
+ + (32 * DEPRECATED_REGISTER_SIZE)
/* We always consider FP regs 8 bytes long. */
+ (NUM_REGS - FP0_REGNUM) * 8
/* Similarly we have to account for 64bit wide register
saves. */
- + (6 * REGISTER_SIZE)))))
+ + (6 * DEPRECATED_REGISTER_SIZE)))))
find_dummy_frame_regs (frame_info, frame_saved_regs);
/* Interrupt handlers are special too. They lay out the register
@@ -3940,7 +3941,7 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
for (i = 3; i < u->Entry_GR + 3; i++)
{
/* Frame pointer gets saved into a special location. */
- if (u->Save_SP && i == FP_REGNUM)
+ if (u->Save_SP && i == DEPRECATED_FP_REGNUM)
continue;
save_gr |= (1 << i);
@@ -4002,14 +4003,14 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
if ( (inst & 0xffffc000) == 0x6fc10000 /* stw,ma r1,N(sr0,sp) */
|| (inst & 0xffffc00c) == 0x73c10008) /* std,ma r1,N(sr0,sp) */
{
- frame_saved_regs[FP_REGNUM] = get_frame_base (frame_info);
+ frame_saved_regs[DEPRECATED_FP_REGNUM] = get_frame_base (frame_info);
save_sp = 0;
}
/* Account for general and floating-point register saves. */
reg = inst_saves_gr (inst);
if (reg >= 3 && reg <= 18
- && (!u->Save_SP || reg != FP_REGNUM))
+ && (!u->Save_SP || reg != DEPRECATED_FP_REGNUM))
{
save_gr &= ~(1 << reg);
@@ -4762,7 +4763,7 @@ hppa_store_return_value (struct type *type, char *valbuf)
? (8 - TYPE_LENGTH (type))
: (4 - TYPE_LENGTH (type))),
valbuf, TYPE_LENGTH (type));
- if (! SOFT_FLOAT && TYPE_CODE (type) == TYPE_CODE_FLT)
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
deprecated_write_register_bytes (REGISTER_BYTE (FP4_REGNUM),
valbuf, TYPE_LENGTH (type));
}
@@ -4777,7 +4778,7 @@ hppa_store_return_value (struct type *type, char *valbuf)
void
hppa_extract_return_value (struct type *type, char *regbuf, char *valbuf)
{
- if (! SOFT_FLOAT && TYPE_CODE (type) == TYPE_CODE_FLT)
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
memcpy (valbuf,
(char *)regbuf + REGISTER_BYTE (FP4_REGNUM),
TYPE_LENGTH (type));
@@ -4859,7 +4860,7 @@ int
hppa_register_raw_size (int reg_nr)
{
/* All registers have the same size. */
- return REGISTER_SIZE;
+ return DEPRECATED_REGISTER_SIZE;
}
/* Index within the register vector of the first byte of the space i
@@ -4988,9 +4989,9 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_inner_than (gdbarch, hppa_inner_than);
set_gdbarch_stack_align (gdbarch, hppa_stack_align);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
- set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_deprecated_register_size (gdbarch, 4);
set_gdbarch_num_regs (gdbarch, hppa_num_regs);
- set_gdbarch_fp_regnum (gdbarch, 3);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, 3);
set_gdbarch_sp_regnum (gdbarch, 30);
set_gdbarch_fp0_regnum (gdbarch, 64);
set_gdbarch_pc_regnum (gdbarch, PCOQ_HEAD_REGNUM);
@@ -5022,14 +5023,14 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame);
set_gdbarch_deprecated_pop_frame (gdbarch, hppa_pop_frame);
- set_gdbarch_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28);
- /* set_gdbarch_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */
+ set_gdbarch_deprecated_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28);
+ /* set_gdbarch_deprecated_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */
set_gdbarch_deprecated_push_arguments (gdbarch, hppa_push_arguments);
set_gdbarch_smash_text_address (gdbarch, hppa_smash_text_address);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_read_pc (gdbarch, hppa_target_read_pc);
set_gdbarch_write_pc (gdbarch, hppa_target_write_pc);
- set_gdbarch_read_fp (gdbarch, hppa_target_read_fp);
+ set_gdbarch_deprecated_target_read_fp (gdbarch, hppa_target_read_fp);
return gdbarch;
}
@@ -5049,7 +5050,7 @@ _initialize_hppa_tdep (void)
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;
+ deprecated_tm_print_insn = print_insn_hppa;
add_cmd ("unwind", class_maintenance, unwind_command,
"Print unwind table entry at given address.",
diff --git a/gdb/hppab-nat.c b/gdb/hppab-nat.c
index 3ec3a57e9ac..dc3e6b6fb9c 100644
--- a/gdb/hppab-nat.c
+++ b/gdb/hppab-nat.c
@@ -55,7 +55,7 @@ static void
fetch_register (int regno)
{
register unsigned int regaddr;
- char *buf = alloca (max_register_size (current_gdbarch));
+ char buf[MAX_REGISTER_SIZE];
register int i;
/* Offset of registers within the u area. */
diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c
index b953d2546f6..0b8b04f9778 100644
--- a/gdb/hppah-nat.c
+++ b/gdb/hppah-nat.c
@@ -190,7 +190,7 @@ store_inferior_registers (int regno)
static void
fetch_register (int regno)
{
- char *buf = alloca (max_register_size (current_gdbarch));
+ char buf[MAX_REGISTER_SIZE];
unsigned int addr, len, offset;
int i;
diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c
index b585ca540ce..7a7b74174a1 100644
--- a/gdb/hpux-thread.c
+++ b/gdb/hpux-thread.c
@@ -285,7 +285,7 @@ hpux_thread_fetch_registers (int regno)
child_ops.to_fetch_registers (regno);
else
{
- unsigned char *buf = alloca (max_register_size (current_gdbarch));
+ unsigned char buf[MAX_REGISTER_SIZE];
CORE_ADDR sp;
sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160;
@@ -347,7 +347,7 @@ hpux_thread_store_registers (int regno)
child_ops.to_store_registers (regno);
else
{
- unsigned char *buf = alloca (max_register_size (current_gdbarch));
+ unsigned char buf[MAX_REGISTER_SIZE];
CORE_ADDR sp;
sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160;
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 3744124ebc5..cf769d87edc 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -72,7 +72,6 @@
/* Prototypes for local functions. */
static void dummy_sse_values (void);
-
/* The register sets used in GNU/Linux ELF core-dumps are identical to
@@ -233,10 +232,10 @@ supply_gregset (elf_gregset_t *gregsetp)
int i;
for (i = 0; i < I386_NUM_GREGS; i++)
- supply_register (i, (char *) (regp + regmap[i]));
+ supply_register (i, regp + regmap[i]);
if (I386_LINUX_ORIG_EAX_REGNUM < NUM_REGS)
- supply_register (I386_LINUX_ORIG_EAX_REGNUM, (char *) (regp + ORIG_EAX));
+ supply_register (I386_LINUX_ORIG_EAX_REGNUM, regp + ORIG_EAX);
}
/* Fill register REGNO (if it is a general-purpose register) in
diff --git a/gdb/i386-nto-tdep.c b/gdb/i386-nto-tdep.c
new file mode 100644
index 00000000000..b35dd2a13b7
--- /dev/null
+++ b/gdb/i386-nto-tdep.c
@@ -0,0 +1,298 @@
+/* i386-nto-tdep.c - i386 specific functionality for QNX Neutrino.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ Contributed by QNX Software Systems Ltd.
+
+ 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 "gdb_string.h"
+#include "gdb_assert.h"
+#include "defs.h"
+#include "frame.h"
+#include "target.h"
+#include "regcache.h"
+#include "solib-svr4.h"
+#include "i386-tdep.h"
+#include "nto-tdep.h"
+#include "osabi.h"
+#include "i387-tdep.h"
+
+#ifndef X86_CPU_FXSR
+#define X86_CPU_FXSR (1L << 12)
+#endif
+
+/* Why 13? Look in our /usr/include/x86/context.h header at the
+ x86_cpu_registers structure and you'll see an 'exx' junk register
+ that is just filler. Don't ask me, ask the kernel guys. */
+#define NUM_GPREGS 13
+
+/* Map a GDB register number to an offset in the reg structure. */
+static int regmap[] = {
+ (7 * 4), /* eax */
+ (6 * 4), /* ecx */
+ (5 * 4), /* edx */
+ (4 * 4), /* ebx */
+ (11 * 4), /* esp */
+ (2 * 4), /* epb */
+ (1 * 4), /* esi */
+ (0 * 4), /* edi */
+ (8 * 4), /* eip */
+ (10 * 4), /* eflags */
+ (9 * 4), /* cs */
+ (12 * 4), /* ss */
+ (-1 * 4) /* filler */
+};
+
+/* Given a gdb regno, return the offset into Neutrino's register structure
+ or -1 if register is unknown. */
+static int
+nto_reg_offset (int regno)
+{
+ return (regno >= 0 && regno < NUM_GPREGS) ? regmap[regno] : -1;
+}
+
+static void
+i386nto_supply_gregset (char *gpregs)
+{
+ unsigned regno;
+ int empty = 0;
+
+ for (regno = 0; regno < FP0_REGNUM; regno++)
+ {
+ int offset = nto_reg_offset (regno);
+ if (offset == -1)
+ supply_register (regno, (char *) &empty);
+ else
+ supply_register (regno, gpregs + offset);
+ }
+}
+
+static void
+i386nto_supply_fpregset (char *fpregs)
+{
+ if (nto_cpuinfo_valid && nto_cpuinfo_flags | X86_CPU_FXSR)
+ i387_supply_fxsave (fpregs);
+ else
+ i387_supply_fsave (fpregs);
+}
+
+static void
+i386nto_supply_regset (int regset, char *data)
+{
+ switch (regset)
+ {
+ case NTO_REG_GENERAL: /* QNX has different ordering of GP regs than GDB. */
+ i386nto_supply_gregset (data);
+ break;
+ case NTO_REG_FLOAT:
+ i386nto_supply_fpregset (data);
+ break;
+ }
+}
+
+static int
+i386nto_regset_id (int regno)
+{
+ if (regno == -1)
+ return NTO_REG_END;
+ else if (regno < FP0_REGNUM)
+ return NTO_REG_GENERAL;
+ else if (regno < FPC_REGNUM)
+ return NTO_REG_FLOAT;
+
+ return -1; /* Error. */
+}
+
+static int
+i386nto_register_area (int regno, int regset, unsigned *off)
+{
+ int len;
+
+ *off = 0;
+ if (regset == NTO_REG_GENERAL)
+ {
+ if (regno == -1)
+ return NUM_GPREGS * 4;
+
+ *off = nto_reg_offset (regno);
+ if (*off == -1)
+ return 0;
+ return 4;
+ }
+ else if (regset == NTO_REG_FLOAT)
+ {
+ unsigned off_adjust, regsize, regset_size;
+
+ if (nto_cpuinfo_valid && nto_cpuinfo_flags | X86_CPU_FXSR)
+ {
+ off_adjust = 32;
+ regsize = 16;
+ regset_size = 512;
+ }
+ else
+ {
+ off_adjust = 28;
+ regsize = 10;
+ regset_size = 128;
+ }
+
+ if (regno == -1)
+ return regset_size;
+
+ *off = (regno - FP0_REGNUM) * regsize + off_adjust;
+ return 10;
+ /* Why 10 instead of regsize? GDB only stores 10 bytes per FP
+ register so if we're sending a register back to the target,
+ we only want pdebug to write 10 bytes so as not to clobber
+ the reserved 6 bytes in the fxsave structure. */
+ }
+ return -1;
+}
+
+static int
+i386nto_regset_fill (int regset, char *data)
+{
+ if (regset == NTO_REG_GENERAL)
+ {
+ int regno;
+
+ for (regno = 0; regno < NUM_GPREGS; regno++)
+ {
+ int offset = nto_reg_offset (regno);
+ if (offset != -1)
+ regcache_collect (regno, data + offset);
+ }
+ }
+ else if (regset == NTO_REG_FLOAT)
+ {
+ if (nto_cpuinfo_valid && nto_cpuinfo_flags | X86_CPU_FXSR)
+ i387_fill_fxsave (data, -1);
+ else
+ i387_fill_fsave (data, -1);
+ }
+ else
+ return -1;
+
+ return 0;
+}
+
+static struct link_map_offsets *
+i386nto_svr4_fetch_link_map_offsets (void)
+{
+ static struct link_map_offsets lmo;
+ static struct link_map_offsets *lmp = NULL;
+
+ if (lmp == NULL)
+ {
+ lmp = &lmo;
+
+ lmo.r_debug_size = 8; /* The actual size is 20 bytes, but
+ only 8 bytes are used. */
+ lmo.r_map_offset = 4;
+ lmo.r_map_size = 4;
+
+ lmo.link_map_size = 20; /* The actual size is 552 bytes, but
+ only 20 bytes are used. */
+ lmo.l_addr_offset = 0;
+ lmo.l_addr_size = 4;
+
+ lmo.l_name_offset = 4;
+ lmo.l_name_size = 4;
+
+ lmo.l_next_offset = 12;
+ lmo.l_next_size = 4;
+
+ lmo.l_prev_offset = 16;
+ lmo.l_prev_size = 4;
+ }
+
+ return lmp;
+}
+
+static int
+i386nto_pc_in_sigtramp (CORE_ADDR pc, char *name)
+{
+ return name && strcmp ("__signalstub", name) == 0;
+}
+
+#define SIGCONTEXT_OFFSET 136
+static CORE_ADDR
+i386nto_sigcontext_addr (struct frame_info *frame)
+{
+ if (get_next_frame (frame))
+ return get_frame_base (get_next_frame (frame)) + SIGCONTEXT_OFFSET;
+
+ return read_register (SP_REGNUM) + SIGCONTEXT_OFFSET;
+}
+
+static void
+init_i386nto_ops (void)
+{
+ current_nto_target.nto_regset_id = i386nto_regset_id;
+ current_nto_target.nto_supply_gregset = i386nto_supply_gregset;
+ current_nto_target.nto_supply_fpregset = i386nto_supply_fpregset;
+ current_nto_target.nto_supply_altregset = nto_dummy_supply_regset;
+ current_nto_target.nto_supply_regset = i386nto_supply_regset;
+ current_nto_target.nto_register_area = i386nto_register_area;
+ current_nto_target.nto_regset_fill = i386nto_regset_fill;
+ current_nto_target.nto_fetch_link_map_offsets =
+ i386nto_svr4_fetch_link_map_offsets;
+}
+
+static void
+i386nto_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ /* NTO uses ELF. */
+ i386_elf_init_abi (info, gdbarch);
+
+ /* Neutrino rewinds to look more normal. */
+ set_gdbarch_decr_pc_after_break (gdbarch, 0);
+
+ /* NTO has shared libraries. */
+ set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
+ set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
+
+ set_gdbarch_pc_in_sigtramp (gdbarch, i386nto_pc_in_sigtramp);
+ tdep->sigcontext_addr = i386nto_sigcontext_addr;
+ tdep->sc_pc_offset = 56;
+ tdep->sc_sp_offset = 68;
+
+ /* Setjmp()'s return PC saved in EDX (5). */
+ tdep->jb_pc_offset = 20; /* 5x32 bit ints in. */
+
+ set_solib_svr4_fetch_link_map_offsets (gdbarch,
+ i386nto_svr4_fetch_link_map_offsets);
+
+ /* Our loader handles solib relocations slightly differently than svr4. */
+ TARGET_SO_RELOCATE_SECTION_ADDRESSES = nto_relocate_section_addresses;
+
+ /* Supply a nice function to find our solibs. */
+ TARGET_SO_FIND_AND_OPEN_SOLIB = nto_find_and_open_solib;
+
+ init_i386nto_ops ();
+}
+
+void
+_initialize_i386nto_tdep (void)
+{
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_QNXNTO,
+ i386nto_init_abi);
+}
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 2406e3ffefc..5cf63b46f86 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -669,7 +669,7 @@ i386_frame_init_saved_regs (struct frame_info *fip)
}
get_frame_saved_regs (fip)[PC_REGNUM] = get_frame_base (fip) + 4;
- get_frame_saved_regs (fip)[FP_REGNUM] = get_frame_base (fip);
+ get_frame_saved_regs (fip)[DEPRECATED_FP_REGNUM] = get_frame_base (fip);
}
/* Return PC of first real instruction. */
@@ -808,7 +808,7 @@ i386_do_pop_frame (struct frame_info *frame)
deprecated_write_register_gen (regnum, regbuf);
}
}
- write_register (FP_REGNUM, read_memory_integer (fp, 4));
+ write_register (DEPRECATED_FP_REGNUM, read_memory_integer (fp, 4));
write_register (PC_REGNUM, read_memory_integer (fp + 4, 4));
write_register (SP_REGNUM, fp + 8);
flush_cached_frames ();
@@ -1057,7 +1057,7 @@ i386_use_struct_convention (int gcc_p, struct type *type)
static struct type *
i386_register_type (struct gdbarch *gdbarch, int regnum)
{
- if (regnum == PC_REGNUM || regnum == FP_REGNUM || regnum == SP_REGNUM)
+ if (regnum == PC_REGNUM || regnum == DEPRECATED_FP_REGNUM || regnum == SP_REGNUM)
return lookup_pointer_type (builtin_type_void);
if (i386_fp_regnum_p (regnum))
@@ -1097,7 +1097,7 @@ i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
{
if (i386_mmx_regnum_p (regnum))
{
- char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char mmx_buf[MAX_REGISTER_SIZE];
int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum);
/* Extract (always little endian). */
@@ -1114,7 +1114,7 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
if (i386_mmx_regnum_p (regnum))
{
- char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char mmx_buf[MAX_REGISTER_SIZE];
int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum);
/* Read ... */
@@ -1469,7 +1469,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_num_regs (gdbarch, I386_NUM_GREGS + I386_NUM_FREGS);
set_gdbarch_sp_regnum (gdbarch, 4); /* %esp */
- set_gdbarch_fp_regnum (gdbarch, 5); /* %ebp */
+ set_gdbarch_deprecated_fp_regnum (gdbarch, 5); /* %ebp */
set_gdbarch_pc_regnum (gdbarch, 8); /* %eip */
set_gdbarch_ps_regnum (gdbarch, 9); /* %eflags */
set_gdbarch_fp0_regnum (gdbarch, 16); /* %st(0) */
@@ -1486,7 +1486,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
be in use on any of the supported i386 targets. */
set_gdbarch_register_name (gdbarch, i386_register_name);
- set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_deprecated_register_size (gdbarch, 4);
set_gdbarch_register_bytes (gdbarch, I386_SIZEOF_GREGS + I386_SIZEOF_FREGS);
set_gdbarch_register_type (gdbarch, i386_register_type);
@@ -1495,8 +1495,8 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_get_longjmp_target (gdbarch, i386_get_longjmp_target);
/* Call dummy code. */
- set_gdbarch_call_dummy_words (gdbarch, NULL);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, NULL);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_register_convertible (gdbarch, i386_register_convertible);
set_gdbarch_register_convert_to_virtual (gdbarch,
@@ -1542,7 +1542,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pc_in_sigtramp (gdbarch, i386_pc_in_sigtramp);
/* Wire in the MMX registers. */
- set_gdbarch_num_pseudo_regs (gdbarch, mmx_num_regs);
+ set_gdbarch_num_pseudo_regs (gdbarch, i386_num_mmx_regs);
set_gdbarch_pseudo_register_read (gdbarch, i386_pseudo_register_read);
set_gdbarch_pseudo_register_write (gdbarch, i386_pseudo_register_write);
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index 045357ea3fe..c6a2d5dac84 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -522,19 +522,34 @@ static int fxsave_offset[] =
20, /* FOSEG_REGNUM (16 bits). */
16, /* FOOFF_REGNUM. */
6, /* FOP_REGNUM (bottom 11 bits). */
- 160, /* XMM0_REGNUM through ... */
- 176,
- 192,
- 208,
- 224,
- 240,
- 256,
- 272, /* ... XMM7_REGNUM (128 bits each). */
- 24, /* MXCSR_REGNUM. */
+ 160 + 0 * 16, /* XMM0_REGNUM through ... */
+ 160 + 1 * 16,
+ 160 + 2 * 16,
+ 160 + 3 * 16,
+ 160 + 4 * 16,
+ 160 + 5 * 16,
+ 160 + 6 * 16,
+ 160 + 7 * 16,
+ 160 + 8 * 16,
+ 160 + 9 * 16,
+ 160 + 10 * 16,
+ 160 + 11 * 16,
+ 160 + 12 * 16,
+ 160 + 13 * 16,
+ 160 + 14 * 16,
+ 160 + 15 * 16, /* ... XMM15_REGNUM (128 bits each). */
+ 24 /* MXCSR_REGNUM. */
};
+/* FIXME: kettenis/20030430: We made an unfortunate choice in putting
+ %mxcsr after the SSE registers %xmm0-%xmm7 instead of before, since
+ it makes supporting the registers %xmm8-%xmm15 on x86-64 a bit
+ involved. Hack around it by explicitly overriding the offset for
+ %mxcsr here. */
+
#define FXSAVE_ADDR(fxsave, regnum) \
- (fxsave + fxsave_offset[regnum - FP0_REGNUM])
+ ((regnum == MXCSR_REGNUM) ? (fxsave + 24) : \
+ (fxsave + fxsave_offset[regnum - FP0_REGNUM]))
static int i387_tag (unsigned char *raw);
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 86638fb37ba..ce9b26c8e2e 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -678,8 +678,8 @@ rse_address_add(CORE_ADDR addr, int nslots)
computationally expensive. So, instead of making life difficult
(and slow), we pick a more convenient representation of the frame
chain, knowing that we'll have to make some small adjustments in
- other places. (E.g, note that read_fp() is actually read_sp() in
- ia64_gdbarch_init() below.)
+ other places. (E.g, note that deprecated_read_fp() is actually
+ read_sp() in ia64_gdbarch_init() below.)
Okay, so what is the frame chain exactly? It'll be the SP value
at the time that the function in question was entered.
@@ -1259,7 +1259,7 @@ ia64_get_saved_register (char *raw_buffer,
}
else if (IA64_PR0_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM)
{
- char *pr_raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char pr_raw_buffer[MAX_REGISTER_SIZE];
int pr_optim;
enum lval_type pr_lval;
CORE_ADDR pr_addr;
@@ -1282,7 +1282,7 @@ ia64_get_saved_register (char *raw_buffer,
}
else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM)
{
- char *unat_raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char unat_raw_buffer[MAX_REGISTER_SIZE];
int unat_optim;
enum lval_type unat_lval;
CORE_ADDR unat_addr;
@@ -2033,7 +2033,9 @@ ia64_pop_frame_regular (struct frame_info *frame)
}
static void
-ia64_remote_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes,
+ia64_remote_translate_xfer_address (struct gdbarch *gdbarch,
+ struct regcache *regcache,
+ CORE_ADDR memaddr, int nr_bytes,
CORE_ADDR *targ_addr, int *targ_len)
{
*targ_addr = memaddr;
@@ -2168,12 +2170,12 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_num_regs (gdbarch, ia64_num_regs);
set_gdbarch_sp_regnum (gdbarch, sp_regnum);
- set_gdbarch_fp_regnum (gdbarch, fp_regnum);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, fp_regnum);
set_gdbarch_pc_regnum (gdbarch, pc_regnum);
set_gdbarch_fp0_regnum (gdbarch, IA64_FR0_REGNUM);
set_gdbarch_register_name (gdbarch, ia64_register_name);
- set_gdbarch_register_size (gdbarch, 8);
+ set_gdbarch_deprecated_register_size (gdbarch, 8);
set_gdbarch_register_bytes (gdbarch, ia64_num_regs * 8 + 128*8);
set_gdbarch_register_byte (gdbarch, ia64_register_byte);
set_gdbarch_register_raw_size (gdbarch, ia64_register_raw_size);
@@ -2217,18 +2219,18 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_push_return_address (gdbarch, ia64_push_return_address);
set_gdbarch_deprecated_pop_frame (gdbarch, ia64_pop_frame);
- set_gdbarch_call_dummy_words (gdbarch, ia64_call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (ia64_call_dummy_words));
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, ia64_call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (ia64_call_dummy_words));
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, ia64_init_extra_frame_info);
set_gdbarch_frame_args_address (gdbarch, ia64_frame_args_address);
set_gdbarch_frame_locals_address (gdbarch, ia64_frame_locals_address);
- /* We won't necessarily have a frame pointer and even if we do,
- it winds up being extraordinarly messy when attempting to find
- the frame chain. So for the purposes of creating frames (which
- is all read_fp() is used for), simply use the stack pointer value
- instead. */
- set_gdbarch_read_fp (gdbarch, generic_target_read_sp);
+ /* We won't necessarily have a frame pointer and even if we do, it
+ winds up being extraordinarly messy when attempting to find the
+ frame chain. So for the purposes of creating frames (which is
+ all deprecated_read_fp() is used for), simply use the stack
+ pointer value instead. */
+ set_gdbarch_deprecated_target_read_fp (gdbarch, generic_target_read_sp);
/* Settings that should be unnecessary. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
@@ -2251,6 +2253,6 @@ _initialize_ia64_tdep (void)
{
register_gdbarch_init (bfd_arch_ia64, ia64_gdbarch_init);
- tm_print_insn = print_insn_ia64;
- tm_print_insn_info.bytes_per_line = SLOT_MULTIPLIER;
+ deprecated_tm_print_insn = print_insn_ia64;
+ deprecated_tm_print_insn_info.bytes_per_line = SLOT_MULTIPLIER;
}
diff --git a/gdb/infcall.c b/gdb/infcall.c
new file mode 100644
index 00000000000..5f80e896bbc
--- /dev/null
+++ b/gdb/infcall.c
@@ -0,0 +1,1072 @@
+/* Perform an inferior function call, for GDB, the GNU debugger.
+
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 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 "breakpoint.h"
+#include "target.h"
+#include "regcache.h"
+#include "inferior.h"
+#include "gdb_assert.h"
+#include "block.h"
+#include "gdbcore.h"
+#include "language.h"
+#include "symfile.h"
+#include "gdbcmd.h"
+#include "command.h"
+#include "gdb_string.h"
+
+/* NOTE: cagney/2003-04-16: What's the future of this code?
+
+ GDB needs an asynchronous expression evaluator, that means an
+ asynchronous inferior function call implementation, and that in
+ turn means restructuring the code so that it is event driven. */
+
+/* How you should pass arguments to a function depends on whether it
+ was defined in K&R style or prototype style. If you define a
+ function using the K&R syntax that takes a `float' argument, then
+ callers must pass that argument as a `double'. If you define the
+ function using the prototype syntax, then you must pass the
+ argument as a `float', with no promotion.
+
+ Unfortunately, on certain older platforms, the debug info doesn't
+ indicate reliably how each function was defined. A function type's
+ TYPE_FLAG_PROTOTYPED flag may be clear, even if the function was
+ defined in prototype style. When calling a function whose
+ TYPE_FLAG_PROTOTYPED flag is clear, GDB consults this flag to
+ decide what to do.
+
+ For modern targets, it is proper to assume that, if the prototype
+ flag is clear, that can be trusted: `float' arguments should be
+ promoted to `double'. For some older targets, if the prototype
+ flag is clear, that doesn't tell us anything. The default is to
+ trust the debug information; the user can override this behavior
+ with "set coerce-float-to-double 0". */
+
+static int coerce_float_to_double_p = 1;
+
+/* This boolean tells what gdb should do if a signal is received while
+ in a function called from gdb (call dummy). If set, gdb unwinds
+ the stack and restore the context to what as it was before the
+ call.
+
+ The default is to stop in the frame where the signal was received. */
+
+int unwind_on_signal_p = 0;
+
+/* Perform the standard coercions that are specified
+ for arguments to be passed to C functions.
+
+ If PARAM_TYPE is non-NULL, it is the expected parameter type.
+ IS_PROTOTYPED is non-zero if the function declaration is prototyped. */
+
+static struct value *
+value_arg_coerce (struct value *arg, struct type *param_type,
+ int is_prototyped)
+{
+ register struct type *arg_type = check_typedef (VALUE_TYPE (arg));
+ register struct type *type
+ = param_type ? check_typedef (param_type) : arg_type;
+
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_REF:
+ if (TYPE_CODE (arg_type) != TYPE_CODE_REF
+ && TYPE_CODE (arg_type) != TYPE_CODE_PTR)
+ {
+ arg = value_addr (arg);
+ VALUE_TYPE (arg) = param_type;
+ return arg;
+ }
+ break;
+ case TYPE_CODE_INT:
+ case TYPE_CODE_CHAR:
+ case TYPE_CODE_BOOL:
+ case TYPE_CODE_ENUM:
+ /* If we don't have a prototype, coerce to integer type if necessary. */
+ if (!is_prototyped)
+ {
+ if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_int))
+ type = builtin_type_int;
+ }
+ /* Currently all target ABIs require at least the width of an integer
+ type for an argument. We may have to conditionalize the following
+ type coercion for future targets. */
+ if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_int))
+ type = builtin_type_int;
+ break;
+ case TYPE_CODE_FLT:
+ if (!is_prototyped && coerce_float_to_double_p)
+ {
+ if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_double))
+ type = builtin_type_double;
+ else if (TYPE_LENGTH (type) > TYPE_LENGTH (builtin_type_double))
+ type = builtin_type_long_double;
+ }
+ break;
+ case TYPE_CODE_FUNC:
+ type = lookup_pointer_type (type);
+ break;
+ case TYPE_CODE_ARRAY:
+ /* Arrays are coerced to pointers to their first element, unless
+ they are vectors, in which case we want to leave them alone,
+ because they are passed by value. */
+ if (current_language->c_style_arrays)
+ if (!TYPE_VECTOR (type))
+ type = lookup_pointer_type (TYPE_TARGET_TYPE (type));
+ break;
+ case TYPE_CODE_UNDEF:
+ case TYPE_CODE_PTR:
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ case TYPE_CODE_VOID:
+ case TYPE_CODE_SET:
+ case TYPE_CODE_RANGE:
+ case TYPE_CODE_STRING:
+ case TYPE_CODE_BITSTRING:
+ case TYPE_CODE_ERROR:
+ case TYPE_CODE_MEMBER:
+ case TYPE_CODE_METHOD:
+ case TYPE_CODE_COMPLEX:
+ default:
+ break;
+ }
+
+ return value_cast (type, arg);
+}
+
+/* Determine a function's address and its return type from its value.
+ Calls error() if the function is not valid for calling. */
+
+CORE_ADDR
+find_function_addr (struct value *function, struct type **retval_type)
+{
+ register struct type *ftype = check_typedef (VALUE_TYPE (function));
+ register enum type_code code = TYPE_CODE (ftype);
+ struct type *value_type;
+ CORE_ADDR funaddr;
+
+ /* If it's a member function, just look at the function
+ part of it. */
+
+ /* Determine address to call. */
+ if (code == TYPE_CODE_FUNC || code == TYPE_CODE_METHOD)
+ {
+ funaddr = VALUE_ADDRESS (function);
+ value_type = TYPE_TARGET_TYPE (ftype);
+ }
+ else if (code == TYPE_CODE_PTR)
+ {
+ funaddr = value_as_address (function);
+ ftype = check_typedef (TYPE_TARGET_TYPE (ftype));
+ if (TYPE_CODE (ftype) == TYPE_CODE_FUNC
+ || TYPE_CODE (ftype) == TYPE_CODE_METHOD)
+ {
+ funaddr = CONVERT_FROM_FUNC_PTR_ADDR (funaddr);
+ value_type = TYPE_TARGET_TYPE (ftype);
+ }
+ else
+ value_type = builtin_type_int;
+ }
+ else if (code == TYPE_CODE_INT)
+ {
+ /* Handle the case of functions lacking debugging info.
+ Their values are characters since their addresses are char */
+ if (TYPE_LENGTH (ftype) == 1)
+ funaddr = value_as_address (value_addr (function));
+ else
+ /* Handle integer used as address of a function. */
+ funaddr = (CORE_ADDR) value_as_long (function);
+
+ value_type = builtin_type_int;
+ }
+ else
+ error ("Invalid data type for function to be called.");
+
+ *retval_type = value_type;
+ return funaddr;
+}
+
+/* Call breakpoint_auto_delete on the current contents of the bpstat
+ pointed to by arg (which is really a bpstat *). */
+
+static void
+breakpoint_auto_delete_contents (void *arg)
+{
+ breakpoint_auto_delete (*(bpstat *) arg);
+}
+
+static CORE_ADDR
+legacy_push_dummy_code (struct gdbarch *gdbarch,
+ CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc,
+ struct value **args, int nargs,
+ struct type *value_type,
+ CORE_ADDR *real_pc, CORE_ADDR *bp_addr)
+{
+ /* CALL_DUMMY is an array of words (DEPRECATED_REGISTER_SIZE), but
+ each word is in host byte order. Before calling
+ DEPRECATED_FIX_CALL_DUMMY, we byteswap it and remove any extra
+ bytes which might exist because ULONGEST is bigger than
+ DEPRECATED_REGISTER_SIZE. */
+ /* NOTE: This is pretty wierd, as the call dummy is actually a
+ sequence of instructions. But CISC machines will have to pack
+ the instructions into DEPRECATED_REGISTER_SIZE units (and so will
+ RISC machines for which INSTRUCTION_SIZE is not
+ DEPRECATED_REGISTER_SIZE). */
+ /* NOTE: This is pretty stupid. CALL_DUMMY should be in strict
+ target byte order. */
+ CORE_ADDR start_sp;
+ ULONGEST *dummy = alloca (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS);
+ int sizeof_dummy1 = (DEPRECATED_REGISTER_SIZE
+ * DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
+ / sizeof (ULONGEST));
+ char *dummy1 = alloca (sizeof_dummy1);
+ memcpy (dummy, DEPRECATED_CALL_DUMMY_WORDS,
+ DEPRECATED_SIZEOF_CALL_DUMMY_WORDS);
+ if (INNER_THAN (1, 2))
+ {
+ /* Stack grows down */
+ sp -= sizeof_dummy1;
+ start_sp = sp;
+ }
+ else
+ {
+ /* Stack grows up */
+ start_sp = sp;
+ sp += sizeof_dummy1;
+ }
+ /* NOTE: cagney/2002-09-10: Don't bother re-adjusting the stack
+ after allocating space for the call dummy. A target can specify
+ a SIZEOF_DUMMY1 (via DEPRECATED_SIZEOF_CALL_DUMMY_WORDS) such
+ that all local alignment requirements are met. */
+ /* Create a call sequence customized for this function and the
+ number of arguments for it. */
+ {
+ int i;
+ for (i = 0; i < (int) (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS / sizeof (dummy[0]));
+ i++)
+ store_unsigned_integer (&dummy1[i * DEPRECATED_REGISTER_SIZE],
+ DEPRECATED_REGISTER_SIZE,
+ (ULONGEST) dummy[i]);
+ }
+ /* NOTE: cagney/2003-04-22: This computation of REAL_PC, BP_ADDR and
+ DUMMY_ADDR is pretty messed up. It comes from constant tinkering
+ with the values. Instead a DEPRECATED_FIX_CALL_DUMMY replacement
+ (PUSH_DUMMY_BREAKPOINT?) should just do everything. */
+#ifdef GDB_TARGET_IS_HPPA
+ real_pc = DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
+ value_type, using_gcc);
+#else
+ if (DEPRECATED_FIX_CALL_DUMMY_P ())
+ {
+ /* gdb_assert (CALL_DUMMY_LOCATION == ON_STACK) true? */
+ DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
+ value_type, using_gcc);
+ }
+ (*real_pc) = start_sp;
+#endif
+ /* Yes, the offset is applied to the real_pc and not the dummy addr.
+ Ulgh! Blame the HP/UX target. */
+ (*bp_addr) = (*real_pc) + DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET;
+ /* Yes, the offset is applied to the real_pc and not the
+ dummy_addr. Ulgh! Blame the HP/UX target. */
+ (*real_pc) += DEPRECATED_CALL_DUMMY_START_OFFSET;
+ write_memory (start_sp, (char *) dummy1, sizeof_dummy1);
+ if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
+ generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1);
+ return sp;
+}
+
+static CORE_ADDR
+generic_push_dummy_code (struct gdbarch *gdbarch,
+ CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc,
+ struct value **args, int nargs,
+ struct type *value_type,
+ CORE_ADDR *real_pc, CORE_ADDR *bp_addr)
+{
+ /* Something here to findout the size of a breakpoint and then
+ allocate space for it on the stack. */
+ int bplen;
+ /* This code assumes frame align. */
+ gdb_assert (gdbarch_frame_align_p (gdbarch));
+ /* Force the stack's alignment. The intent is to ensure that the SP
+ is aligned to at least a breakpoint instruction's boundary. */
+ sp = gdbarch_frame_align (gdbarch, sp);
+ /* Allocate space for, and then position the breakpoint on the
+ stack. */
+ if (gdbarch_inner_than (gdbarch, 1, 2))
+ {
+ CORE_ADDR bppc = sp;
+ gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);
+ sp = gdbarch_frame_align (gdbarch, sp - bplen);
+ (*bp_addr) = sp;
+ /* Should the breakpoint size/location be re-computed here? */
+ }
+ else
+ {
+ (*bp_addr) = sp;
+ gdbarch_breakpoint_from_pc (gdbarch, bp_addr, &bplen);
+ sp = gdbarch_frame_align (gdbarch, sp + bplen);
+ }
+ /* Inferior resumes at the function entry point. */
+ (*real_pc) = funaddr;
+ return sp;
+}
+
+/* Provide backward compatibility. Once DEPRECATED_FIX_CALL_DUMMY is
+ eliminated, this can be simplified. */
+
+static CORE_ADDR
+push_dummy_code (struct gdbarch *gdbarch,
+ CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc,
+ struct value **args, int nargs,
+ struct type *value_type,
+ CORE_ADDR *real_pc, CORE_ADDR *bp_addr)
+{
+ if (gdbarch_push_dummy_code_p (gdbarch))
+ return gdbarch_push_dummy_code (gdbarch, sp, funaddr, using_gcc,
+ args, nargs, value_type, real_pc, bp_addr);
+ else if (DEPRECATED_FIX_CALL_DUMMY_P ())
+ return legacy_push_dummy_code (gdbarch, sp, funaddr, using_gcc,
+ args, nargs, value_type, real_pc, bp_addr);
+ else
+ return generic_push_dummy_code (gdbarch, sp, funaddr, using_gcc,
+ args, nargs, value_type, real_pc, bp_addr);
+}
+
+/* All this stuff with a dummy frame may seem unnecessarily complicated
+ (why not just save registers in GDB?). The purpose of pushing a dummy
+ frame which looks just like a real frame is so that if you call a
+ function and then hit a breakpoint (get a signal, etc), "backtrace"
+ will look right. Whether the backtrace needs to actually show the
+ stack at the time the inferior function was called is debatable, but
+ it certainly needs to not display garbage. So if you are contemplating
+ making dummy frames be different from normal frames, consider that. */
+
+/* Perform a function call in the inferior.
+ ARGS is a vector of values of arguments (NARGS of them).
+ FUNCTION is a value, the function to be called.
+ Returns a value representing what the function returned.
+ May fail to return, if a breakpoint or signal is hit
+ during the execution of the function.
+
+ ARGS is modified to contain coerced values. */
+
+struct value *
+call_function_by_hand (struct value *function, int nargs, struct value **args)
+{
+ register CORE_ADDR sp;
+ CORE_ADDR dummy_addr;
+ struct type *value_type;
+ unsigned char struct_return;
+ CORE_ADDR struct_addr = 0;
+ struct regcache *retbuf;
+ struct cleanup *retbuf_cleanup;
+ struct inferior_status *inf_status;
+ struct cleanup *inf_status_cleanup;
+ CORE_ADDR funaddr;
+ int using_gcc; /* Set to version of gcc in use, or zero if not gcc */
+ CORE_ADDR real_pc;
+ struct type *ftype = check_typedef (SYMBOL_TYPE (function));
+ CORE_ADDR bp_addr;
+
+ if (!target_has_execution)
+ noprocess ();
+
+ /* Create a cleanup chain that contains the retbuf (buffer
+ containing the register values). This chain is create BEFORE the
+ inf_status chain so that the inferior status can cleaned up
+ (restored or discarded) without having the retbuf freed. */
+ retbuf = regcache_xmalloc (current_gdbarch);
+ retbuf_cleanup = make_cleanup_regcache_xfree (retbuf);
+
+ /* A cleanup for the inferior status. Create this AFTER the retbuf
+ so that this can be discarded or applied without interfering with
+ the regbuf. */
+ inf_status = save_inferior_status (1);
+ inf_status_cleanup = make_cleanup_restore_inferior_status (inf_status);
+
+ if (DEPRECATED_PUSH_DUMMY_FRAME_P ())
+ {
+ /* DEPRECATED_PUSH_DUMMY_FRAME is responsible for saving the
+ inferior registers (and frame_pop() for restoring them). (At
+ least on most machines) they are saved on the stack in the
+ inferior. */
+ DEPRECATED_PUSH_DUMMY_FRAME;
+ }
+ else
+ {
+ /* FIXME: cagney/2003-02-26: Step zero of this little tinker is
+ to extract the generic dummy frame code from the architecture
+ vector. Hence this direct call.
+
+ A follow-on change is to modify this interface so that it takes
+ thread OR frame OR tpid as a parameter, and returns a dummy
+ frame handle. The handle can then be used further down as a
+ parameter SAVE_DUMMY_FRAME_TOS. Hmm, thinking about it, since
+ everything is ment to be using generic dummy frames, why not
+ even use some of the dummy frame code to here - do a regcache
+ dup and then pass the duped regcache, along with all the other
+ stuff, at one single point.
+
+ In fact, you can even save the structure's return address in the
+ dummy frame and fix one of those nasty lost struct return edge
+ conditions. */
+ generic_push_dummy_frame ();
+ }
+
+ /* Ensure that the initial SP is correctly aligned. */
+ {
+ CORE_ADDR old_sp = read_sp ();
+ if (gdbarch_frame_align_p (current_gdbarch))
+ {
+ /* NOTE: cagney/2002-09-18:
+
+ On a RISC architecture, a void parameterless generic dummy
+ frame (i.e., no parameters, no result) typically does not
+ need to push anything the stack and hence can leave SP and
+ FP. Similarly, a framelss (possibly leaf) function does
+ not push anything on the stack and, hence, that too can
+ leave FP and SP unchanged. As a consequence, a sequence of
+ void parameterless generic dummy frame calls to frameless
+ functions will create a sequence of effectively identical
+ frames (SP, FP and TOS and PC the same). This, not
+ suprisingly, results in what appears to be a stack in an
+ infinite loop --- when GDB tries to find a generic dummy
+ frame on the internal dummy frame stack, it will always
+ find the first one.
+
+ To avoid this problem, the code below always grows the
+ stack. That way, two dummy frames can never be identical.
+ It does burn a few bytes of stack but that is a small price
+ to pay :-). */
+ sp = gdbarch_frame_align (current_gdbarch, old_sp);
+ if (sp == old_sp)
+ {
+ if (INNER_THAN (1, 2))
+ /* Stack grows down. */
+ sp = gdbarch_frame_align (current_gdbarch, old_sp - 1);
+ else
+ /* Stack grows up. */
+ sp = gdbarch_frame_align (current_gdbarch, old_sp + 1);
+ }
+ gdb_assert ((INNER_THAN (1, 2) && sp <= old_sp)
+ || (INNER_THAN (2, 1) && sp >= old_sp));
+ }
+ else
+ /* FIXME: cagney/2002-09-18: Hey, you loose! Who knows how
+ badly aligned the SP is! Further, per comment above, if the
+ generic dummy frame ends up empty (because nothing is pushed)
+ GDB won't be able to correctly perform back traces. If a
+ target is having trouble with backtraces, first thing to do
+ is add FRAME_ALIGN() to its architecture vector. After that,
+ try adding SAVE_DUMMY_FRAME_TOS() and modifying
+ DEPRECATED_FRAME_CHAIN so that when the next outer frame is a
+ generic dummy, it returns the current frame's base. */
+ sp = old_sp;
+ }
+
+ funaddr = find_function_addr (function, &value_type);
+ CHECK_TYPEDEF (value_type);
+
+ {
+ struct block *b = block_for_pc (funaddr);
+ /* If compiled without -g, assume GCC 2. */
+ using_gcc = (b == NULL ? 2 : BLOCK_GCC_COMPILED (b));
+ }
+
+ /* Are we returning a value using a structure return or a normal
+ value return? */
+
+ struct_return = using_struct_return (function, funaddr, value_type,
+ using_gcc);
+
+ /* Determine the location of the breakpoint (and possibly other
+ stuff) that the called function will return to. The SPARC, for a
+ function returning a structure or union, needs to make space for
+ not just the breakpoint but also an extra word containing the
+ size (?) of the structure being passed. */
+
+ /* The actual breakpoint (at BP_ADDR) is inserted separatly so there
+ is no need to write that out. */
+
+ switch (CALL_DUMMY_LOCATION)
+ {
+ case ON_STACK:
+ /* "dummy_addr" is here just to keep old targets happy. New
+ targets return that same information via "sp" and "bp_addr". */
+ if (INNER_THAN (1, 2))
+ {
+ sp = push_dummy_code (current_gdbarch, sp, funaddr,
+ using_gcc, args, nargs, value_type,
+ &real_pc, &bp_addr);
+ dummy_addr = sp;
+ }
+ else
+ {
+ dummy_addr = sp;
+ sp = push_dummy_code (current_gdbarch, sp, funaddr,
+ using_gcc, args, nargs, value_type,
+ &real_pc, &bp_addr);
+ }
+ break;
+ case AT_ENTRY_POINT:
+ real_pc = funaddr;
+ dummy_addr = CALL_DUMMY_ADDRESS ();
+ /* A call dummy always consists of just a single breakpoint, so
+ it's address is the same as the address of the dummy. */
+ bp_addr = dummy_addr;
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
+
+ if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
+ /* Save where the breakpoint is going to be inserted so that the
+ dummy-frame code is later able to re-identify it. */
+ generic_save_call_dummy_addr (bp_addr, bp_addr + 1);
+
+ if (nargs < TYPE_NFIELDS (ftype))
+ error ("too few arguments in function call");
+
+ {
+ int i;
+ for (i = nargs - 1; i >= 0; i--)
+ {
+ int prototyped;
+ struct type *param_type;
+
+ /* FIXME drow/2002-05-31: Should just always mark methods as
+ prototyped. Can we respect TYPE_VARARGS? Probably not. */
+ if (TYPE_CODE (ftype) == TYPE_CODE_METHOD)
+ prototyped = 1;
+ else if (i < TYPE_NFIELDS (ftype))
+ prototyped = TYPE_PROTOTYPED (ftype);
+ else
+ prototyped = 0;
+
+ if (i < TYPE_NFIELDS (ftype))
+ param_type = TYPE_FIELD_TYPE (ftype, i);
+ else
+ param_type = NULL;
+
+ args[i] = value_arg_coerce (args[i], param_type, prototyped);
+
+ /* elz: this code is to handle the case in which the function
+ to be called has a pointer to function as parameter and the
+ corresponding actual argument is the address of a function
+ and not a pointer to function variable. In aCC compiled
+ code, the calls through pointers to functions (in the body
+ of the function called by hand) are made via
+ $$dyncall_external which requires some registers setting,
+ this is taken care of if we call via a function pointer
+ variable, but not via a function address. In cc this is
+ not a problem. */
+
+ if (using_gcc == 0)
+ {
+ if (param_type != NULL && TYPE_CODE (ftype) != TYPE_CODE_METHOD)
+ {
+ /* if this parameter is a pointer to function. */
+ if (TYPE_CODE (param_type) == TYPE_CODE_PTR)
+ if (TYPE_CODE (TYPE_TARGET_TYPE (param_type)) == TYPE_CODE_FUNC)
+ /* elz: FIXME here should go the test about the
+ compiler used to compile the target. We want to
+ issue the error message only if the compiler
+ used was HP's aCC. If we used HP's cc, then
+ there is no problem and no need to return at
+ this point. */
+ /* Go see if the actual parameter is a variable of
+ type pointer to function or just a function. */
+ if (args[i]->lval == not_lval)
+ {
+ char *arg_name;
+ if (find_pc_partial_function ((CORE_ADDR) args[i]->aligner.contents[0], &arg_name, NULL, NULL))
+ error ("\
+You cannot use function <%s> as argument. \n\
+You must use a pointer to function type variable. Command ignored.", arg_name);
+ }
+ }
+ }
+ }
+ }
+
+ if (REG_STRUCT_HAS_ADDR_P ())
+ {
+ int i;
+ /* This is a machine like the sparc, where we may need to pass a
+ pointer to the structure, not the structure itself. */
+ for (i = nargs - 1; i >= 0; i--)
+ {
+ struct type *arg_type = check_typedef (VALUE_TYPE (args[i]));
+ if ((TYPE_CODE (arg_type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (arg_type) == TYPE_CODE_UNION
+ || TYPE_CODE (arg_type) == TYPE_CODE_ARRAY
+ || TYPE_CODE (arg_type) == TYPE_CODE_STRING
+ || TYPE_CODE (arg_type) == TYPE_CODE_BITSTRING
+ || TYPE_CODE (arg_type) == TYPE_CODE_SET
+ || (TYPE_CODE (arg_type) == TYPE_CODE_FLT
+ && TYPE_LENGTH (arg_type) > 8)
+ )
+ && REG_STRUCT_HAS_ADDR (using_gcc, arg_type))
+ {
+ CORE_ADDR addr;
+ int len; /* = TYPE_LENGTH (arg_type); */
+ int aligned_len;
+ arg_type = check_typedef (VALUE_ENCLOSING_TYPE (args[i]));
+ len = TYPE_LENGTH (arg_type);
+
+ if (STACK_ALIGN_P ())
+ /* MVS 11/22/96: I think at least some of this
+ stack_align code is really broken. Better to let
+ PUSH_ARGUMENTS adjust the stack in a target-defined
+ manner. */
+ aligned_len = STACK_ALIGN (len);
+ else
+ aligned_len = len;
+ if (INNER_THAN (1, 2))
+ {
+ /* stack grows downward */
+ sp -= aligned_len;
+ /* ... so the address of the thing we push is the
+ stack pointer after we push it. */
+ addr = sp;
+ }
+ else
+ {
+ /* The stack grows up, so the address of the thing
+ we push is the stack pointer before we push it. */
+ addr = sp;
+ sp += aligned_len;
+ }
+ /* Push the structure. */
+ write_memory (addr, VALUE_CONTENTS_ALL (args[i]), len);
+ /* The value we're going to pass is the address of the
+ thing we just pushed. */
+ /*args[i] = value_from_longest (lookup_pointer_type (value_type),
+ (LONGEST) addr); */
+ args[i] = value_from_pointer (lookup_pointer_type (arg_type),
+ addr);
+ }
+ }
+ }
+
+
+ /* Reserve space for the return structure to be written on the
+ stack, if necessary. Make certain that the value is correctly
+ aligned. */
+
+ if (struct_return)
+ {
+ int len = TYPE_LENGTH (value_type);
+ if (STACK_ALIGN_P ())
+ /* NOTE: cagney/2003-03-22: Should rely on frame align, rather
+ than stack align to force the alignment of the stack. */
+ len = STACK_ALIGN (len);
+ if (INNER_THAN (1, 2))
+ {
+ /* Stack grows downward. Align STRUCT_ADDR and SP after
+ making space for the return value. */
+ sp -= len;
+ if (gdbarch_frame_align_p (current_gdbarch))
+ sp = gdbarch_frame_align (current_gdbarch, sp);
+ struct_addr = sp;
+ }
+ else
+ {
+ /* Stack grows upward. Align the frame, allocate space, and
+ then again, re-align the frame??? */
+ if (gdbarch_frame_align_p (current_gdbarch))
+ sp = gdbarch_frame_align (current_gdbarch, sp);
+ struct_addr = sp;
+ sp += len;
+ if (gdbarch_frame_align_p (current_gdbarch))
+ sp = gdbarch_frame_align (current_gdbarch, sp);
+ }
+ }
+
+ /* elz: on HPPA no need for this extra alignment, maybe it is needed
+ on other architectures. This is because all the alignment is
+ taken care of in the above code (ifdef REG_STRUCT_HAS_ADDR) and
+ in hppa_push_arguments */
+ /* NOTE: cagney/2003-03-24: The below code is very broken. Given an
+ odd sized parameter the below will mis-align the stack. As was
+ suggested back in '96, better to let PUSH_ARGUMENTS handle it. */
+ if (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)
+ {
+ /* MVS 11/22/96: I think at least some of this stack_align code
+ is really broken. Better to let push_dummy_call() adjust the
+ stack in a target-defined manner. */
+ if (STACK_ALIGN_P () && INNER_THAN (1, 2))
+ {
+ /* If stack grows down, we must leave a hole at the top. */
+ int len = 0;
+ int i;
+ for (i = nargs - 1; i >= 0; i--)
+ len += TYPE_LENGTH (VALUE_ENCLOSING_TYPE (args[i]));
+ if (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P ())
+ len += DEPRECATED_CALL_DUMMY_STACK_ADJUST;
+ sp -= STACK_ALIGN (len) - len;
+ }
+ }
+
+ /* Create the dummy stack frame. Pass in the call dummy address as,
+ presumably, the ABI code knows where, in the call dummy, the
+ return address should be pointed. */
+ if (gdbarch_push_dummy_call_p (current_gdbarch))
+ /* When there is no push_dummy_call method, should this code
+ simply error out. That would the implementation of this method
+ for all ABIs (which is probably a good thing). */
+ sp = gdbarch_push_dummy_call (current_gdbarch, current_regcache,
+ bp_addr, nargs, args, sp, struct_return,
+ struct_addr);
+ else if (DEPRECATED_PUSH_ARGUMENTS_P ())
+ /* Keep old targets working. */
+ sp = DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return,
+ struct_addr);
+ else
+ sp = legacy_push_arguments (nargs, args, sp, struct_return, struct_addr);
+
+ if (DEPRECATED_PUSH_RETURN_ADDRESS_P ())
+ /* for targets that use no CALL_DUMMY */
+ /* There are a number of targets now which actually don't write
+ any CALL_DUMMY instructions into the target, but instead just
+ save the machine state, push the arguments, and jump directly
+ to the callee function. Since this doesn't actually involve
+ executing a JSR/BSR instruction, the return address must be set
+ up by hand, either by pushing onto the stack or copying into a
+ return-address register as appropriate. Formerly this has been
+ done in PUSH_ARGUMENTS, but that's overloading its
+ functionality a bit, so I'm making it explicit to do it here. */
+ /* NOTE: cagney/2003-04-22: The first parameter ("real_pc") has
+ been replaced with zero, it turns out that no implementation
+ used that parameter. This occured because the value being
+ supplied - the address of the called function's entry point
+ instead of the address of the breakpoint that the called
+ function should return to - wasn't useful. */
+ sp = DEPRECATED_PUSH_RETURN_ADDRESS (0, sp);
+
+ /* NOTE: cagney/2003-03-23: Diable this code when there is a
+ push_dummy_call() method. Since that method will have already
+ handled any alignment issues, the code below is entirely
+ redundant. */
+ if (!gdbarch_push_dummy_call_p (current_gdbarch)
+ && STACK_ALIGN_P () && !INNER_THAN (1, 2))
+ {
+ /* If stack grows up, we must leave a hole at the bottom, note
+ that sp already has been advanced for the arguments! */
+ if (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P ())
+ sp += DEPRECATED_CALL_DUMMY_STACK_ADJUST;
+ sp = STACK_ALIGN (sp);
+ }
+
+/* XXX This seems wrong. For stacks that grow down we shouldn't do
+ anything here! */
+ /* MVS 11/22/96: I think at least some of this stack_align code is
+ really broken. Better to let PUSH_ARGUMENTS adjust the stack in
+ a target-defined manner. */
+ if (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P ())
+ if (INNER_THAN (1, 2))
+ {
+ /* stack grows downward */
+ sp -= DEPRECATED_CALL_DUMMY_STACK_ADJUST;
+ }
+
+ /* Store the address at which the structure is supposed to be
+ written. */
+ /* NOTE: 2003-03-24: Since PUSH_ARGUMENTS can (and typically does)
+ store the struct return address, this call is entirely redundant. */
+ if (struct_return && DEPRECATED_STORE_STRUCT_RETURN_P ())
+ DEPRECATED_STORE_STRUCT_RETURN (struct_addr, sp);
+
+ /* Write the stack pointer. This is here because the statements above
+ might fool with it. On SPARC, this write also stores the register
+ window into the right place in the new stack frame, which otherwise
+ wouldn't happen. (See store_inferior_registers in sparc-nat.c.) */
+ /* NOTE: cagney/2003-03-23: Disable this code when there is a
+ push_dummy_call() method. Since that method will have already
+ stored the stack pointer (as part of creating the fake call
+ frame), and none of the code following that code adjusts the
+ stack-pointer value, the below call is entirely redundant. */
+ if (DEPRECATED_DUMMY_WRITE_SP_P ())
+ DEPRECATED_DUMMY_WRITE_SP (sp);
+
+ if (SAVE_DUMMY_FRAME_TOS_P ())
+ SAVE_DUMMY_FRAME_TOS (sp);
+
+ /* Now proceed, having reached the desired place. */
+ clear_proceed_status ();
+
+ /* Create a momentary breakpoint at the return address of the
+ inferior. That way it breaks when it returns. */
+
+ {
+ struct breakpoint *bpt;
+ struct symtab_and_line sal;
+ struct frame_id frame;
+ init_sal (&sal); /* initialize to zeroes */
+ sal.pc = bp_addr;
+ sal.section = find_pc_overlay (sal.pc);
+ /* Set up a frame ID for the dummy frame so we can pass it to
+ set_momentary_breakpoint. We need to give the breakpoint a
+ frame ID so that the breakpoint code can correctly re-identify
+ the dummy breakpoint. */
+ /* The assumption here is that push_dummy_call() returned the
+ stack part of the frame ID. Unfortunatly, many older
+ architectures were, via a convoluted mess, relying on the
+ poorly defined and greatly overloaded DEPRECATED_TARGET_READ_FP
+ or DEPRECATED_FP_REGNUM to supply the value. */
+ if (DEPRECATED_TARGET_READ_FP_P ())
+ frame = frame_id_build (DEPRECATED_TARGET_READ_FP (), sal.pc);
+ else if (DEPRECATED_FP_REGNUM >= 0)
+ frame = frame_id_build (read_register (DEPRECATED_FP_REGNUM), sal.pc);
+ else
+ frame = frame_id_build (sp, sal.pc);
+ bpt = set_momentary_breakpoint (sal, frame, bp_call_dummy);
+ bpt->disposition = disp_del;
+ }
+
+ /* Execute a "stack dummy", a piece of code stored in the stack by
+ the debugger to be executed in the inferior.
+
+ The dummy's frame is automatically popped whenever that break is
+ hit. If that is the first time the program stops,
+ call_function_by_hand returns to its caller with that frame
+ already gone and sets RC to 0.
+
+ Otherwise, set RC to a non-zero value. If the called function
+ receives a random signal, we do not allow the user to continue
+ executing it as this may not work. The dummy frame is poped and
+ we return 1. If we hit a breakpoint, we leave the frame in place
+ and return 2 (the frame will eventually be popped when we do hit
+ the dummy end breakpoint). */
+
+ {
+ struct cleanup *old_cleanups = make_cleanup (null_cleanup, 0);
+ int saved_async = 0;
+
+ /* If all error()s out of proceed ended up calling normal_stop
+ (and perhaps they should; it already does in the special case
+ of error out of resume()), then we wouldn't need this. */
+ make_cleanup (breakpoint_auto_delete_contents, &stop_bpstat);
+
+ disable_watchpoints_before_interactive_call_start ();
+ proceed_to_finish = 1; /* We want stop_registers, please... */
+
+ if (target_can_async_p ())
+ saved_async = target_async_mask (0);
+
+ proceed (real_pc, TARGET_SIGNAL_0, 0);
+
+ if (saved_async)
+ target_async_mask (saved_async);
+
+ enable_watchpoints_after_interactive_call_stop ();
+
+ discard_cleanups (old_cleanups);
+ }
+
+ if (stopped_by_random_signal || !stop_stack_dummy)
+ {
+ /* Find the name of the function we're about to complain about. */
+ char *name = NULL;
+ {
+ struct symbol *symbol = find_pc_function (funaddr);
+ if (symbol)
+ name = SYMBOL_PRINT_NAME (symbol);
+ else
+ {
+ /* Try the minimal symbols. */
+ struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (funaddr);
+ if (msymbol)
+ name = SYMBOL_PRINT_NAME (msymbol);
+ }
+ }
+ if (name == NULL)
+ {
+ /* NOTE: cagney/2003-04-23: Don't blame me. This code dates
+ back to 1993-07-08, I simply moved it. */
+ char format[80];
+ sprintf (format, "at %s", local_hex_format ());
+ name = alloca (80);
+ /* FIXME-32x64: assumes funaddr fits in a long. */
+ sprintf (name, format, (unsigned long) funaddr);
+ }
+ if (stopped_by_random_signal)
+ {
+ /* We stopped inside the FUNCTION because of a random
+ signal. Further execution of the FUNCTION is not
+ allowed. */
+
+ if (unwind_on_signal_p)
+ {
+ /* The user wants the context restored. */
+
+ /* We must get back to the frame we were before the
+ dummy call. */
+ frame_pop (get_current_frame ());
+
+ /* FIXME: Insert a bunch of wrap_here; name can be very
+ long if it's a C++ name with arguments and stuff. */
+ error ("\
+The program being debugged was signaled while in a function called from GDB.\n\
+GDB has restored the context to what it was before the call.\n\
+To change this behavior use \"set unwindonsignal off\"\n\
+Evaluation of the expression containing the function (%s) will be abandoned.",
+ name);
+ }
+ else
+ {
+ /* The user wants to stay in the frame where we stopped
+ (default).*/
+ /* If we restored the inferior status (via the cleanup),
+ we would print a spurious error message (Unable to
+ restore previously selected frame), would write the
+ registers from the inf_status (which is wrong), and
+ would do other wrong things. */
+ discard_cleanups (inf_status_cleanup);
+ discard_inferior_status (inf_status);
+ /* FIXME: Insert a bunch of wrap_here; name can be very
+ long if it's a C++ name with arguments and stuff. */
+ error ("\
+The program being debugged was signaled while in a function called from GDB.\n\
+GDB remains in the frame where the signal was received.\n\
+To change this behavior use \"set unwindonsignal on\"\n\
+Evaluation of the expression containing the function (%s) will be abandoned.",
+ name);
+ }
+ }
+
+ if (!stop_stack_dummy)
+ {
+ /* We hit a breakpoint inside the FUNCTION. */
+ /* If we restored the inferior status (via the cleanup), we
+ would print a spurious error message (Unable to restore
+ previously selected frame), would write the registers
+ from the inf_status (which is wrong), and would do other
+ wrong things. */
+ discard_cleanups (inf_status_cleanup);
+ discard_inferior_status (inf_status);
+ /* The following error message used to say "The expression
+ which contained the function call has been discarded."
+ It is a hard concept to explain in a few words. Ideally,
+ GDB would be able to resume evaluation of the expression
+ when the function finally is done executing. Perhaps
+ someday this will be implemented (it would not be easy). */
+ /* FIXME: Insert a bunch of wrap_here; name can be very long if it's
+ a C++ name with arguments and stuff. */
+ error ("\
+The program being debugged stopped while in a function called from GDB.\n\
+When the function (%s) is done executing, GDB will silently\n\
+stop (instead of continuing to evaluate the expression containing\n\
+the function call).", name);
+ }
+
+ /* The above code errors out, so ... */
+ internal_error (__FILE__, __LINE__, "... should not be here");
+ }
+
+ /* If we get here the called FUNCTION run to completion. */
+
+ /* On normal return, the stack dummy has been popped already. */
+ regcache_cpy_no_passthrough (retbuf, stop_registers);
+
+ /* Restore the inferior status, via its cleanup. At this stage,
+ leave the RETBUF alone. */
+ do_cleanups (inf_status_cleanup);
+
+ /* Figure out the value returned by the function. */
+ /* elz: I defined this new macro for the hppa architecture only.
+ this gives us a way to get the value returned by the function
+ from the stack, at the same address we told the function to put
+ it. We cannot assume on the pa that r28 still contains the
+ address of the returned structure. Usually this will be
+ overwritten by the callee. I don't know about other
+ architectures, so I defined this macro */
+#ifdef VALUE_RETURNED_FROM_STACK
+ if (struct_return)
+ {
+ do_cleanups (retbuf_cleanup);
+ return VALUE_RETURNED_FROM_STACK (value_type, struct_addr);
+ }
+#endif
+ /* NOTE: cagney/2002-09-10: Only when the stack has been correctly
+ aligned (using frame_align()) do we can trust STRUCT_ADDR and
+ fetch the return value direct from the stack. This lack of trust
+ comes about because legacy targets have a nasty habit of
+ silently, and local to PUSH_ARGUMENTS(), moving STRUCT_ADDR. For
+ such targets, just hope that value_being_returned() can find the
+ adjusted value. */
+ if (struct_return && gdbarch_frame_align_p (current_gdbarch))
+ {
+ struct value *retval = value_at (value_type, struct_addr, NULL);
+ do_cleanups (retbuf_cleanup);
+ return retval;
+ }
+ else
+ {
+ struct value *retval = value_being_returned (value_type, retbuf,
+ struct_return);
+ do_cleanups (retbuf_cleanup);
+ return retval;
+ }
+}
+
+void _initialize_infcall (void);
+
+void
+_initialize_infcall (void)
+{
+ add_setshow_boolean_cmd ("coerce-float-to-double", class_obscure,
+ &coerce_float_to_double_p, "\
+Set coercion of floats to doubles when calling functions\n\
+Variables of type float should generally be converted to doubles before\n\
+calling an unprototyped function, and left alone when calling a prototyped\n\
+function. However, some older debug info formats do not provide enough\n\
+information to determine that a function is prototyped. If this flag is\n\
+set, GDB will perform the conversion for a function it considers\n\
+unprototyped.\n\
+The default is to perform the conversion.\n", "\
+Show coercion of floats to doubles when calling functions\n\
+Variables of type float should generally be converted to doubles before\n\
+calling an unprototyped function, and left alone when calling a prototyped\n\
+function. However, some older debug info formats do not provide enough\n\
+information to determine that a function is prototyped. If this flag is\n\
+set, GDB will perform the conversion for a function it considers\n\
+unprototyped.\n\
+The default is to perform the conversion.\n",
+ NULL, NULL, &setlist, &showlist);
+
+ add_setshow_boolean_cmd ("unwindonsignal", no_class,
+ &unwind_on_signal_p, "\
+Set unwinding of stack if a signal is received while in a call dummy.\n\
+The unwindonsignal lets the user determine what gdb should do if a signal\n\
+is received while in a function called from gdb (call dummy). If set, gdb\n\
+unwinds the stack and restore the context to what as it was before the call.\n\
+The default is to stop in the frame where the signal was received.", "\
+Set unwinding of stack if a signal is received while in a call dummy.\n\
+The unwindonsignal lets the user determine what gdb should do if a signal\n\
+is received while in a function called from gdb (call dummy). If set, gdb\n\
+unwinds the stack and restore the context to what as it was before the call.\n\
+The default is to stop in the frame where the signal was received.",
+ NULL, NULL, &setlist, &showlist);
+}
diff --git a/gdb/infcall.h b/gdb/infcall.h
new file mode 100644
index 00000000000..05d06e034bf
--- /dev/null
+++ b/gdb/infcall.h
@@ -0,0 +1,43 @@
+/* Perform an inferior function call, for GDB, the GNU debugger.
+
+ Copyright 2003 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. */
+
+#ifndef INFCALL_H
+#define INFCALL_H
+
+struct value;
+struct type;
+
+extern CORE_ADDR find_function_addr (struct value *function,
+ struct type **retval_type);
+
+/* Perform a function call in the inferior.
+
+ ARGS is a vector of values of arguments (NARGS of them). FUNCTION
+ is a value, the function to be called. Returns a value
+ representing what the function returned. May fail to return, if a
+ breakpoint or signal is hit during the execution of the function.
+
+ ARGS is modified to contain coerced values. */
+
+extern struct value *call_function_by_hand (struct value *function, int nargs,
+ struct value **args);
+
+#endif
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 01ab3d7b0de..de6c319608d 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -115,8 +115,6 @@ void _initialize_infcmd (void);
#define GO_USAGE "Usage: go <location>\n"
-static void breakpoint_auto_delete_contents (void *);
-
#define ERROR_NO_INFERIOR \
if (!target_has_execution) error ("The program is not being run.");
@@ -950,112 +948,6 @@ signal_command (char *signum_exp, int from_tty)
proceed (oursig == TARGET_SIGNAL_0 ? (CORE_ADDR) -1 : stop_pc, oursig, 0);
}
-/* Call breakpoint_auto_delete on the current contents of the bpstat
- pointed to by arg (which is really a bpstat *). */
-
-static void
-breakpoint_auto_delete_contents (void *arg)
-{
- breakpoint_auto_delete (*(bpstat *) arg);
-}
-
-
-/* Execute a "stack dummy", a piece of code stored in the stack
- by the debugger to be executed in the inferior.
-
- To call: first, do PUSH_DUMMY_FRAME.
- Then push the contents of the dummy. It should end with a breakpoint insn.
- Then call here, passing address at which to start the dummy.
-
- The contents of all registers are saved before the dummy frame is popped
- and copied into the buffer BUFFER.
-
- The dummy's frame is automatically popped whenever that break is hit.
- If that is the first time the program stops, run_stack_dummy
- returns to its caller with that frame already gone and returns 0.
-
- Otherwise, run_stack-dummy returns a non-zero value.
- If the called function receives a random signal, we do not allow the user
- to continue executing it as this may not work. The dummy frame is poped
- and we return 1.
- If we hit a breakpoint, we leave the frame in place and return 2 (the frame
- will eventually be popped when we do hit the dummy end breakpoint). */
-
-int
-run_stack_dummy (CORE_ADDR addr, struct regcache *buffer)
-{
- struct cleanup *old_cleanups = make_cleanup (null_cleanup, 0);
- int saved_async = 0;
- struct breakpoint *bpt;
- struct symtab_and_line sal;
-
- /* Now proceed, having reached the desired place. */
- clear_proceed_status ();
-
- init_sal (&sal); /* initialize to zeroes */
- if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
- {
- sal.pc = CALL_DUMMY_ADDRESS ();
- }
- else
- {
- /* If defined, CALL_DUMMY_BREAKPOINT_OFFSET is where we need to
- put a breakpoint instruction. If not, the call dummy already
- has the breakpoint instruction in it.
-
- ADDR IS THE ADDRESS of the call dummy plus the
- CALL_DUMMY_START_OFFSET, so we need to subtract the
- CALL_DUMMY_START_OFFSET. */
- sal.pc = addr - CALL_DUMMY_START_OFFSET + CALL_DUMMY_BREAKPOINT_OFFSET;
- }
- sal.section = find_pc_overlay (sal.pc);
-
- {
- /* Set up a frame ID for the dummy frame so we can pass it to
- set_momentary_breakpoint. We need to give the breakpoint a
- frame ID so that the breakpoint code can correctly re-identify
- the dummy breakpoint. */
- struct frame_id frame = frame_id_build (read_fp (), sal.pc);
- /* Create a momentary breakpoint at the return address of the
- inferior. That way it breaks when it returns. */
- bpt = set_momentary_breakpoint (sal, frame, bp_call_dummy);
- bpt->disposition = disp_del;
- }
-
- /* If all error()s out of proceed ended up calling normal_stop (and
- perhaps they should; it already does in the special case of error
- out of resume()), then we wouldn't need this. */
- make_cleanup (breakpoint_auto_delete_contents, &stop_bpstat);
-
- disable_watchpoints_before_interactive_call_start ();
- proceed_to_finish = 1; /* We want stop_registers, please... */
-
- if (target_can_async_p ())
- saved_async = target_async_mask (0);
-
- proceed (addr, TARGET_SIGNAL_0, 0);
-
- if (saved_async)
- target_async_mask (saved_async);
-
- enable_watchpoints_after_interactive_call_stop ();
-
- discard_cleanups (old_cleanups);
-
- /* We can stop during an inferior call because a signal is received. */
- if (stopped_by_random_signal)
- return 1;
-
- /* We may also stop prematurely because we hit a breakpoint in the
- called routine. */
- if (!stop_stack_dummy)
- return 2;
-
- /* On normal return, the stack dummy has been popped already. */
- regcache_cpy_no_passthrough (buffer, stop_registers);
- return 0;
-}
-
/* Proceed until we reach a different source line with pc greater than
our current one or exit the function. We skip calls in both cases.
@@ -1608,8 +1500,8 @@ default_print_registers_info (struct gdbarch *gdbarch,
{
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);
+ char raw_buffer[MAX_REGISTER_SIZE];
+ char virtual_buffer[MAX_REGISTER_SIZE];
if (DEPRECATED_DO_REGISTERS_INFO_P ())
{
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 62034492915..1de3b25e39b 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -164,8 +164,6 @@ extern void terminal_save_ours (void);
extern void terminal_ours (void);
-extern int run_stack_dummy (CORE_ADDR , struct regcache *);
-
extern CORE_ADDR read_pc (void);
extern CORE_ADDR read_pc_pid (ptid_t);
@@ -184,9 +182,7 @@ extern CORE_ADDR generic_target_read_sp (void);
extern void generic_target_write_sp (CORE_ADDR);
-extern CORE_ADDR read_fp (void);
-
-extern CORE_ADDR generic_target_read_fp (void);
+extern CORE_ADDR deprecated_read_fp (void);
extern CORE_ADDR unsigned_pointer_to_address (struct type *type, const void *buf);
@@ -489,13 +485,14 @@ extern int deprecated_pc_in_call_dummy_at_entry_point (CORE_ADDR pc,
Note that this macro is intended for targets (like HP-UX) which
require more than a single breakpoint in their call dummies, and
- therefore cannot use the CALL_DUMMY_BREAKPOINT_OFFSET mechanism.
-
- If a target does define CALL_DUMMY_BREAKPOINT_OFFSET, then this
- default implementation of CALL_DUMMY_HAS_COMPLETED is sufficient.
- Else, a target may wish to supply an implementation that works in
- the presense of multiple breakpoints in its call dummy.
- */
+ therefore cannot use the DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET
+ mechanism.
+
+ If a target does define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET,
+ then this default implementation of CALL_DUMMY_HAS_COMPLETED is
+ sufficient. Else, a target may wish to supply an implementation
+ that works in the presense of multiple breakpoints in its call
+ dummy. */
#if !defined(CALL_DUMMY_HAS_COMPLETED)
#define CALL_DUMMY_HAS_COMPLETED(pc, sp, frame_address) \
DEPRECATED_PC_IN_CALL_DUMMY((pc), (sp), (frame_address))
diff --git a/gdb/infptrace.c b/gdb/infptrace.c
index a142080cf8c..1225dd8a62c 100644
--- a/gdb/infptrace.c
+++ b/gdb/infptrace.c
@@ -359,7 +359,7 @@ fetch_register (int regno)
char mess[128]; /* For messages */
register int i;
unsigned int offset; /* Offset of registers within the u area. */
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
int tid;
if (CANNOT_FETCH_REGISTER (regno))
@@ -424,7 +424,7 @@ store_register (int regno)
register int i;
unsigned int offset; /* Offset of registers within the u area. */
int tid;
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
if (CANNOT_STORE_REGISTER (regno))
{
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 9503b106faf..df179682109 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -667,6 +667,12 @@ clear_proceed_status (void)
bpstat_clear (&stop_bpstat);
}
+
+/* Record the pc of the program the last time it stopped. This is
+ just used internally by wait_for_inferior, but need to be preserved
+ over calls to it and cleared when the inferior is started. */
+static CORE_ADDR prev_pc;
+
/* Basic routine for continuing the program in various fashions.
ADDR is the address to resume at, or -1 for resume where stopped.
@@ -772,6 +778,30 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
inferior. */
gdb_flush (gdb_stdout);
+ /* Refresh prev_pc value just prior to resuming. This used to be
+ done in stop_stepping, however, setting prev_pc there did not handle
+ scenarios such as inferior function calls or returning from
+ a function via the return command. In those cases, the prev_pc
+ value was not set properly for subsequent commands. The prev_pc value
+ is used to initialize the starting line number in the ecs. With an
+ invalid value, the gdb next command ends up stopping at the position
+ represented by the next line table entry past our start position.
+ On platforms that generate one line table entry per line, this
+ is not a problem. However, on the ia64, the compiler generates
+ extraneous line table entries that do not increase the line number.
+ When we issue the gdb next command on the ia64 after an inferior call
+ or a return command, we often end up a few instructions forward, still
+ within the original line we started.
+
+ An attempt was made to have init_execution_control_state () refresh
+ the prev_pc value before calculating the line number. This approach
+ did not work because on platforms that use ptrace, the pc register
+ cannot be read unless the inferior is stopped. At that point, we
+ are not guaranteed the inferior is stopped and so the read_pc ()
+ call can fail. Setting the prev_pc value here ensures the value is
+ updated correctly when the inferior is stopped. */
+ prev_pc = read_pc ();
+
/* Resume inferior. */
resume (oneproc || step || bpstat_should_step (), stop_signal);
@@ -785,13 +815,6 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
normal_stop ();
}
}
-
-/* Record the pc and sp of the program the last time it stopped.
- These are just used internally by wait_for_inferior, but need
- to be preserved over calls to it and cleared when the inferior
- is started. */
-static CORE_ADDR prev_pc;
-static char *prev_func_name;
/* Start remote-debugging of a machine over a serial link. */
@@ -829,7 +852,6 @@ init_wait_for_inferior (void)
{
/* These are meaningless until the first time through wait_for_inferior. */
prev_pc = 0;
- prev_func_name = NULL;
#ifdef HP_OS_BUG
trap_expected_after_continue = 0;
@@ -1116,7 +1138,7 @@ context_switch (struct execution_control_state *ecs)
if (in_thread_list (inferior_ptid) && in_thread_list (ecs->ptid))
{ /* Perform infrun state context switch: */
/* Save infrun state for the old thread. */
- save_infrun_state (inferior_ptid, prev_pc, prev_func_name,
+ save_infrun_state (inferior_ptid, prev_pc,
trap_expected, step_resume_breakpoint,
through_sigtramp_breakpoint, step_range_start,
step_range_end, &step_frame_id,
@@ -1127,7 +1149,7 @@ context_switch (struct execution_control_state *ecs)
ecs->current_line, ecs->current_symtab, step_sp);
/* Load infrun state for the new thread. */
- load_infrun_state (ecs->ptid, &prev_pc, &prev_func_name,
+ load_infrun_state (ecs->ptid, &prev_pc,
&trap_expected, &step_resume_breakpoint,
&through_sigtramp_breakpoint, &step_range_start,
&step_range_end, &step_frame_id,
@@ -1140,6 +1162,39 @@ context_switch (struct execution_control_state *ecs)
inferior_ptid = ecs->ptid;
}
+/* Wrapper for PC_IN_SIGTRAMP that takes care of the need to find the
+ function's name.
+
+ In a classic example of "left hand VS right hand", "infrun.c" was
+ trying to improve GDB's performance by caching the result of calls
+ to calls to find_pc_partial_funtion, while at the same time
+ find_pc_partial_function was also trying to ramp up performance by
+ caching its most recent return value. The below makes the the
+ function find_pc_partial_function solely responsibile for
+ performance issues (the local cache that relied on a global
+ variable - arrrggg - deleted).
+
+ Using the testsuite and gcov, it was found that dropping the local
+ "infrun.c" cache and instead relying on find_pc_partial_function
+ increased the number of calls to 12000 (from 10000), but the number
+ of times find_pc_partial_function's cache missed (this is what
+ matters) was only increased by only 4 (to 3569). (A quick back of
+ envelope caculation suggests that the extra 2000 function calls
+ @1000 extra instructions per call make the 1 MIP VAX testsuite run
+ take two extra seconds, oops :-)
+
+ Long term, this function can be eliminated, replaced by the code:
+ get_frame_type(current_frame()) == SIGTRAMP_FRAME (for new
+ architectures this is very cheap). */
+
+static int
+pc_in_sigtramp (CORE_ADDR pc)
+{
+ char *name;
+ find_pc_partial_function (pc, &name, NULL, NULL);
+ return PC_IN_SIGTRAMP (pc, name);
+}
+
/* Given an execution control state that has been freshly filled in
by an event from the inferior, figure out what it means and take
@@ -2262,8 +2317,8 @@ process_event_stop_test:
ecs->update_step_sp = 1;
/* Did we just take a signal? */
- if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
- && !PC_IN_SIGTRAMP (prev_pc, prev_func_name)
+ if (pc_in_sigtramp (stop_pc)
+ && !pc_in_sigtramp (prev_pc)
&& INNER_THAN (read_sp (), step_sp))
{
/* We've just taken a signal; go until we are back to
@@ -2373,7 +2428,7 @@ process_event_stop_test:
{
/* We're doing a "next". */
- if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
+ if (pc_in_sigtramp (stop_pc)
&& frame_id_inner (step_frame_id,
frame_id_build (read_sp (), 0)))
/* We stepped out of a signal handler, and into its
@@ -2562,8 +2617,8 @@ static void
check_sigtramp2 (struct execution_control_state *ecs)
{
if (trap_expected
- && PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
- && !PC_IN_SIGTRAMP (prev_pc, prev_func_name)
+ && pc_in_sigtramp (stop_pc)
+ && !pc_in_sigtramp (prev_pc)
&& INNER_THAN (read_sp (), step_sp))
{
/* What has happened here is that we have just stepped the
@@ -2727,15 +2782,6 @@ step_over_function (struct execution_control_state *ecs)
static void
stop_stepping (struct execution_control_state *ecs)
{
- if (target_has_execution)
- {
- /* Assuming the inferior still exists, set these up for next
- time, just like we did above if we didn't break out of the
- loop. */
- prev_pc = read_pc ();
- prev_func_name = ecs->stop_func_name;
- }
-
/* Let callers know we don't want to wait for the inferior anymore. */
ecs->wait_some_more = 0;
}
@@ -2749,7 +2795,6 @@ keep_going (struct execution_control_state *ecs)
{
/* Save the pc before execution, to compare with pc after stop. */
prev_pc = read_pc (); /* Might have been DECR_AFTER_BREAK */
- prev_func_name = ecs->stop_func_name;
if (ecs->update_step_sp)
step_sp = read_sp ();
diff --git a/gdb/irix4-nat.c b/gdb/irix4-nat.c
index b44c5bbba49..63ca71e6bc6 100644
--- a/gdb/irix4-nat.c
+++ b/gdb/irix4-nat.c
@@ -51,8 +51,8 @@ supply_gregset (gregset_t *gregsetp)
{
register int regi;
register greg_t *regp = (greg_t *) (gregsetp->gp_regs);
- char *zerobuf = alloca (max_register_size (current_gdbarch));
- memset (zerobuf, 0, max_register_size (current_gdbarch));
+ char zerobuf[MAX_REGISTER_SIZE];
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
/* FIXME: somewhere, there should be a #define for the meaning
of this magic number 32; we should use that. */
@@ -104,8 +104,8 @@ void
supply_fpregset (fpregset_t *fpregsetp)
{
register int regi;
- char *zerobuf = alloca (max_register_size (current_gdbarch));
- memset (zerobuf, 0, max_register_size (current_gdbarch));
+ char zerobuf[MAX_REGISTER_SIZE];
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = 0; regi < 32; regi++)
supply_register (FP0_REGNUM + regi,
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 2738b1e1dec..ea52a803620 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -33,6 +33,7 @@
#include "cp-abi.h"
#include "parser-defs.h"
#include "block.h"
+#include "objc-lang.h"
/* We share this one with symtab.c, but it is not exported widely. */
@@ -49,6 +50,12 @@ static struct symtabs_and_lines decode_indirect (char **argptr);
static char *locate_first_half (char **argptr, int *is_quote_enclosed);
+static struct symtabs_and_lines decode_objc (char **argptr,
+ int funfirstline,
+ struct symtab *file_symtab,
+ char ***canonical,
+ char *saved_arg);
+
static struct symtabs_and_lines decode_compound (char **argptr,
int funfirstline,
char ***canonical,
@@ -589,6 +596,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
int is_quoted;
/* Is part of *ARGPTR is enclosed in double quotes? */
int is_quote_enclosed;
+ int is_objc_method = 0;
char *saved_arg = *argptr;
/* Defaults have defaults. */
@@ -614,6 +622,25 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
p = locate_first_half (argptr, &is_quote_enclosed);
+ /* Check if this is an Objective-C method (anything that starts with
+ a '+' or '-' and a '['). */
+ if (*p && (p[0] == ':') && (strchr ("+-", p[1]) != NULL)
+ && (p[2] == '['))
+ {
+ is_objc_method = 1;
+ paren_pointer = NULL; /* Just a category name. Ignore it. */
+ }
+
+ /* Check if the symbol could be an Objective-C selector. */
+
+ {
+ struct symtabs_and_lines values;
+ values = decode_objc (argptr, funfirstline, NULL,
+ canonical, saved_arg);
+ if (values.sals != NULL)
+ return values;
+ }
+
/* Does it look like there actually were two parts? */
if ((p[0] == ':' || p[0] == '.') && paren_pointer == NULL)
@@ -695,6 +722,11 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
if (p[-1] != '\'')
error ("Unmatched single quote.");
}
+ else if (is_objc_method)
+ {
+ /* allow word separators in method names for Obj-C */
+ p = skip_quoted_chars (*argptr, NULL, "");
+ }
else if (paren_pointer != NULL)
{
p = paren_pointer + 1;
@@ -893,6 +925,13 @@ locate_first_half (char **argptr, int *is_quote_enclosed)
error ("malformed template specification in command");
p = temp_end;
}
+ /* Check for a colon and a plus or minus and a [ (which
+ indicates an Objective-C method) */
+ if (*p && (p[0] == ':') && (strchr ("+-", p[1]) != NULL)
+ && (p[2] == '['))
+ {
+ break;
+ }
/* Check for the end of the first half of the linespec. End of
line, a tab, a double colon or the last single colon, or a
space. But if enclosed in double quotes we do not break on
@@ -936,6 +975,95 @@ locate_first_half (char **argptr, int *is_quote_enclosed)
+/* Here's where we recognise an Objective-C Selector. An Objective C
+ selector may be implemented by more than one class, therefore it
+ may represent more than one method/function. This gives us a
+ situation somewhat analogous to C++ overloading. If there's more
+ than one method that could represent the selector, then use some of
+ the existing C++ code to let the user choose one. */
+
+struct symtabs_and_lines
+decode_objc (char **argptr, int funfirstline, struct symtab *file_symtab,
+ char ***canonical, char *saved_arg)
+{
+ struct symtabs_and_lines values;
+ struct symbol **sym_arr = NULL;
+ struct symbol *sym = NULL;
+ char *copy = NULL;
+ struct block *block = NULL;
+ int i1 = 0;
+ int i2 = 0;
+
+ values.sals = NULL;
+ values.nelts = 0;
+
+ if (file_symtab != NULL)
+ block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_symtab), STATIC_BLOCK);
+ else
+ block = get_selected_block (0);
+
+ copy = find_imps (file_symtab, block, *argptr, NULL, &i1, &i2);
+
+ if (i1 > 0)
+ {
+ sym_arr = (struct symbol **) alloca ((i1 + 1) * sizeof (struct symbol *));
+ sym_arr[i1] = 0;
+
+ copy = find_imps (file_symtab, block, *argptr, sym_arr, &i1, &i2);
+ *argptr = copy;
+ }
+
+ /* i1 now represents the TOTAL number of matches found.
+ i2 represents how many HIGH-LEVEL (struct symbol) matches,
+ which will come first in the sym_arr array. Any low-level
+ (minimal_symbol) matches will follow those. */
+
+ if (i1 == 1)
+ {
+ if (i2 > 0)
+ {
+ /* Already a struct symbol. */
+ sym = sym_arr[0];
+ }
+ else
+ {
+ sym = find_pc_function (SYMBOL_VALUE_ADDRESS (sym_arr[0]));
+ if ((sym != NULL) && strcmp (SYMBOL_LINKAGE_NAME (sym_arr[0]), SYMBOL_LINKAGE_NAME (sym)) != 0)
+ {
+ warning ("debugging symbol \"%s\" does not match selector; ignoring", SYMBOL_LINKAGE_NAME (sym));
+ sym = NULL;
+ }
+ }
+
+ values.sals = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line));
+ values.nelts = 1;
+
+ if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
+ {
+ /* Canonicalize this, so it remains resolved for dylib loads. */
+ values.sals[0] = find_function_start_sal (sym, funfirstline);
+ build_canonical_line_spec (values.sals, SYMBOL_NATURAL_NAME (sym), canonical);
+ }
+ else
+ {
+ /* The only match was a non-debuggable symbol. */
+ values.sals[0].symtab = 0;
+ values.sals[0].line = 0;
+ values.sals[0].end = 0;
+ values.sals[0].pc = SYMBOL_VALUE_ADDRESS (sym_arr[0]);
+ }
+ return values;
+ }
+
+ if (i1 > 1)
+ {
+ /* More than one match. The user must choose one or more. */
+ return decode_line_2 (sym_arr, i2, funfirstline, canonical);
+ }
+
+ return values;
+}
+
/* This handles C++ and Java compound data structures. P should point
at the first component separator, i.e. double-colon or period. */
diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c
index 4be7fb8e1ab..f425cb9c37a 100644
--- a/gdb/lynx-nat.c
+++ b/gdb/lynx-nat.c
@@ -283,7 +283,7 @@ fetch_inferior_registers (int regno)
if (whatregs & WHATREGS_GEN)
{
struct econtext ec; /* general regs */
- char *buf = alloca (max_register_size (current_gdbarch));
+ char buf[MAX_REGISTER_SIZE];
int retval;
int i;
@@ -512,7 +512,7 @@ fetch_inferior_registers (int regno)
ecp = registers_addr (PIDGET (inferior_ptid));
{
- char *buf = alloca (max_register_size (current_gdbarch));
+ char buf[MAX_REGISTER_SIZE];
for (regno = reglo; regno <= reghi; regno++)
{
int ptrace_fun = PTRACE_PEEKTHREAD;
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 37d27a544be..fb174206e2c 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -1367,23 +1367,21 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_read_pc (gdbarch, generic_target_read_pc);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
- set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
set_gdbarch_sp_regnum (gdbarch, HARD_SP_REGNUM);
- set_gdbarch_fp_regnum (gdbarch, SOFT_FP_REGNUM);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, SOFT_FP_REGNUM);
set_gdbarch_register_name (gdbarch, m68hc11_register_name);
- set_gdbarch_register_size (gdbarch, 2);
+ set_gdbarch_deprecated_register_size (gdbarch, 2);
set_gdbarch_register_bytes (gdbarch, M68HC11_ALL_REGS * 2);
set_gdbarch_register_virtual_type (gdbarch, m68hc11_register_virtual_type);
set_gdbarch_pseudo_register_read (gdbarch, m68hc11_pseudo_register_read);
set_gdbarch_pseudo_register_write (gdbarch, m68hc11_pseudo_register_write);
set_gdbarch_call_dummy_address (gdbarch, m68hc11_call_dummy_address);
- set_gdbarch_call_dummy_words (gdbarch, m68hc11_call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch,
- sizeof (m68hc11_call_dummy_words));
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, m68hc11_call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (m68hc11_call_dummy_words));
set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
set_gdbarch_deprecated_extract_return_value (gdbarch, m68hc11_extract_return_value);
set_gdbarch_deprecated_push_arguments (gdbarch, m68hc11_push_arguments);
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index 1ad176e3ad0..aabb13ab597 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -429,9 +429,9 @@ void
m68k_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
struct value **args, struct type *type, int gcc_p)
{
- bfd_putb32 (fun, (unsigned char *) dummy + CALL_DUMMY_START_OFFSET + 2);
+ bfd_putb32 (fun, (unsigned char *) dummy + DEPRECATED_CALL_DUMMY_START_OFFSET + 2);
bfd_putb32 (nargs * 4,
- (unsigned char *) dummy + CALL_DUMMY_START_OFFSET + 8);
+ (unsigned char *) dummy + DEPRECATED_CALL_DUMMY_START_OFFSET + 8);
}
@@ -445,8 +445,8 @@ m68k_push_dummy_frame (void)
char raw_buffer[12];
sp = push_word (sp, read_register (PC_REGNUM));
- sp = push_word (sp, read_register (FP_REGNUM));
- write_register (FP_REGNUM, sp);
+ sp = push_word (sp, read_register (DEPRECATED_FP_REGNUM));
+ write_register (DEPRECATED_FP_REGNUM, sp);
/* Always save the floating-point registers, whether they exist on
this target or not. */
@@ -456,7 +456,7 @@ m68k_push_dummy_frame (void)
sp = push_bytes (sp, raw_buffer, 12);
}
- for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--)
+ for (regnum = DEPRECATED_FP_REGNUM - 1; regnum >= 0; regnum--)
{
sp = push_word (sp, read_register (regnum));
}
@@ -486,7 +486,7 @@ m68k_pop_frame (void)
12);
}
}
- for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--)
+ for (regnum = DEPRECATED_FP_REGNUM - 1; regnum >= 0; regnum--)
{
if (get_frame_saved_regs (frame)[regnum])
{
@@ -499,7 +499,7 @@ m68k_pop_frame (void)
write_register (PS_REGNUM,
read_memory_integer (get_frame_saved_regs (frame)[PS_REGNUM], 4));
}
- write_register (FP_REGNUM, read_memory_integer (fp, 4));
+ write_register (DEPRECATED_FP_REGNUM, read_memory_integer (fp, 4));
write_register (PC_REGNUM, read_memory_integer (fp + 4, 4));
write_register (SP_REGNUM, fp + 8);
flush_cached_frames ();
@@ -589,7 +589,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info)
/* First possible address for a pc in a call dummy for this frame. */
CORE_ADDR possible_call_dummy_start =
- get_frame_base (frame_info) - 28 - FP_REGNUM * 4 - 4 - 8 * 12;
+ get_frame_base (frame_info) - 28 - DEPRECATED_FP_REGNUM * 4 - 4 - 8 * 12;
int nextinsn;
@@ -743,7 +743,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info)
}
lose:;
get_frame_saved_regs (frame_info)[SP_REGNUM] = get_frame_base (frame_info) + 8;
- get_frame_saved_regs (frame_info)[FP_REGNUM] = get_frame_base (frame_info);
+ get_frame_saved_regs (frame_info)[DEPRECATED_FP_REGNUM] = get_frame_base (frame_info);
get_frame_saved_regs (frame_info)[PC_REGNUM] = get_frame_base (frame_info) + 4;
#ifdef SIG_SP_FP_OFFSET
/* Adjust saved SP_REGNUM for fake _sigtramp frames. */
@@ -1025,27 +1025,27 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 12);
set_gdbarch_register_virtual_type (gdbarch, m68k_register_virtual_type);
set_gdbarch_register_name (gdbarch, m68k_register_name);
- set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_deprecated_register_size (gdbarch, 4);
set_gdbarch_register_byte (gdbarch, m68k_register_byte);
set_gdbarch_num_regs (gdbarch, 29);
set_gdbarch_register_bytes_ok (gdbarch, m68k_register_bytes_ok);
set_gdbarch_register_bytes (gdbarch, (16 * 4 + 8 + 8 * 12 + 3 * 4));
set_gdbarch_sp_regnum (gdbarch, M68K_SP_REGNUM);
- set_gdbarch_fp_regnum (gdbarch, M68K_FP_REGNUM);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, M68K_FP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, M68K_PC_REGNUM);
set_gdbarch_ps_regnum (gdbarch, M68K_PS_REGNUM);
set_gdbarch_fp0_regnum (gdbarch, M68K_FP0_REGNUM);
set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
- set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 24);
+ set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 24);
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
- set_gdbarch_call_dummy_length (gdbarch, 28);
- set_gdbarch_call_dummy_start_offset (gdbarch, 12);
+ set_gdbarch_deprecated_call_dummy_length (gdbarch, 28);
+ set_gdbarch_deprecated_call_dummy_start_offset (gdbarch, 12);
- set_gdbarch_call_dummy_words (gdbarch, call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_words));
- set_gdbarch_fix_call_dummy (gdbarch, m68k_fix_call_dummy);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_words));
+ set_gdbarch_deprecated_fix_call_dummy (gdbarch, m68k_fix_call_dummy);
set_gdbarch_deprecated_push_dummy_frame (gdbarch, m68k_push_dummy_frame);
set_gdbarch_deprecated_pop_frame (gdbarch, m68k_pop_frame);
@@ -1066,5 +1066,5 @@ void
_initialize_m68k_tdep (void)
{
gdbarch_register (bfd_arch_m68k, m68k_gdbarch_init, m68k_dump_tdep);
- tm_print_insn = print_insn_m68k;
+ deprecated_tm_print_insn = print_insn_m68k;
}
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index 0f0a7d10241..e077deadc27 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -135,7 +135,7 @@ fetch_register (int regno)
char mess[128]; /* For messages */
register int i;
unsigned int offset; /* Offset of registers within the u area. */
- char *buf = alloca (max_register_size (current_gdbarch));
+ char buf[MAX_REGISTER_SIZE];
int tid;
if (CANNOT_FETCH_REGISTER (regno))
@@ -199,7 +199,7 @@ store_register (int regno)
register int i;
unsigned int offset; /* Offset of registers within the u area. */
int tid;
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
if (CANNOT_STORE_REGISTER (regno))
{
diff --git a/gdb/maint.c b/gdb/maint.c
index 2eb59ee5e3a..aa342390765 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -434,18 +434,6 @@ maintenance_print_command (char *arg, int from_tty)
help_list (maintenanceprintlist, "maintenance print ", -1, gdb_stdout);
}
-/* The "maintenance list" command is defined as a prefix, with
- allow_unknown 0. Therefore, its own definition is called only for
- "maintenance list" with no args. */
-
-/* ARGSUSED */
-static void
-maintenance_list_command (char *arg, int from_tty)
-{
- printf_unfiltered ("\"maintenance list\" must be followed by the name of a list command.\n");
- help_list (maintenancelistlist, "maintenance list ", -1, gdb_stdout);
-}
-
/* The "maintenance translate-address" command converts a section and address
to a symbol. This can be called in two ways:
maintenance translate-address <secname> <addr>
@@ -744,11 +732,6 @@ lists all sections from all object files, including shared libraries.",
&maintenanceprintlist, "maintenance print ", 0,
&maintenancelist);
- add_prefix_cmd ("list", class_maintenance, maintenance_list_command,
- "Maintenance command for listing GDB internal state.",
- &maintenancelistlist, "maintenance list ", 0,
- &maintenancelist);
-
add_prefix_cmd ("set", class_maintenance, maintenance_set_cmd, "\
Set GDB internal variables used by the GDB maintainer.\n\
Configure variables internal to GDB that aid in GDB's maintenance",
@@ -827,18 +810,18 @@ If a SOURCE file is specified, dump only that file's partial symbols.",
"Print dump of current object file definitions.",
&maintenanceprintlist);
- add_cmd ("symtabs", class_maintenance, maintenance_list_symtabs,
+ add_cmd ("symtabs", class_maintenance, maintenance_info_symtabs,
"List the full symbol tables for all object files.\n\
This does not include information about individual symbols, blocks, or\n\
linetables --- just the symbol table structures themselves.\n\
With an argument REGEXP, list the symbol tables whose names that match that.",
- &maintenancelistlist);
+ &maintenanceinfolist);
- add_cmd ("psymtabs", class_maintenance, maintenance_list_psymtabs,
+ add_cmd ("psymtabs", class_maintenance, maintenance_info_psymtabs,
"List the partial symbol tables for all object files.\n\
This does not include information about individual partial symbols,\n\
just the symbol table structures themselves.",
- &maintenancelistlist);
+ &maintenanceinfolist);
add_cmd ("statistics", class_maintenance, maintenance_print_statistics,
"Print statistics about internal gdb state.",
diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c
index ab03f3ad765..484c1ec9d22 100644
--- a/gdb/mcore-tdep.c
+++ b/gdb/mcore-tdep.c
@@ -28,6 +28,7 @@
#include "inferior.h"
#include "arch-utils.h"
#include "gdb_string.h"
+#include "disasm.h"
/* Functions declared and used only in this file */
@@ -163,7 +164,7 @@ mcore_dump_insn (char *commnt, CORE_ADDR pc, int insn)
{
printf_filtered ("MCORE: %s %08x %08x ",
commnt, (unsigned int) pc, (unsigned int) insn);
- TARGET_PRINT_INSN (pc, &tm_print_insn_info);
+ gdb_print_insn (pc, gdb_stdout);
printf_filtered ("\n");
}
}
@@ -682,7 +683,8 @@ mcore_frame_chain (struct frame_info * fi)
{
/* The "FP" was saved on the stack. Don't forget to adjust
the "FP" with the framesize to get a real FP. */
- callers_addr = read_memory_integer (get_frame_saved_regs (fi)[fp], REGISTER_SIZE)
+ callers_addr = read_memory_integer (get_frame_saved_regs (fi)[fp],
+ DEPRECATED_REGISTER_SIZE)
+ get_frame_extra_info (dummy)->framesize;
}
else
@@ -766,7 +768,7 @@ mcore_find_callers_reg (struct frame_info *fi, int regnum)
get_frame_base (fi), regnum);
else if (get_frame_saved_regs (fi)[regnum] != 0)
return read_memory_integer (get_frame_saved_regs (fi)[regnum],
- REGISTER_SIZE);
+ DEPRECATED_REGISTER_SIZE);
}
return read_register (regnum);
@@ -813,7 +815,7 @@ mcore_pop_frame (void)
ULONGEST value;
value = read_memory_unsigned_integer (get_frame_saved_regs (fi)[rn],
- REGISTER_SIZE);
+ DEPRECATED_REGISTER_SIZE);
write_register (rn, value);
}
}
@@ -829,9 +831,9 @@ mcore_pop_frame (void)
/* Setup arguments and PR for a call to the target. First six arguments
go in FIRST_ARGREG -> LAST_ARGREG, subsequent args go on to the stack.
- * Types with lengths greater than REGISTER_SIZE may not be split
- between registers and the stack, and they must start in an even-numbered
- register. Subsequent args will go onto the stack.
+ - Types with lengths greater than DEPRECATED_REGISTER_SIZE may not
+ be split between registers and the stack, and they must start in an
+ even-numbered register. Subsequent args will go onto the stack.
* Structs may be split between registers and stack, left-aligned.
@@ -883,21 +885,21 @@ mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
numbered register. */
olen = len;
- if (TYPE_CODE (type) != TYPE_CODE_STRUCT && len > REGISTER_SIZE && argreg % 2)
+ if (TYPE_CODE (type) != TYPE_CODE_STRUCT && len > DEPRECATED_REGISTER_SIZE && argreg % 2)
{
- mcore_insn_debug (("MCORE PUSH: %d > REGISTER_SIZE: and %s is not even\n",
+ mcore_insn_debug (("MCORE PUSH: %d > DEPRECATED_REGISTER_SIZE: and %s is not even\n",
len, mcore_register_names[argreg]));
argreg++;
}
- if ((argreg <= LAST_ARGREG && len <= (LAST_ARGREG - argreg + 1) * REGISTER_SIZE)
+ if ((argreg <= LAST_ARGREG && len <= (LAST_ARGREG - argreg + 1) * DEPRECATED_REGISTER_SIZE)
|| (TYPE_CODE (type) == TYPE_CODE_STRUCT))
{
/* Something that will fit entirely into registers (or a struct
which may be split between registers and stack). */
mcore_insn_debug (("MCORE PUSH: arg %d going into regs\n", argnum));
- if (TYPE_CODE (type) == TYPE_CODE_STRUCT && olen < REGISTER_SIZE)
+ if (TYPE_CODE (type) == TYPE_CODE_STRUCT && olen < DEPRECATED_REGISTER_SIZE)
{
/* Small structs must be right aligned within the register,
the most significant bits are undefined. */
@@ -908,16 +910,16 @@ mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
while (len > 0 && argreg <= LAST_ARGREG)
{
- write_register (argreg, extract_unsigned_integer (val, REGISTER_SIZE));
+ write_register (argreg, extract_unsigned_integer (val, DEPRECATED_REGISTER_SIZE));
argreg++;
- val += REGISTER_SIZE;
- len -= REGISTER_SIZE;
+ val += DEPRECATED_REGISTER_SIZE;
+ len -= DEPRECATED_REGISTER_SIZE;
}
/* Any remainder for the stack is noted below... */
}
else if (TYPE_CODE (VALUE_TYPE (args[argnum])) != TYPE_CODE_STRUCT
- && len > REGISTER_SIZE)
+ && len > DEPRECATED_REGISTER_SIZE)
{
/* All subsequent args go onto the stack. */
mcore_insn_debug (("MCORE PUSH: does not fit into regs, going onto stack\n"));
@@ -990,7 +992,7 @@ mcore_use_struct_convention (int gcc_p, struct type *type)
CORE_ADDR
mcore_extract_struct_value_address (char *regbuf)
{
- return extract_address (regbuf + REGISTER_BYTE (FIRST_ARGREG), REGISTER_SIZE);
+ return extract_address (regbuf + REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE);
}
/* Given a function which returns a value of type TYPE, extract the
@@ -1028,7 +1030,7 @@ mcore_store_return_value (struct type *type, char *valbuf)
value_size = TYPE_LENGTH (type);
/* Return value fits into registers. */
- return_size = (value_size + REGISTER_SIZE - 1) & ~(REGISTER_SIZE - 1);
+ return_size = (value_size + DEPRECATED_REGISTER_SIZE - 1) & ~(DEPRECATED_REGISTER_SIZE - 1);
offset = REGISTER_BYTE (RETVAL_REGNUM) + (return_size - value_size);
zeros = alloca (return_size);
memset (zeros, 0, return_size);
@@ -1058,8 +1060,8 @@ mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi)
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
get_frame_base (fi)))
{
- /* We need to setup fi->frame here because run_stack_dummy gets it wrong
- by assuming it's always FP. */
+ /* We need to setup fi->frame here because call_function_by_hand
+ gets it wrong by assuming it's always FP. */
deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM));
}
else
@@ -1100,7 +1102,7 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Registers: */
/* All registers are 32 bits */
- set_gdbarch_register_size (gdbarch, MCORE_REG_SIZE);
+ set_gdbarch_deprecated_register_size (gdbarch, MCORE_REG_SIZE);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, MCORE_REG_SIZE);
set_gdbarch_deprecated_max_register_virtual_size (gdbarch, MCORE_REG_SIZE);
set_gdbarch_register_name (gdbarch, mcore_register_name);
@@ -1112,12 +1114,12 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_num_regs (gdbarch, MCORE_NUM_REGS);
set_gdbarch_pc_regnum (gdbarch, 64);
set_gdbarch_sp_regnum (gdbarch, 0);
- set_gdbarch_fp_regnum (gdbarch, 0);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, 0);
/* Call Dummies: */
- set_gdbarch_call_dummy_words (gdbarch, call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
set_gdbarch_deprecated_saved_pc_after_call (gdbarch, mcore_saved_pc_after_call);
set_gdbarch_function_start_offset (gdbarch, 0);
@@ -1173,7 +1175,7 @@ _initialize_mcore_tdep (void)
{
extern int print_insn_mcore (bfd_vma, disassemble_info *);
gdbarch_register (bfd_arch_mcore, mcore_gdbarch_init, mcore_dump_tdep);
- tm_print_insn = print_insn_mcore;
+ deprecated_tm_print_insn = print_insn_mcore;
#ifdef MCORE_DEBUG
add_show_from_set (add_set_cmd ("mcoredebug", no_class,
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index 73b4975534c..1580d1fc997 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,3 +1,25 @@
+2003-05-08 Andrew Cagney <cagney@redhat.com>
+
+ * mi-main.c (register_changed_p): Use MAX_REGISTER_SIZE instead of
+ MAX_REGISTER_RAW_SIZE.
+
+2003-05-08 Andrew Cagney <cagney@redhat.com>
+
+ * mi-main.c (get_register): Use MAX_REGISTER_SIZE.
+
+2003-05-05 Andrew Cagney <cagney@redhat.com>
+
+ * mi-main.c (mi_cmd_data_write_register_values): Replace
+ REGISTER_SIZE with DEPRECATED_REGISTER_SIZE.
+
+2003-05-03 J. Brobecker <brobecker@gnat.com>
+
+ From Thierry Schneider <tpschneider1@yahoo.com>:
+ * mi-cmds.h (mi_cmd_symbol_list_lines): Add declaration.
+ * mi-cmds.c (mi_cmds): Add entry for new MI command.
+ * mi-cmd-symbol.c (mi_cmd_symbol_list_lines): New source file
+ for all symbol-related commands.
+
2003-04-02 Bob Rossi <bob_rossi@cox.net>
* mi-cmd-file.c: New file to implement mi file commands.
diff --git a/gdb/mi/mi-cmd-symbol.c b/gdb/mi/mi-cmd-symbol.c
new file mode 100644
index 00000000000..1d86d21d517
--- /dev/null
+++ b/gdb/mi/mi-cmd-symbol.c
@@ -0,0 +1,67 @@
+/* MI Command Set - symbol commands.
+ Copyright 2003 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 "mi-cmds.h"
+#include "symtab.h"
+#include "ui-out.h"
+
+/* SYMBOL-LIST-LINES:
+
+ Print the list of all pc addresses and lines of code for
+ the provided (full or base) source file name. The entries
+ are sorted in ascending PC order. */
+
+enum mi_cmd_result
+mi_cmd_symbol_list_lines (char *command, char **argv, int argc)
+{
+ char *filename;
+ struct symtab *s;
+ int i;
+ struct cleanup *cleanup_stack, *cleanup_tuple;
+
+ if (argc != 1)
+ error ("mi_cmd_symbol_list_lines: Usage: SOURCE_FILENAME");
+
+ filename = argv[0];
+ s = lookup_symtab (filename);
+
+ if (s == NULL)
+ error ("mi_cmd_symbol_list_lines: Unknown source file name.");
+
+ /* Now, dump the associated line table. The pc addresses are already
+ sorted by increasing values in the symbol table, so no need to
+ perform any other sorting. */
+
+ cleanup_stack = make_cleanup_ui_out_list_begin_end (uiout, "lines");
+
+ if (LINETABLE (s) != NULL && LINETABLE (s)->nitems > 0)
+ for (i = 0; i < LINETABLE (s)->nitems; i++)
+ {
+ cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_field_core_addr (uiout, "pc", LINETABLE (s)->item[i].pc);
+ ui_out_field_int (uiout, "line", LINETABLE (s)->item[i].line);
+ do_cleanups (cleanup_tuple);
+ }
+
+ do_cleanups (cleanup_stack);
+
+ return MI_CMD_DONE;
+}
diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
index d6778421339..9ec174fd854 100644
--- a/gdb/mi/mi-cmds.c
+++ b/gdb/mi/mi-cmds.c
@@ -119,6 +119,7 @@ struct mi_cmd mi_cmds[] =
{"symbol-info-line", 0, 0},
{"symbol-info-symbol", 0, 0},
{"symbol-list-functions", 0, 0},
+ {"symbol-list-lines", 0, 0, mi_cmd_symbol_list_lines},
{"symbol-list-types", 0, 0},
{"symbol-list-variables", 0, 0},
{"symbol-locate", 0, 0},
diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h
index 47e1bbf17a7..b0c8cb8db1f 100644
--- a/gdb/mi/mi-cmds.h
+++ b/gdb/mi/mi-cmds.h
@@ -88,6 +88,7 @@ extern mi_cmd_argv_ftype mi_cmd_stack_list_args;
extern mi_cmd_argv_ftype mi_cmd_stack_list_frames;
extern mi_cmd_argv_ftype mi_cmd_stack_list_locals;
extern mi_cmd_argv_ftype mi_cmd_stack_select_frame;
+extern mi_cmd_argv_ftype mi_cmd_symbol_list_lines;
extern mi_cmd_args_ftype mi_cmd_target_download;
extern mi_cmd_args_ftype mi_cmd_target_select;
extern mi_cmd_argv_ftype mi_cmd_thread_list_ids;
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 6ba069821ea..6158c8ff439 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -398,7 +398,7 @@ mi_cmd_data_list_changed_registers (char *command, char **argv, int argc)
static int
register_changed_p (int regnum)
{
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
if (! frame_register_read (deprecated_selected_frame, regnum, raw_buffer))
return -1;
@@ -511,8 +511,8 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc)
static int
get_register (int regnum, int format)
{
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
- char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
+ char virtual_buffer[MAX_REGISTER_SIZE];
int optim;
int realnum;
CORE_ADDR addr;
@@ -636,9 +636,9 @@ mi_cmd_data_write_register_values (char *command, char **argv, int argc)
/* Get the value as a number */
value = parse_and_eval_address (argv[i + 1]);
/* Get the value into an array */
- buffer = xmalloc (REGISTER_SIZE);
+ buffer = xmalloc (DEPRECATED_REGISTER_SIZE);
old_chain = make_cleanup (xfree, buffer);
- store_signed_integer (buffer, REGISTER_SIZE, value);
+ store_signed_integer (buffer, DEPRECATED_REGISTER_SIZE, value);
/* Write it down */
deprecated_write_register_bytes (REGISTER_BYTE (regnum), buffer, REGISTER_RAW_SIZE (regnum));
/* Free the buffer. */
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index ae4e6897949..b8072f1aba7 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -91,7 +91,7 @@ mips_linux_get_longjmp_target (CORE_ADDR *pc)
static void
supply_32bit_reg (int regnum, const void *addr)
{
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
store_signed_integer (buf, REGISTER_RAW_SIZE (regnum),
extract_signed_integer (addr, 4));
supply_register (regnum, buf);
@@ -104,9 +104,9 @@ supply_gregset (elf_gregset_t *gregsetp)
{
int regi;
elf_greg_t *regp = *gregsetp;
- char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = EF_REG0; regi <= EF_REG31; regi++)
supply_32bit_reg ((regi - EF_REG0), (char *)(regp + regi));
@@ -192,9 +192,9 @@ void
supply_fpregset (elf_fpregset_t *fpregsetp)
{
register int regi;
- char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = 0; regi < 32; regi++)
supply_register (FP0_REGNUM + regi,
@@ -379,9 +379,9 @@ mips64_supply_gregset (mips64_elf_gregset_t *gregsetp)
{
int regi;
mips64_elf_greg_t *regp = *gregsetp;
- char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = MIPS64_EF_REG0; regi <= MIPS64_EF_REG31; regi++)
supply_register ((regi - MIPS64_EF_REG0), (char *)(regp + regi));
@@ -467,9 +467,9 @@ static void
mips64_supply_fpregset (mips64_elf_fpregset_t *fpregsetp)
{
register int regi;
- char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = 0; regi < 32; regi++)
supply_register (FP0_REGNUM + regi,
diff --git a/gdb/mips-nat.c b/gdb/mips-nat.c
index f893e339c2e..1a29c3e317a 100644
--- a/gdb/mips-nat.c
+++ b/gdb/mips-nat.c
@@ -70,10 +70,10 @@ void
fetch_inferior_registers (int regno)
{
register unsigned int regaddr;
- char *buf = alloca (max_register_size (current_gdbarch));
+ char buf[MAX_REGISTER_SIZE];
register int i;
- char *zerobuf = alloca (max_register_size (current_gdbarch));
- memset (zerobuf, 0, max_register_size (current_gdbarch));
+ char zerobuf[MAX_REGISTER_SIZE];
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
deprecated_registers_fetched ();
@@ -91,7 +91,7 @@ fetch_inferior_registers (int regno)
supply_register (ZERO_REGNUM, zerobuf);
/* Frame ptr reg must appear to be 0; it is faked by stack handling code. */
- supply_register (FP_REGNUM, zerobuf);
+ supply_register (DEPRECATED_FP_REGNUM, zerobuf);
}
/* Store our register values back into the inferior.
@@ -108,7 +108,7 @@ store_inferior_registers (int regno)
{
if (regno == ZERO_REGNUM || regno == PS_REGNUM
|| regno == BADVADDR_REGNUM || regno == CAUSE_REGNUM
- || regno == FCRIR_REGNUM || regno == FP_REGNUM
+ || regno == FCRIR_REGNUM || regno == DEPRECATED_FP_REGNUM
|| (regno >= FIRST_EMBED_REGNUM && regno <= LAST_EMBED_REGNUM))
return;
regaddr = REGISTER_PTRACE_ADDR (regno);
@@ -174,8 +174,8 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
int bad_reg = -1;
register reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */
- char *zerobuf = alloca (max_register_size (current_gdbarch));
- memset (zerobuf, 0, max_register_size (current_gdbarch));
+ char zerobuf[MAX_REGISTER_SIZE];
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
/* If u.u_ar0 was an absolute address in the core file, relativize it now,
@@ -210,7 +210,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
}
supply_register (ZERO_REGNUM, zerobuf);
/* Frame ptr reg must appear to be 0; it is faked by stack handling code. */
- supply_register (FP_REGNUM, zerobuf);
+ supply_register (DEPRECATED_FP_REGNUM, zerobuf);
}
/* Return the address in the core dump or inferior of register REGNO.
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 7956be49249..bf19ed8d999 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -150,6 +150,36 @@ static const char *mips_saved_regsize_string = size_auto;
#define MIPS_SAVED_REGSIZE (mips_saved_regsize())
+/* Return the contents of register REGNUM as a signed integer. */
+
+static LONGEST
+read_signed_register (int regnum)
+{
+ void *buf = alloca (REGISTER_RAW_SIZE (regnum));
+ deprecated_read_register_gen (regnum, buf);
+ return (extract_signed_integer (buf, REGISTER_RAW_SIZE (regnum)));
+}
+
+static LONGEST
+read_signed_register_pid (int regnum, ptid_t ptid)
+{
+ ptid_t save_ptid;
+ LONGEST retval;
+
+ if (ptid_equal (ptid, inferior_ptid))
+ return read_signed_register (regnum);
+
+ save_ptid = inferior_ptid;
+
+ inferior_ptid = ptid;
+
+ retval = read_signed_register (regnum);
+
+ inferior_ptid = save_ptid;
+
+ return retval;
+}
+
/* Return the MIPS ABI associated with GDBARCH. */
enum mips_abi
mips_abi (struct gdbarch *gdbarch)
@@ -215,7 +245,7 @@ mips_xfer_register (struct regcache *regcache, int reg_num, int length,
enum bfd_endian endian, bfd_byte *in, const bfd_byte *out,
int buf_offset)
{
- bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE);
+ bfd_byte reg[MAX_REGISTER_SIZE];
int reg_offset = 0;
/* Need to transfer the left or right part of the register, based on
the targets byte order. */
@@ -623,9 +653,9 @@ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
Note: kevinb/2002-08-01: The definition below should faithfully
reproduce the behavior of each of the REGISTER_VIRTUAL_TYPE
- definitions found in config/mips/tm-*.h. I'm concerned about
- the ``FCRCS_REGNUM <= reg && reg <= LAST_EMBED_REGNUM'' clause
- though. In some cases FP_REGNUM is in this range, and I doubt
+ definitions found in config/mips/tm-*.h. I'm concerned about the
+ ``FCRCS_REGNUM <= reg && reg <= LAST_EMBED_REGNUM'' clause though.
+ In some cases DEPRECATED_FP_REGNUM is in this range, and I doubt
that this code is correct for the 64-bit case. */
static struct type *
@@ -1612,7 +1642,7 @@ read_next_frame_reg (struct frame_info *fi, int regno)
CORE_ADDR addr;
int realnum;
enum lval_type lval;
- void *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
if (fi == NULL)
{
@@ -2721,7 +2751,7 @@ mips_eabi_push_arguments (int nargs,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val;
- char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char valbuf[MAX_REGISTER_SIZE];
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
int len = TYPE_LENGTH (arg_type);
@@ -2972,7 +3002,7 @@ mips_n32n64_push_arguments (int nargs,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val;
- char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char valbuf[MAX_REGISTER_SIZE];
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
int len = TYPE_LENGTH (arg_type);
@@ -3195,7 +3225,7 @@ mips_o32_push_arguments (int nargs,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val;
- char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char valbuf[MAX_REGISTER_SIZE];
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
int len = TYPE_LENGTH (arg_type);
@@ -3494,7 +3524,7 @@ mips_o64_push_arguments (int nargs,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val;
- char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char valbuf[MAX_REGISTER_SIZE];
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
int len = TYPE_LENGTH (arg_type);
@@ -4014,7 +4044,7 @@ mips_print_fp_register (int regnum)
static void
mips_print_register (int regnum, int all)
{
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
int offset;
if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
@@ -4070,7 +4100,7 @@ static int
do_gp_register_row (int regnum)
{
/* do values for GP (int) regs */
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
int ncols = (MIPS_REGSIZE == 8 ? 4 : 8); /* display cols per row */
int col, byte;
int start_regnum = regnum;
@@ -4573,7 +4603,7 @@ mips_o64_extract_return_value (struct type *valtype,
static void
mips_eabi_store_return_value (struct type *valtype, char *valbuf)
{
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
struct return_value_word lo;
struct return_value_word hi;
return_value_location (valtype, &hi, &lo);
@@ -4595,7 +4625,7 @@ mips_eabi_store_return_value (struct type *valtype, char *valbuf)
static void
mips_o64_store_return_value (struct type *valtype, char *valbuf)
{
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
struct return_value_word lo;
struct return_value_word hi;
return_value_location (valtype, &hi, &lo);
@@ -4677,7 +4707,7 @@ mips_o32_xfer_return_value (struct type *type,
/* A struct that contains one or two floats. Each value is part
in the least significant part of their floating point
register.. */
- bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE);
+ bfd_byte reg[MAX_REGISTER_SIZE];
int regnum;
int field;
for (field = 0, regnum = FP0_REGNUM;
@@ -4789,7 +4819,7 @@ mips_n32n64_xfer_return_value (struct type *type,
/* A struct that contains one or two floats. Each value is part
in the least significant part of their floating point
register.. */
- bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE);
+ bfd_byte reg[MAX_REGISTER_SIZE];
int regnum;
int field;
for (field = 0, regnum = FP0_REGNUM;
@@ -5543,9 +5573,9 @@ mips_gdbarch_init (struct gdbarch_info info,
/* Reset the disassembly info, in case it was set to something
non-default. */
- tm_print_insn_info.flavour = bfd_target_unknown_flavour;
- tm_print_insn_info.arch = bfd_arch_unknown;
- tm_print_insn_info.mach = 0;
+ deprecated_tm_print_insn_info.flavour = bfd_target_unknown_flavour;
+ deprecated_tm_print_insn_info.arch = bfd_arch_unknown;
+ deprecated_tm_print_insn_info.mach = 0;
elf_flags = 0;
@@ -5626,7 +5656,7 @@ mips_gdbarch_init (struct gdbarch_info info,
if (wanted_abi != MIPS_ABI_UNKNOWN)
mips_abi = wanted_abi;
- /* We have to set tm_print_insn_info before looking for a
+ /* We have to set deprecated_tm_print_insn_info before looking for a
pre-existing architecture, otherwise we may return before we get
a chance to set it up. */
if (mips_abi == MIPS_ABI_N32 || mips_abi == MIPS_ABI_N64)
@@ -5634,17 +5664,17 @@ mips_gdbarch_init (struct gdbarch_info info,
/* Set up the disassembler info, so that we get the right
register names from libopcodes. */
if (mips_abi == MIPS_ABI_N32)
- tm_print_insn_info.disassembler_options = "gpr-names=n32";
+ deprecated_tm_print_insn_info.disassembler_options = "gpr-names=n32";
else
- tm_print_insn_info.disassembler_options = "gpr-names=64";
- tm_print_insn_info.flavour = bfd_target_elf_flavour;
- tm_print_insn_info.arch = bfd_arch_mips;
+ deprecated_tm_print_insn_info.disassembler_options = "gpr-names=64";
+ deprecated_tm_print_insn_info.flavour = bfd_target_elf_flavour;
+ deprecated_tm_print_insn_info.arch = bfd_arch_mips;
if (info.bfd_arch_info != NULL
&& info.bfd_arch_info->arch == bfd_arch_mips
&& info.bfd_arch_info->mach)
- tm_print_insn_info.mach = info.bfd_arch_info->mach;
+ deprecated_tm_print_insn_info.mach = info.bfd_arch_info->mach;
else
- tm_print_insn_info.mach = bfd_mach_mips8000;
+ deprecated_tm_print_insn_info.mach = bfd_mach_mips8000;
}
else
/* This string is not recognized explicitly by the disassembler,
@@ -5652,7 +5682,7 @@ mips_gdbarch_init (struct gdbarch_info info,
the bfd elf headers, such that, if the user overrides the ABI
of a program linked as NewABI, the disassembly will follow the
register naming conventions specified by the user. */
- tm_print_insn_info.disassembler_options = "gpr-names=32";
+ deprecated_tm_print_insn_info.disassembler_options = "gpr-names=32";
if (gdbarch_debug)
{
@@ -5880,7 +5910,7 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_register_name (gdbarch, mips_register_name);
set_gdbarch_read_pc (gdbarch, mips_read_pc);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
- set_gdbarch_read_fp (gdbarch, mips_read_sp); /* Draft FRAME base. */
+ set_gdbarch_deprecated_target_read_fp (gdbarch, mips_read_sp); /* Draft FRAME base. */
set_gdbarch_read_sp (gdbarch, mips_read_sp);
set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
@@ -5908,9 +5938,9 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address);
set_gdbarch_deprecated_push_return_address (gdbarch, mips_push_return_address);
set_gdbarch_deprecated_pop_frame (gdbarch, mips_pop_frame);
- set_gdbarch_fix_call_dummy (gdbarch, mips_fix_call_dummy);
- set_gdbarch_call_dummy_words (gdbarch, mips_call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (mips_call_dummy_words));
+ set_gdbarch_deprecated_fix_call_dummy (gdbarch, mips_fix_call_dummy);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, mips_call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (mips_call_dummy_words));
set_gdbarch_deprecated_push_return_address (gdbarch, mips_push_return_address);
set_gdbarch_frame_align (gdbarch, mips_frame_align);
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
@@ -6396,8 +6426,8 @@ _initialize_mips_tdep (void)
internal_error (__FILE__, __LINE__, "mips_abi_strings out of sync");
gdbarch_register (bfd_arch_mips, mips_gdbarch_init, mips_dump_tdep);
- if (!tm_print_insn) /* Someone may have already set it */
- tm_print_insn = gdb_print_insn_mips;
+ if (!deprecated_tm_print_insn) /* Someone may have already set it */
+ deprecated_tm_print_insn = gdb_print_insn_mips;
/* Add root prefix command for all "set mips"/"show mips" commands */
add_prefix_cmd ("mips", no_class, set_mips_command,
diff --git a/gdb/mipsv4-nat.c b/gdb/mipsv4-nat.c
index 2695f1f8dbf..65ffa0dc629 100644
--- a/gdb/mipsv4-nat.c
+++ b/gdb/mipsv4-nat.c
@@ -47,8 +47,8 @@ supply_gregset (gregset_t *gregsetp)
{
register int regi;
register greg_t *regp = &(*gregsetp)[0];
- char *zerobuf = alloca (max_register_size (current_gdbarch));
- memset (zerobuf, 0, max_register_size (current_gdbarch));
+ char zerobuf[MAX_REGISTER_SIZE];
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = 0; regi <= CXT_RA; regi++)
supply_register (regi, (char *) (regp + regi));
@@ -61,7 +61,7 @@ supply_gregset (gregset_t *gregsetp)
/* Fill inaccessible registers with zero. */
supply_register (PS_REGNUM, zerobuf);
supply_register (BADVADDR_REGNUM, zerobuf);
- supply_register (FP_REGNUM, zerobuf);
+ supply_register (DEPRECATED_FP_REGNUM, zerobuf);
supply_register (UNUSED_REGNUM, zerobuf);
for (regi = FIRST_EMBED_REGNUM; regi <= LAST_EMBED_REGNUM; regi++)
supply_register (regi, zerobuf);
@@ -102,8 +102,8 @@ void
supply_fpregset (fpregset_t *fpregsetp)
{
register int regi;
- char *zerobuf = alloca (max_register_size (current_gdbarch));
- memset (zerobuf, 0, max_register_size (current_gdbarch));
+ char zerobuf[MAX_REGISTER_SIZE];
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = 0; regi < 32; regi++)
supply_register (FP0_REGNUM + regi,
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 22f3b67e7f1..1d580342758 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -695,7 +695,8 @@ mn10300_frame_chain (struct frame_info *fi)
/* Our caller has a frame pointer. So find the frame in $a3 or
in the stack. */
if (get_frame_saved_regs (fi)[A3_REGNUM])
- return (read_memory_integer (get_frame_saved_regs (fi)[A3_REGNUM], REGISTER_SIZE));
+ return (read_memory_integer (get_frame_saved_regs (fi)[A3_REGNUM],
+ DEPRECATED_REGISTER_SIZE));
else
return read_register (A3_REGNUM);
}
@@ -879,7 +880,8 @@ mn10300_frame_saved_pc (struct frame_info *fi)
{
int adjust = saved_regs_size (fi);
- return (read_memory_integer (get_frame_base (fi) + adjust, REGISTER_SIZE));
+ return (read_memory_integer (get_frame_base (fi) + adjust,
+ DEPRECATED_REGISTER_SIZE));
}
/* Function: mn10300_init_extra_frame_info
@@ -892,9 +894,10 @@ mn10300_frame_saved_pc (struct frame_info *fi)
always be correct. mn10300_analyze_prologue will fix fi->frame if
it's not valid.
- We can be called with the PC in the call dummy under two circumstances.
- First, during normal backtracing, second, while figuring out the frame
- pointer just prior to calling the target function (see run_stack_dummy). */
+ We can be called with the PC in the call dummy under two
+ circumstances. First, during normal backtracing, second, while
+ figuring out the frame pointer just prior to calling the target
+ function (see call_function_by_hand). */
static void
mn10300_init_extra_frame_info (int fromleaf, struct frame_info *fi)
@@ -1007,7 +1010,7 @@ mn10300_dwarf2_reg_to_regnum (int dwarf2)
static void
mn10300_print_register (const char *name, int regnum, int reg_width)
{
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
if (reg_width)
printf_filtered ("%*s: ", reg_width, name);
@@ -1143,9 +1146,8 @@ mn10300_gdbarch_init (struct gdbarch_info info,
/* Registers. */
set_gdbarch_num_regs (gdbarch, num_regs);
set_gdbarch_register_name (gdbarch, register_name);
- set_gdbarch_register_size (gdbarch, 4);
- set_gdbarch_register_bytes (gdbarch,
- num_regs * gdbarch_register_size (gdbarch));
+ set_gdbarch_deprecated_register_size (gdbarch, 4);
+ set_gdbarch_register_bytes (gdbarch, num_regs * gdbarch_deprecated_register_size (gdbarch));
set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
set_gdbarch_register_raw_size (gdbarch, mn10300_register_raw_size);
set_gdbarch_register_byte (gdbarch, mn10300_register_byte);
@@ -1156,7 +1158,7 @@ mn10300_gdbarch_init (struct gdbarch_info 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);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, 31);
set_gdbarch_virtual_frame_pointer (gdbarch, mn10300_virtual_frame_pointer);
/* Breakpoints. */
@@ -1182,12 +1184,11 @@ mn10300_gdbarch_init (struct gdbarch_info info,
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
/* That's right, we're using the stack pointer as our frame pointer. */
- set_gdbarch_read_fp (gdbarch, generic_target_read_sp);
+ set_gdbarch_deprecated_target_read_fp (gdbarch, generic_target_read_sp);
/* Calling functions in the inferior from GDB. */
- set_gdbarch_call_dummy_words (gdbarch, mn10300_call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch,
- sizeof (mn10300_call_dummy_words));
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, mn10300_call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (mn10300_call_dummy_words));
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
set_gdbarch_deprecated_push_arguments (gdbarch, mn10300_push_arguments);
set_gdbarch_reg_struct_has_addr (gdbarch, mn10300_reg_struct_has_addr);
@@ -1208,7 +1209,7 @@ _initialize_mn10300_tdep (void)
{
/* printf("_initialize_mn10300_tdep\n"); */
- tm_print_insn = print_insn_mn10300;
+ deprecated_tm_print_insn = print_insn_mn10300;
register_gdbarch_init (bfd_arch_mn10300, mn10300_gdbarch_init);
}
diff --git a/gdb/monitor.c b/gdb/monitor.c
index f58ed2aa6ef..ede61bb6998 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -896,7 +896,7 @@ char *
monitor_supply_register (int regno, char *valstr)
{
ULONGEST val;
- unsigned char *regbuf = alloca (max_register_size (current_gdbarch));
+ unsigned char regbuf[MAX_REGISTER_SIZE];
char *p;
val = 0;
@@ -1181,9 +1181,9 @@ monitor_fetch_register (int regno)
char *regbuf;
int i;
- regbuf = alloca (MAX_REGISTER_RAW_SIZE * 2 + 1);
- zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
- memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
+ regbuf = alloca (MAX_REGISTER_SIZE * 2 + 1);
+ zerobuf = alloca (MAX_REGISTER_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
if (current_monitor->regname != NULL)
name = current_monitor->regname (regno);
diff --git a/gdb/nlm/i386.c b/gdb/nlm/i386.c
index b8ab480b996..8fc6b1dd01b 100644
--- a/gdb/nlm/i386.c
+++ b/gdb/nlm/i386.c
@@ -92,7 +92,7 @@ do_status (char *ptr, struct StackFrame *frame)
ptr = mem2hex (&frame->ExceptionESP, ptr + 3, 4, 0);
*ptr++ = ';';
- sprintf (ptr, "%02x:", FP_REGNUM);
+ sprintf (ptr, "%02x:", DEPRECATED_FP_REGNUM);
ptr = mem2hex (&frame->ExceptionEBP, ptr + 3, 4, 0);
*ptr++ = ';';
diff --git a/gdb/nlm/i386.h b/gdb/nlm/i386.h
index 155702bd503..ff97aed2e49 100644
--- a/gdb/nlm/i386.h
+++ b/gdb/nlm/i386.h
@@ -1,7 +1,7 @@
/* Register values. All of these values *MUST* agree with tm.h */
#define SP_REGNUM 4 /* Contains address of top of stack */
#define PC_REGNUM 8 /* Contains program counter */
-#define FP_REGNUM 5 /* Virtual frame pointer */
+#define DEPRECATED_FP_REGNUM 5 /* Virtual frame pointer */
#define NUM_REGS 16 /* Number of machine registers */
#define REGISTER_BYTES (NUM_REGS * 4) /* Total size of registers array */
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index 3a31ddbb8d9..ef2752d0b77 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -395,7 +395,7 @@ ns32k_frame_init_saved_regs (struct frame_info *frame)
get_frame_saved_regs (frame)[SP_REGNUM] = get_frame_base (frame) + 4;
get_frame_saved_regs (frame)[PC_REGNUM] = get_frame_base (frame) + 4;
- get_frame_saved_regs (frame)[FP_REGNUM] = read_memory_integer (get_frame_base (frame), 4);
+ get_frame_saved_regs (frame)[DEPRECATED_FP_REGNUM] = read_memory_integer (get_frame_base (frame), 4);
}
else if (enter_addr == 1)
{
@@ -412,8 +412,8 @@ ns32k_push_dummy_frame (void)
int regnum;
sp = push_word (sp, read_register (PC_REGNUM));
- sp = push_word (sp, read_register (FP_REGNUM));
- write_register (FP_REGNUM, sp);
+ sp = push_word (sp, read_register (DEPRECATED_FP_REGNUM));
+ write_register (DEPRECATED_FP_REGNUM, sp);
for (regnum = 0; regnum < 8; regnum++)
sp = push_word (sp, read_register (regnum));
@@ -436,7 +436,7 @@ ns32k_pop_frame (void)
write_register (regnum,
read_memory_integer (get_frame_saved_regs (frame)[regnum], 4));
- write_register (FP_REGNUM, read_memory_integer (fp, 4));
+ write_register (DEPRECATED_FP_REGNUM, read_memory_integer (fp, 4));
write_register (PC_REGNUM, read_memory_integer (fp + 4, 4));
write_register (SP_REGNUM, fp + 8);
flush_cached_frames ();
@@ -556,7 +556,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_num_regs (gdbarch, NS32K_PC_REGNUM);
set_gdbarch_num_regs (gdbarch, NS32K_PS_REGNUM);
- set_gdbarch_register_size (gdbarch, NS32K_REGISTER_SIZE);
+ set_gdbarch_deprecated_register_size (gdbarch, NS32K_REGISTER_SIZE);
set_gdbarch_register_raw_size (gdbarch, ns32k_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, NS32K_MAX_REGISTER_RAW_SIZE);
set_gdbarch_register_virtual_size (gdbarch, ns32k_register_virtual_size);
@@ -595,11 +595,11 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_push_dummy_frame (gdbarch, ns32k_push_dummy_frame);
set_gdbarch_deprecated_pop_frame (gdbarch, ns32k_pop_frame);
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
- set_gdbarch_call_dummy_words (gdbarch, ns32k_call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof_ns32k_call_dummy_words);
- set_gdbarch_fix_call_dummy (gdbarch, ns32k_fix_call_dummy);
- set_gdbarch_call_dummy_start_offset (gdbarch, 3);
- set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 15);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, ns32k_call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof_ns32k_call_dummy_words);
+ set_gdbarch_deprecated_fix_call_dummy (gdbarch, ns32k_fix_call_dummy);
+ set_gdbarch_deprecated_call_dummy_start_offset (gdbarch, 3);
+ set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 15);
set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
@@ -624,5 +624,5 @@ _initialize_ns32k_tdep (void)
{
gdbarch_register (bfd_arch_ns32k, ns32k_gdbarch_init, NULL);
- tm_print_insn = print_insn_ns32k;
+ deprecated_tm_print_insn = print_insn_ns32k;
}
diff --git a/gdb/ns32knbsd-nat.c b/gdb/ns32knbsd-nat.c
index 24e422db661..2fe6d10bb47 100644
--- a/gdb/ns32knbsd-nat.c
+++ b/gdb/ns32knbsd-nat.c
@@ -58,7 +58,7 @@ fetch_inferior_registers (int regno)
RF (R0_REGNUM + 7, inferior_registers.r_r7);
RF (SP_REGNUM, inferior_registers.r_sp);
- RF (FP_REGNUM, inferior_registers.r_fp);
+ RF (DEPRECATED_FP_REGNUM, inferior_registers.r_fp);
RF (PC_REGNUM, inferior_registers.r_pc);
RF (PS_REGNUM, inferior_registers.r_psr);
@@ -90,7 +90,7 @@ store_inferior_registers (int regno)
RS (R0_REGNUM + 7, inferior_registers.r_r7);
RS (SP_REGNUM, inferior_registers.r_sp);
- RS (FP_REGNUM, inferior_registers.r_fp);
+ RS (DEPRECATED_FP_REGNUM, inferior_registers.r_fp);
RS (PC_REGNUM, inferior_registers.r_pc);
RS (PS_REGNUM, inferior_registers.r_psr);
@@ -150,7 +150,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
RF (R0_REGNUM + 7, core_reg->intreg.r_r7);
RF (SP_REGNUM, core_reg->intreg.r_sp);
- RF (FP_REGNUM, core_reg->intreg.r_fp);
+ RF (DEPRECATED_FP_REGNUM, core_reg->intreg.r_fp);
RF (PC_REGNUM, core_reg->intreg.r_pc);
RF (PS_REGNUM, core_reg->intreg.r_psr);
@@ -223,7 +223,7 @@ fetch_kcore_registers (struct pcb *pcb)
dummy = pcb->pcb_kfp + 8;
RF (SP_REGNUM, dummy);
- RF (FP_REGNUM, sf.sf_fp);
+ RF (DEPRECATED_FP_REGNUM, sf.sf_fp);
RF (PC_REGNUM, sf.sf_pc);
RF (PS_REGNUM, intreg.r_psr);
@@ -258,7 +258,7 @@ clear_regs (void)
RF (R0_REGNUM + 7, null);
RF (SP_REGNUM, null);
- RF (FP_REGNUM, null);
+ RF (DEPRECATED_FP_REGNUM, null);
RF (PC_REGNUM, null);
RF (PS_REGNUM, null);
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
new file mode 100644
index 00000000000..5003ea069eb
--- /dev/null
+++ b/gdb/nto-tdep.c
@@ -0,0 +1,342 @@
+/* nto-tdep.c - general QNX Neutrino target functionality.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ Contributed by QNX Software Systems Ltd.
+
+ 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 "gdb_stat.h"
+#include "gdb_string.h"
+#include "nto-tdep.h"
+#include "top.h"
+#include "cli/cli-decode.h"
+#include "cli/cli-cmds.h"
+#include "inferior.h"
+#include "gdbarch.h"
+#include "bfd.h"
+#include "elf-bfd.h"
+#include "solib-svr4.h"
+#include "gdbcore.h"
+
+#ifdef __CYGWIN__
+#include <sys/cygwin.h>
+#endif
+
+#ifdef __CYGWIN__
+static char default_nto_target[] = "C:\\QNXsdk\\target\\qnx6";
+#elif defined(__sun__) || defined(linux)
+static char default_nto_target[] = "/opt/QNXsdk/target/qnx6";
+#else
+static char default_nto_target[] = "";
+#endif
+
+struct nto_target_ops current_nto_target;
+
+static char *
+nto_target (void)
+{
+ char *p = getenv ("QNX_TARGET");
+
+#ifdef __CYGWIN__
+ static char buf[PATH_MAX];
+ if (p)
+ cygwin_conv_to_posix_path (p, buf);
+ else
+ cygwin_conv_to_posix_path (default_nto_target, buf);
+ return buf;
+#else
+ return p ? p : default_nto_target;
+#endif
+}
+
+/* Take a string such as i386, rs6000, etc. and map it onto CPUTYPE_X86,
+ CPUTYPE_PPC, etc. as defined in nto-share/dsmsgs.h. */
+int
+nto_map_arch_to_cputype (const char *arch)
+{
+ if (!strcmp (arch, "i386") || !strcmp (arch, "x86"))
+ return CPUTYPE_X86;
+ if (!strcmp (arch, "rs6000") || !strcmp (arch, "ppc"))
+ return CPUTYPE_PPC;
+ if (!strcmp (arch, "mips"))
+ return CPUTYPE_MIPS;
+ if (!strcmp (arch, "arm"))
+ return CPUTYPE_ARM;
+ if (!strcmp (arch, "sh"))
+ return CPUTYPE_SH;
+ return CPUTYPE_UNKNOWN;
+}
+
+int
+nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
+{
+ char *buf, arch_path[PATH_MAX], *nto_root, *endian;
+ const char *arch;
+ char *path_fmt = "%s/lib:%s/usr/lib:%s/usr/photon/lib\
+:%s/usr/photon/dll:%s/lib/dll";
+
+ nto_root = nto_target ();
+ if (strcmp (TARGET_ARCHITECTURE->arch_name, "i386") == 0)
+ {
+ arch = "x86";
+ endian = "";
+ }
+ else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") == 0)
+ {
+ arch = "ppc";
+ endian = "be";
+ }
+ else
+ {
+ arch = TARGET_ARCHITECTURE->arch_name;
+ endian = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "be" : "le";
+ }
+
+ sprintf (arch_path, "%s/%s%s", nto_root, arch, endian);
+
+ buf = alloca (strlen (path_fmt) + strlen (arch_path) * 5 + 1);
+ sprintf (buf, path_fmt, arch_path, arch_path, arch_path, arch_path,
+ arch_path);
+
+ return openp (buf, 1, solib, o_flags, 0, temp_pathname);
+}
+
+void
+nto_init_solib_absolute_prefix (void)
+{
+ char buf[PATH_MAX * 2], arch_path[PATH_MAX];
+ char *nto_root, *endian;
+ const char *arch;
+
+ nto_root = nto_target ();
+ if (strcmp (TARGET_ARCHITECTURE->arch_name, "i386") == 0)
+ {
+ arch = "x86";
+ endian = "";
+ }
+ else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") == 0)
+ {
+ arch = "ppc";
+ endian = "be";
+ }
+ else
+ {
+ arch = TARGET_ARCHITECTURE->arch_name;
+ endian = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "be" : "le";
+ }
+
+ sprintf (arch_path, "%s/%s%s", nto_root, arch, endian);
+
+ sprintf (buf, "set solib-absolute-prefix %s", arch_path);
+ execute_command (buf, 0);
+}
+
+char **
+nto_parse_redirection (char *pargv[], char **pin, char **pout, char **perr)
+{
+ char **argv;
+ char *in, *out, *err, *p;
+ int argc, i, n;
+
+ for (n = 0; pargv[n]; n++);
+ if (n == 0)
+ return NULL;
+ in = "";
+ out = "";
+ err = "";
+
+ argv = xcalloc (n + 1, sizeof argv[0]);
+ argc = n;
+ for (i = 0, n = 0; n < argc; n++)
+ {
+ p = pargv[n];
+ if (*p == '>')
+ {
+ p++;
+ if (*p)
+ out = p;
+ else
+ out = pargv[++n];
+ }
+ else if (*p == '<')
+ {
+ p++;
+ if (*p)
+ in = p;
+ else
+ in = pargv[++n];
+ }
+ else if (*p++ == '2' && *p++ == '>')
+ {
+ if (*p == '&' && *(p + 1) == '1')
+ err = out;
+ else if (*p)
+ err = p;
+ else
+ err = pargv[++n];
+ }
+ else
+ argv[i++] = pargv[n];
+ }
+ *pin = in;
+ *pout = out;
+ *perr = err;
+ return argv;
+}
+
+/* The struct lm_info, LM_ADDR, and nto_truncate_ptr are copied from
+ solib-svr4.c to support nto_relocate_section_addresses
+ which is different from the svr4 version. */
+
+struct lm_info
+{
+ /* Pointer to copy of link map from inferior. The type is char *
+ rather than void *, so that we may use byte offsets to find the
+ various fields without the need for a cast. */
+ char *lm;
+};
+
+static CORE_ADDR
+LM_ADDR (struct so_list *so)
+{
+ struct link_map_offsets *lmo = nto_fetch_link_map_offsets ();
+
+ return (CORE_ADDR) extract_signed_integer (so->lm_info->lm +
+ lmo->l_addr_offset,
+ lmo->l_addr_size);
+}
+
+static CORE_ADDR
+nto_truncate_ptr (CORE_ADDR addr)
+{
+ if (TARGET_PTR_BIT == sizeof (CORE_ADDR) * 8)
+ /* We don't need to truncate anything, and the bit twiddling below
+ will fail due to overflow problems. */
+ return addr;
+ else
+ return addr & (((CORE_ADDR) 1 << TARGET_PTR_BIT) - 1);
+}
+
+Elf_Internal_Phdr *
+find_load_phdr (bfd *abfd)
+{
+ Elf_Internal_Phdr *phdr;
+ unsigned int i;
+
+ if (!elf_tdata (abfd))
+ return NULL;
+
+ phdr = elf_tdata (abfd)->phdr;
+ for (i = 0; i < elf_elfheader (abfd)->e_phnum; i++, phdr++)
+ {
+ if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_X))
+ return phdr;
+ }
+ return NULL;
+}
+
+void
+nto_relocate_section_addresses (struct so_list *so, struct section_table *sec)
+{
+ /* Neutrino treats the l_addr base address field in link.h as different than
+ the base address in the System V ABI and so the offset needs to be
+ calculated and applied to relocations. */
+ Elf_Internal_Phdr *phdr = find_load_phdr (sec->bfd);
+ unsigned vaddr = phdr ? phdr->p_vaddr : 0;
+
+ sec->addr = nto_truncate_ptr (sec->addr + LM_ADDR (so) - vaddr);
+ sec->endaddr = nto_truncate_ptr (sec->endaddr + LM_ADDR (so) - vaddr);
+}
+
+static void
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
+ int which, CORE_ADDR reg_addr)
+{
+ nto_regset_t regset;
+
+ nto_init_solib_absolute_prefix ();
+
+ if (which == NTO_REG_GENERAL)
+ {
+ memcpy ((char *) &regset, core_reg_sect,
+ min (core_reg_size, sizeof (regset)));
+ nto_supply_gregset ((char *) &regset);
+ }
+ else if (which == NTO_REG_FLOAT)
+ {
+ memcpy ((char *) &regset, core_reg_sect,
+ min (core_reg_size, sizeof (regset)));
+ nto_supply_fpregset ((char *) &regset);
+ }
+ else if (which == NTO_REG_ALT)
+ {
+ memcpy ((char *) &regset, core_reg_sect,
+ min (core_reg_size, sizeof (regset)));
+ nto_supply_altregset ((char *) &regset);
+ }
+}
+
+void
+nto_dummy_supply_regset (char *regs)
+{
+ /* Do nothing. */
+}
+
+/* Register that we are able to handle ELF file formats using standard
+ procfs "regset" structures. */
+static struct core_fns regset_core_fns = {
+ bfd_target_elf_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_core_registers, /* core_read_registers */
+ NULL /* next */
+};
+
+void
+_initialize_nto_tdep (void)
+{
+ add_setshow_cmd ("nto-debug", class_maintenance, var_zinteger,
+ &nto_internal_debugging, "Set QNX NTO internal debugging.\n\
+When non-zero, nto specific debug info is\n\
+displayed. Different information is displayed\n\
+for different positive values.", "Show QNX NTO internal debugging.\n",
+ NULL, NULL, &setdebuglist, &showdebuglist);
+
+ /* We use SIG45 for pulses, or something, so nostop, noprint
+ and pass them. */
+ signal_stop_update (target_signal_from_name ("SIG45"), 0);
+ signal_print_update (target_signal_from_name ("SIG45"), 0);
+ signal_pass_update (target_signal_from_name ("SIG45"), 1);
+
+ /* By default we don't want to stop on these two, but we do want to pass. */
+#if defined(SIGSELECT)
+ signal_stop_update (SIGSELECT, 0);
+ signal_print_update (SIGSELECT, 0);
+ signal_pass_update (SIGSELECT, 1);
+#endif
+
+#if defined(SIGPHOTON)
+ signal_stop_update (SIGPHOTON, 0);
+ signal_print_update (SIGPHOTON, 0);
+ signal_pass_update (SIGPHOTON, 1);
+#endif
+
+ /* Register core file support. */
+ add_core_fns (&regset_core_fns);
+}
diff --git a/gdb/nto-tdep.h b/gdb/nto-tdep.h
new file mode 100644
index 00000000000..e22e8fd525c
--- /dev/null
+++ b/gdb/nto-tdep.h
@@ -0,0 +1,156 @@
+/* nto-tdep.h - QNX Neutrino target header.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ Contributed by QNX Software Systems Ltd.
+
+ 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 _NTO_TDEP_H
+#define _NTO_TDEP_H
+
+#include "defs.h"
+#include "solist.h"
+
+/* Generic functions in nto-tdep.c. */
+
+extern void nto_init_solib_absolute_prefix (void);
+
+char **nto_parse_redirection (char *start_argv[], char **in,
+ char **out, char **err);
+
+int proc_iterate_over_mappings (int (*func) (int, CORE_ADDR));
+
+void nto_relocate_section_addresses (struct so_list *, struct section_table *);
+
+int nto_map_arch_to_cputype (const char *);
+
+int nto_find_and_open_solib (char *, unsigned, char **);
+
+/* Dummy function for initializing nto_target_ops on targets which do
+ not define a particular regset. */
+void nto_dummy_supply_regset (char *regs);
+
+/* Target operations defined for Neutrino targets (<target>-nto-tdep.c). */
+
+struct nto_target_ops
+{
+ int nto_internal_debugging;
+ unsigned nto_cpuinfo_flags;
+ int nto_cpuinfo_valid;
+
+ int (*nto_regset_id) (int);
+ void (*nto_supply_gregset) (char *);
+ void (*nto_supply_fpregset) (char *);
+ void (*nto_supply_altregset) (char *);
+ void (*nto_supply_regset) (int, char *);
+ int (*nto_register_area) (int, int, unsigned *);
+ int (*nto_regset_fill) (int, char *);
+ struct link_map_offsets *(*nto_fetch_link_map_offsets) (void);
+};
+
+extern struct nto_target_ops current_nto_target;
+
+/* For 'maintenance debug nto-debug' command. */
+#define nto_internal_debugging \
+ (current_nto_target.nto_internal_debugging)
+
+/* The CPUINFO flags from the remote. Currently used by
+ i386 for fxsave but future proofing other hosts.
+ This is initialized in procfs_attach or nto_start_remote
+ depending on our host/target. It would only be invalid
+ if we were talking to an older pdebug which didn't support
+ the cpuinfo message. */
+#define nto_cpuinfo_flags \
+ (current_nto_target.nto_cpuinfo_flags)
+
+/* True if successfully retrieved cpuinfo from remote. */
+#define nto_cpuinfo_valid \
+ (current_nto_target.nto_cpuinfo_valid)
+
+/* Given a register, return an id that represents the Neutrino
+ regset it came from. If reg == -1 update all regsets. */
+#define nto_regset_id(reg) \
+ (*current_nto_target.nto_regset_id) (reg)
+
+#define nto_supply_gregset(regs) \
+ (*current_nto_target.nto_supply_gregset) (regs)
+
+#define nto_supply_fpregset(regs) \
+ (*current_nto_target.nto_supply_fpregset) (regs)
+
+#define nto_supply_altregset(regs) \
+ (*current_nto_target.nto_supply_altregset) (regs)
+
+/* Given a regset, tell gdb about registers stored in data. */
+#define nto_supply_regset(regset, data) \
+ (*current_nto_target.nto_supply_regset) (regset, data)
+
+/* Given a register and regset, calculate the offset into the regset
+ and stuff it into the last argument. If regno is -1, calculate the
+ size of the entire regset. Returns length of data, -1 if unknown
+ regset, 0 if unknown register. */
+#define nto_register_area(reg, regset, off) \
+ (*current_nto_target.nto_register_area) (reg, regset, off)
+
+/* Build the Neutrino register set info into the data buffer.
+ Return -1 if unknown regset, 0 otherwise. */
+#define nto_regset_fill(regset, data) \
+ (*current_nto_target.nto_regset_fill) (regset, data)
+
+/* Gives the fetch_link_map_offsets function exposure outside of
+ solib-svr4.c so that we can override relocate_section_addresses(). */
+#define nto_fetch_link_map_offsets() \
+ (*current_nto_target.nto_fetch_link_map_offsets) ()
+
+/* Keep this consistant with neutrino syspage.h. */
+enum
+{
+ CPUTYPE_X86,
+ CPUTYPE_PPC,
+ CPUTYPE_MIPS,
+ CPUTYPE_SPARE,
+ CPUTYPE_ARM,
+ CPUTYPE_SH,
+ CPUTYPE_UNKNOWN
+};
+
+enum
+{
+ OSTYPE_QNX4,
+ OSTYPE_NTO
+};
+
+/* These correspond to the DSMSG_* versions in dsmsgs.h. */
+enum
+{
+ NTO_REG_GENERAL,
+ NTO_REG_FLOAT,
+ NTO_REG_SYSTEM,
+ NTO_REG_ALT,
+ NTO_REG_END
+};
+
+typedef char qnx_reg64[8];
+
+typedef struct _debug_regs
+{
+ qnx_reg64 padding[1024];
+} nto_regset_t;
+
+#endif
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index bc937ca7ea0..368e3366e0e 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -42,6 +42,8 @@
#include "gdb_regex.h"
#include "regcache.h"
#include "block.h"
+#include "infcall.h"
+#include "valprint.h"
#include <ctype.h>
@@ -1751,6 +1753,19 @@ _initialize_objc_language (void)
add_com_alias ("po", "print-object", class_vars, 1);
}
+#if 1
+/* Disable these functions until we put them in the gdbarch vector. */
+static unsigned long FETCH_ARGUMENT (int i)
+{
+ internal_error (__FILE__, __LINE__, "FETCH_ARGUMENT not implemented");
+ return 0;
+}
+static CORE_ADDR CONVERT_FUNCPTR (CORE_ADDR pc)
+{
+ internal_error (__FILE__, __LINE__, "CONVERT_FUNCPTR not implemented");
+ return pc;
+}
+#else
#if defined (__powerpc__) || defined (__ppc__)
static unsigned long FETCH_ARGUMENT (int i)
{
@@ -1790,6 +1805,7 @@ static CORE_ADDR CONVERT_FUNCPTR (CORE_ADDR pc)
return pc;
}
#endif
+#endif
static void
read_objc_method (CORE_ADDR addr, struct objc_method *method)
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 32a57fab2ff..59e03b93e9b 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -325,7 +325,7 @@ allocate_objfile (bfd *abfd, int flags)
}
else
{
- objfile->name = "<<anonymous objfile>>";
+ objfile->name = mstrsave (objfile->md, "<<anonymous objfile>>");
}
/* Initialize the section indexes for this objfile, so that we can
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 4561e4d648d..20c8adda44a 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -204,7 +204,7 @@ fetch_register (int tid, int regno)
char mess[128]; /* For messages */
register int i;
unsigned int offset; /* Offset of registers within the u area. */
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
CORE_ADDR regaddr = ppc_register_u_addr (regno);
if (altivec_register_p (regno))
@@ -364,7 +364,7 @@ store_register (int tid, int regno)
char mess[128]; /* For messages */
register int i;
unsigned int offset; /* Offset of registers within the u area. */
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
if (altivec_register_p (regno))
{
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index ae87bd7fd43..018d7731548 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -42,6 +42,7 @@
#include "ui-out.h"
#include "gdb_assert.h"
#include "block.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 " */
@@ -175,8 +176,6 @@ static void print_formatted (struct value *, int, int, struct ui_file *);
static struct format_data decode_format (char **, int, int);
-static int print_insn (CORE_ADDR, struct ui_file *);
-
static void sym_info (char *, int);
@@ -310,7 +309,7 @@ print_formatted (struct value *val, register int format, int size,
/* We often wrap here if there are long symbolic names. */
wrap_here (" ");
next_address = VALUE_ADDRESS (val)
- + print_insn (VALUE_ADDRESS (val), stream);
+ + gdb_print_insn (VALUE_ADDRESS (val), stream);
next_section = VALUE_BFD_SECTION (val);
break;
@@ -2240,27 +2239,6 @@ printf_command (char *arg, int from_tty)
do_cleanups (old_cleanups);
}
-/* Print the instruction at address MEMADDR in debugged memory,
- on STREAM. Returns length of the instruction, in bytes. */
-
-static int
-print_insn (CORE_ADDR memaddr, struct ui_file *stream)
-{
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- TARGET_PRINT_INSN_INFO->endian = BFD_ENDIAN_BIG;
- else
- TARGET_PRINT_INSN_INFO->endian = BFD_ENDIAN_LITTLE;
-
- if (TARGET_ARCHITECTURE != NULL)
- TARGET_PRINT_INSN_INFO->mach = TARGET_ARCHITECTURE->mach;
- /* else: should set .mach=0 but some disassemblers don't grok this */
-
- TARGET_PRINT_INSN_INFO->stream = stream;
-
- return TARGET_PRINT_INSN (memaddr, TARGET_PRINT_INSN_INFO);
-}
-
-
void
_initialize_printcmd (void)
{
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 2f14c5d2402..96cdaa9a37d 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -3706,7 +3706,7 @@ procfs_fetch_registers (int regno)
if ((regno >= 0 && regno < FP0_REGNUM) ||
regno == PC_REGNUM ||
(NPC_REGNUM >= 0 && regno == NPC_REGNUM) ||
- regno == FP_REGNUM ||
+ regno == DEPRECATED_FP_REGNUM ||
regno == SP_REGNUM)
return; /* not a floating point register */
@@ -3780,7 +3780,7 @@ procfs_store_registers (int regno)
if ((regno >= 0 && regno < FP0_REGNUM) ||
regno == PC_REGNUM ||
(NPC_REGNUM >= 0 && regno == NPC_REGNUM) ||
- regno == FP_REGNUM ||
+ regno == DEPRECATED_FP_REGNUM ||
regno == SP_REGNUM)
return; /* not a floating point register */
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 70af06f2fab..acf3044fa3c 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -78,9 +78,6 @@ struct regcache_descr
long *register_offset;
long *sizeof_register;
- /* Useful constant. Largest of all the registers. */
- long max_register_size;
-
/* Cached table containing the type of each register. */
struct type **register_type;
};
@@ -109,7 +106,6 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch,
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
@@ -119,10 +115,8 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch,
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))
- descr->max_register_size = REGISTER_RAW_SIZE (i);
- if (descr->max_register_size < REGISTER_VIRTUAL_SIZE (i))
- descr->max_register_size = REGISTER_VIRTUAL_SIZE (i);
+ gdb_assert (MAX_REGISTER_SIZE >= REGISTER_RAW_SIZE (i));
+ gdb_assert (MAX_REGISTER_SIZE >= REGISTER_VIRTUAL_SIZE (i));
}
/* Compute the real size of the register buffer. Start out by
@@ -187,6 +181,12 @@ init_regcache_descr (struct gdbarch *gdbarch)
&& !gdbarch_pseudo_register_write_p (gdbarch)
&& !gdbarch_register_type_p (gdbarch))
{
+ /* NOTE: cagney/2003-05-02: Don't add a test for REGISTER_BYTE_P
+ to the above. Doing that would cause all the existing
+ architectures to revert back to the legacy regcache
+ mechanisms, and that is not a good thing. Instead just,
+ later, check that the register cache's layout is consistent
+ with REGISTER_BYTE. */
descr->legacy_p = 1;
init_legacy_regcache_descr (gdbarch, descr);
return descr;
@@ -213,14 +213,12 @@ init_regcache_descr (struct gdbarch *gdbarch)
long offset = 0;
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++)
{
descr->sizeof_register[i] = TYPE_LENGTH (descr->register_type[i]);
descr->register_offset[i] = offset;
offset += descr->sizeof_register[i];
- if (descr->max_register_size < descr->sizeof_register[i])
- descr->max_register_size = descr->sizeof_register[i];
+ gdb_assert (MAX_REGISTER_SIZE >= descr->sizeof_register[i]);
}
/* Set the real size of the register cache buffer. */
descr->sizeof_cooked_registers = offset;
@@ -233,21 +231,19 @@ init_regcache_descr (struct gdbarch *gdbarch)
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
- so that targets using the generic methods supplied by regcache
- don't go into infinite recursion trying to, again, create the
- regcache. */
- set_gdbarch_data (gdbarch, regcache_descr_handle, descr);
+ /* Sanity check. Confirm that there is agreement between the
+ regcache and the target's redundant REGISTER_BYTE (new targets
+ should not even be defining it). */
for (i = 0; i < descr->nr_cooked_registers; i++)
{
+ if (REGISTER_BYTE_P ())
+ gdb_assert (descr->register_offset[i] == REGISTER_BYTE (i));
+#if 0
gdb_assert (descr->sizeof_register[i] == REGISTER_RAW_SIZE (i));
gdb_assert (descr->sizeof_register[i] == REGISTER_VIRTUAL_SIZE (i));
- gdb_assert (descr->register_offset[i] == REGISTER_BYTE (i));
+#endif
}
/* gdb_assert (descr->sizeof_raw_registers == REGISTER_BYTES (i)); */
-#endif
return descr;
}
@@ -286,31 +282,6 @@ register_type (struct gdbarch *gdbarch, int regnum)
the regcache descr. */
int
-max_register_size (struct gdbarch *gdbarch)
-{
- struct regcache_descr *descr = regcache_descr (gdbarch);
- return descr->max_register_size;
-}
-
-int
-legacy_max_register_raw_size (void)
-{
- if (DEPRECATED_MAX_REGISTER_RAW_SIZE_P ())
- return DEPRECATED_MAX_REGISTER_RAW_SIZE;
- else
- return max_register_size (current_gdbarch);
-}
-
-int
-legacy_max_register_virtual_size (void)
-{
- if (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P ())
- return DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE;
- else
- return max_register_size (current_gdbarch);
-}
-
-int
register_size (struct gdbarch *gdbarch, int regnum)
{
struct regcache_descr *descr = regcache_descr (gdbarch);
@@ -393,7 +364,7 @@ regcache_save (struct regcache *dst, regcache_cooked_read_ftype *cooked_read,
void *src)
{
struct gdbarch *gdbarch = dst->descr->gdbarch;
- void *buf = alloca (max_register_size (gdbarch));
+ char buf[MAX_REGISTER_SIZE];
int regnum;
/* The DST should be `read-only', if it wasn't then the save would
end up trying to write the register values back out to the
@@ -427,7 +398,7 @@ regcache_restore (struct regcache *dst,
void *src)
{
struct gdbarch *gdbarch = dst->descr->gdbarch;
- void *buf = alloca (max_register_size (gdbarch));
+ char buf[MAX_REGISTER_SIZE];
int regnum;
/* The dst had better not be read-only. If it is, the `restore'
doesn't make much sense. */
@@ -681,7 +652,7 @@ deprecated_read_register_bytes (int in_start, char *in_buf, int in_len)
{
int in_end = in_start + in_len;
int regnum;
- char *reg_buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char reg_buf[MAX_REGISTER_SIZE];
/* See if we are trying to read bytes from out-of-date registers. If so,
update just those registers. */
@@ -1071,7 +1042,7 @@ deprecated_write_register_bytes (int myregstart, char *myaddr, int inlen)
/* The register partially overlaps the range being written. */
else
{
- char *regbuf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char regbuf[MAX_REGISTER_SIZE];
/* What's the overlap between this register's bytes and
those the caller wants to write? */
int overlapstart = max (regstart, myregstart);
@@ -1104,7 +1075,7 @@ regcache_xfer_part (struct regcache *regcache, int regnum,
regcache_read_ftype *read, regcache_write_ftype *write)
{
struct regcache_descr *descr = regcache->descr;
- bfd_byte *reg = alloca (descr->max_register_size);
+ bfd_byte reg[MAX_REGISTER_SIZE];
gdb_assert (offset >= 0 && offset <= descr->sizeof_register[regnum]);
gdb_assert (len >= 0 && offset + len <= descr->sizeof_register[regnum]);
/* Something to do? */
@@ -1213,36 +1184,6 @@ read_register_pid (int regnum, ptid_t ptid)
return retval;
}
-/* Return the contents of register REGNUM as a signed integer. */
-
-LONGEST
-read_signed_register (int regnum)
-{
- void *buf = alloca (REGISTER_RAW_SIZE (regnum));
- deprecated_read_register_gen (regnum, buf);
- return (extract_signed_integer (buf, REGISTER_RAW_SIZE (regnum)));
-}
-
-LONGEST
-read_signed_register_pid (int regnum, ptid_t ptid)
-{
- ptid_t save_ptid;
- LONGEST retval;
-
- if (ptid_equal (ptid, inferior_ptid))
- return read_signed_register (regnum);
-
- save_ptid = inferior_ptid;
-
- inferior_ptid = ptid;
-
- retval = read_signed_register (regnum);
-
- inferior_ptid = save_ptid;
-
- return retval;
-}
-
/* Store VALUE into the raw contents of register number REGNUM. */
void
@@ -1328,16 +1269,16 @@ regcache_collect (int regnum, void *buf)
}
-/* read_pc, write_pc, read_sp, read_fp, etc. Special handling for
- registers PC, SP, and FP. */
+/* read_pc, write_pc, read_sp, deprecated_read_fp, etc. Special
+ handling for registers PC, SP, and FP. */
/* NOTE: cagney/2001-02-18: The functions generic_target_read_pc(),
read_pc_pid(), read_pc(), generic_target_write_pc(),
write_pc_pid(), write_pc(), generic_target_read_sp(), read_sp(),
- generic_target_write_sp(), generic_target_read_fp() and read_fp(),
- will eventually be moved out of the reg-cache into either
- frame.[hc] or to the multi-arch framework. The are not part of the
- raw register cache. */
+ generic_target_write_sp(), and deprecated_read_fp(), will
+ eventually be moved out of the reg-cache into either frame.[hc] or
+ to the multi-arch framework. The are not part of the raw register
+ cache. */
/* This routine is getting awfully cluttered with #if's. It's probably
time to turn this into READ_PC and define it in the tm.h file.
@@ -1457,20 +1398,14 @@ generic_target_write_sp (CORE_ADDR val)
}
CORE_ADDR
-generic_target_read_fp (void)
+deprecated_read_fp (void)
{
-#ifdef FP_REGNUM
- if (FP_REGNUM >= 0)
- return read_register (FP_REGNUM);
-#endif
- internal_error (__FILE__, __LINE__,
- "generic_target_read_fp");
-}
-
-CORE_ADDR
-read_fp (void)
-{
- return TARGET_READ_FP ();
+ if (DEPRECATED_TARGET_READ_FP_P ())
+ return DEPRECATED_TARGET_READ_FP ();
+ else if (DEPRECATED_FP_REGNUM >= 0)
+ return read_register (DEPRECATED_FP_REGNUM);
+ else
+ internal_error (__FILE__, __LINE__, "deprecated_read_fp");
}
/* ARGSUSED */
@@ -1530,7 +1465,7 @@ regcache_dump (struct regcache *regcache, struct ui_file *file,
int footnote_register_offset = 0;
int footnote_register_type_name_null = 0;
long register_offset = 0;
- unsigned char *buf = alloca (regcache->descr->max_register_size);
+ unsigned char buf[MAX_REGISTER_SIZE];
#if 0
fprintf_unfiltered (file, "legacy_p %d\n", regcache->descr->legacy_p);
@@ -1542,8 +1477,6 @@ regcache_dump (struct regcache *regcache, struct ui_file *file,
regcache->descr->sizeof_raw_registers);
fprintf_unfiltered (file, "sizeof_raw_register_valid_p %ld\n",
regcache->descr->sizeof_raw_register_valid_p);
- fprintf_unfiltered (file, "max_register_size %ld\n",
- regcache->descr->max_register_size);
fprintf_unfiltered (file, "NUM_REGS %d\n", NUM_REGS);
fprintf_unfiltered (file, "NUM_PSEUDO_REGS %d\n", NUM_PSEUDO_REGS);
#endif
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 3fb43c437a4..5d77095810b 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -127,12 +127,6 @@ extern int register_offset_hack (struct gdbarch *gdbarch, int regnum);
extern struct type *register_type (struct gdbarch *gdbarch, int regnum);
-/* Return the size of the largest register. Used when allocating
- space for an aribtrary register value. */
-
-extern int max_register_size (struct gdbarch *gdbarch);
-
-
/* Return the size of register REGNUM. All registers should have only
one size.
@@ -247,10 +241,6 @@ extern ULONGEST read_register (int regnum);
/* Rename to read_unsigned_register_pid()? */
extern ULONGEST read_register_pid (int regnum, ptid_t ptid);
-extern LONGEST read_signed_register (int regnum);
-
-extern LONGEST read_signed_register_pid (int regnum, ptid_t ptid);
-
extern void write_register (int regnum, LONGEST val);
extern void write_register_pid (int regnum, CORE_ADDR val, ptid_t ptid);
diff --git a/gdb/remote-array.c b/gdb/remote-array.c
index da9bfc70e68..8df964771a2 100644
--- a/gdb/remote-array.c
+++ b/gdb/remote-array.c
@@ -731,7 +731,7 @@ array_wait (ptid_t ptid, struct target_waitstatus *status)
static void
array_fetch_registers (int ignored)
{
- char *reg = alloca (MAX_REGISTER_RAW_SIZE);
+ char reg[MAX_REGISTER_SIZE];
int regno;
char *p;
char *packet = alloca (PBUFSIZ);
diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c
index 49c7fb99ae8..643c6b6fe1b 100644
--- a/gdb/remote-e7000.c
+++ b/gdb/remote-e7000.c
@@ -785,7 +785,7 @@ void
fetch_regs_from_dump (int (*nextchar) (), char *want)
{
int regno;
- char *buf = alloca (max_register_size (current_gdbarch));
+ char buf[MAX_REGISTER_SIZE];
int thischar = nextchar ();
@@ -856,9 +856,9 @@ fetch_regs_from_dump (int (*nextchar) (), char *want)
want++;
break;
#endif
-#ifdef FP_REGNUM
+#ifdef DEPRECATED_FP_REGNUM
case 'f':
- regno = FP_REGNUM;
+ regno = DEPRECATED_FP_REGNUM;
want++;
break;
#endif
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index a23f72d4606..d1e3705a4c8 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -1791,7 +1791,7 @@ mips_wait (ptid_t ptid, struct target_waitstatus *status)
&rpc, &rfp, &rsp, flags);
if (nfields >= 3)
{
- char *buf = alloca (max_register_size (current_gdbarch));
+ char buf[MAX_REGISTER_SIZE];
store_unsigned_integer (buf, REGISTER_RAW_SIZE (PC_REGNUM), rpc);
supply_register (PC_REGNUM, buf);
@@ -1802,8 +1802,8 @@ mips_wait (ptid_t ptid, struct target_waitstatus *status)
store_unsigned_integer (buf, REGISTER_RAW_SIZE (SP_REGNUM), rsp);
supply_register (SP_REGNUM, buf);
- store_unsigned_integer (buf, REGISTER_RAW_SIZE (FP_REGNUM), 0);
- supply_register (FP_REGNUM, buf);
+ store_unsigned_integer (buf, REGISTER_RAW_SIZE (DEPRECATED_FP_REGNUM), 0);
+ supply_register (DEPRECATED_FP_REGNUM, buf);
if (nfields == 9)
{
@@ -1943,9 +1943,9 @@ mips_fetch_registers (int regno)
return;
}
- if (regno == FP_REGNUM || regno == ZERO_REGNUM)
- /* FP_REGNUM on the mips is a hack which is just supposed to read
- zero (see also mips-nat.c). */
+ if (regno == DEPRECATED_FP_REGNUM || regno == ZERO_REGNUM)
+ /* DEPRECATED_FP_REGNUM on the mips is a hack which is just
+ supposed to read zero (see also mips-nat.c). */
val = 0;
else
{
@@ -1972,7 +1972,7 @@ mips_fetch_registers (int regno)
}
{
- char *buf = alloca (max_register_size (current_gdbarch));
+ char buf[MAX_REGISTER_SIZE];
/* We got the number the register holds, but gdb expects to see a
value in the target byte ordering. */
diff --git a/gdb/remote-rdp.c b/gdb/remote-rdp.c
index 3f956e7811b..a9dba9ab401 100644
--- a/gdb/remote-rdp.c
+++ b/gdb/remote-rdp.c
@@ -550,7 +550,7 @@ rdp_fetch_one_fpu_register (int mask, char *buf)
send_rdp ("bbw-SWWWWZ", RDP_COPRO_READ, FPU_COPRO_NUMBER, mask, buf + 0, buf + 4, buf + 8, &dummy);
}
#endif
- memset (buf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (buf, 0, MAX_REGISTER_SIZE);
}
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index f934bd40f03..f7b9e89b0ba 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -304,9 +304,9 @@ gdbsim_fetch_register (int regno)
{
/* For moment treat a `does not exist' register the same way
as an ``unavailable'' register. */
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
int nr_bytes;
- memset (buf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (buf, 0, MAX_REGISTER_SIZE);
supply_register (regno, buf);
set_register_cached (regno, -1);
break;
@@ -314,10 +314,10 @@ gdbsim_fetch_register (int regno)
default:
{
static int warn_user = 1;
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
int nr_bytes;
gdb_assert (regno >= 0 && regno < NUM_REGS);
- memset (buf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (buf, 0, MAX_REGISTER_SIZE);
nr_bytes = sim_fetch_register (gdbsim_desc,
REGISTER_SIM_REGNO (regno),
buf, REGISTER_RAW_SIZE (regno));
@@ -359,7 +359,7 @@ gdbsim_store_register (int regno)
}
else if (REGISTER_SIM_REGNO (regno) >= 0)
{
- char *tmp = alloca (max_register_size (current_gdbarch));
+ char tmp[MAX_REGISTER_SIZE];
int nr_bytes;
deprecated_read_register_gen (regno, tmp);
nr_bytes = sim_store_register (gdbsim_desc,
diff --git a/gdb/remote.c b/gdb/remote.c
index 902cb5fc62d..20becee27d6 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -2948,7 +2948,7 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status)
case 'T': /* Status with PC, SP, FP, ... */
{
int i;
- char* regs = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char regs[MAX_REGISTER_SIZE];
/* Expedited reply, containing Signal, {regno, reg} repeat */
/* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
@@ -3199,7 +3199,7 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
case 'T': /* Status with PC, SP, FP, ... */
{
int i;
- char* regs = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char regs[MAX_REGISTER_SIZE];
/* Expedited reply, containing Signal, {regno, reg} repeat */
/* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
@@ -3546,7 +3546,7 @@ store_register_using_P (int regnum)
struct packet_reg *reg = packet_reg_from_regnum (rs, regnum);
/* Try storing a single register. */
char *buf = alloca (rs->remote_packet_size);
- char *regp = alloca (MAX_REGISTER_RAW_SIZE);
+ char regp[MAX_REGISTER_SIZE];
char *p;
int i;
@@ -3973,7 +3973,10 @@ remote_xfer_memory (CORE_ADDR mem_addr, char *buffer, int mem_len,
int targ_len;
int res;
- REMOTE_TRANSLATE_XFER_ADDRESS (mem_addr, mem_len, &targ_addr, &targ_len);
+ /* Should this be the selected frame? */
+ gdbarch_remote_translate_xfer_address (current_gdbarch, current_regcache,
+ mem_addr, mem_len,
+ &targ_addr, &targ_len);
if (targ_len <= 0)
return 0;
diff --git a/gdb/rom68k-rom.c b/gdb/rom68k-rom.c
index 57c0a182327..6b0926bf408 100644
--- a/gdb/rom68k-rom.c
+++ b/gdb/rom68k-rom.c
@@ -88,7 +88,7 @@ static char *
rom68k_supply_one_register (int regno, unsigned char *hex)
{
ULONGEST value;
- unsigned char *regbuf = alloca (max_register_size (current_gdbarch));
+ unsigned char regbuf[MAX_REGISTER_SIZE];
value = 0;
while (*hex != '\0')
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 4aed8d8a939..c5a0ea73d8f 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -218,7 +218,7 @@ rs6000_ptrace64 (int req, int id, long long addr, int data, int *buf)
static void
fetch_register (int regno)
{
- int *addr = alloca (MAX_REGISTER_RAW_SIZE);
+ int addr[MAX_REGISTER_SIZE];
int nr, isfloat;
/* Retrieved values may be -1, so infer errors from errno. */
@@ -275,7 +275,7 @@ fetch_register (int regno)
static void
store_register (int regno)
{
- int *addr = alloca (MAX_REGISTER_RAW_SIZE);
+ int addr[MAX_REGISTER_SIZE];
int nr, isfloat;
/* Fetch the register's value from the register cache. */
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 9f553687ec4..0b239bd4180 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1739,7 +1739,7 @@ frame_initial_stack_address (struct frame_info *fi)
/* There is an alloca register, use its value, in the current frame,
as the initial stack pointer. */
{
- char *tmpbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char tmpbuf[MAX_REGISTER_SIZE];
if (frame_register_read (fi, fdata.alloca_reg, tmpbuf))
{
get_frame_extra_info (fi)->initial_sp
@@ -1921,7 +1921,7 @@ e500_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
{
int base_regnum;
int offset = 0;
- char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char temp_buffer[MAX_REGISTER_SIZE];
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->ppc_gp0_regnum
@@ -1944,7 +1944,7 @@ e500_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
int base_regnum;
int offset = 0;
- char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char temp_buffer[MAX_REGISTER_SIZE];
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->ppc_gp0_regnum
@@ -2797,7 +2797,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pc_regnum (gdbarch, 64);
set_gdbarch_sp_regnum (gdbarch, 1);
- set_gdbarch_fp_regnum (gdbarch, 1);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, 1);
set_gdbarch_deprecated_extract_return_value (gdbarch,
rs6000_extract_return_value);
set_gdbarch_deprecated_store_return_value (gdbarch, rs6000_store_return_value);
@@ -2830,7 +2830,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->ppc_ev31_regnum = 38;
set_gdbarch_pc_regnum (gdbarch, 0);
set_gdbarch_sp_regnum (gdbarch, tdep->ppc_gp0_regnum + 1);
- set_gdbarch_fp_regnum (gdbarch, tdep->ppc_gp0_regnum + 1);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, tdep->ppc_gp0_regnum + 1);
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, e500_dwarf2_reg_to_regnum);
set_gdbarch_pseudo_register_read (gdbarch, e500_pseudo_register_read);
set_gdbarch_pseudo_register_write (gdbarch, e500_pseudo_register_write);
@@ -2872,14 +2872,13 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_read_pc (gdbarch, generic_target_read_pc);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
- set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
set_gdbarch_num_regs (gdbarch, v->nregs);
set_gdbarch_num_pseudo_regs (gdbarch, v->npregs);
set_gdbarch_register_name (gdbarch, rs6000_register_name);
- set_gdbarch_register_size (gdbarch, wordsize);
+ set_gdbarch_deprecated_register_size (gdbarch, wordsize);
set_gdbarch_register_bytes (gdbarch, off);
set_gdbarch_register_byte (gdbarch, rs6000_register_byte);
set_gdbarch_register_raw_size (gdbarch, rs6000_register_raw_size);
@@ -2901,7 +2900,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_char_signed (gdbarch, 0);
- set_gdbarch_fix_call_dummy (gdbarch, rs6000_fix_call_dummy);
+ set_gdbarch_deprecated_fix_call_dummy (gdbarch, rs6000_fix_call_dummy);
set_gdbarch_frame_align (gdbarch, rs6000_frame_align);
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
set_gdbarch_deprecated_push_return_address (gdbarch, ppc_push_return_address);
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 415fde7b480..f836c1b0516 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -280,7 +280,7 @@ s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info,
memset (gprs_saved, 0, sizeof (gprs_saved));
memset (fprs_saved, 0, sizeof (fprs_saved));
- info.read_memory_func = dis_asm_read_memory;
+ info.read_memory_func = deprecated_tm_print_insn_info.read_memory_func;
save_link_regidx = subtract_sp_regidx = 0;
if (fextra_info)
@@ -682,7 +682,7 @@ s390_check_function_end (CORE_ADDR pc)
disassemble_info info;
int regidx, instrlen;
- info.read_memory_func = dis_asm_read_memory;
+ info.read_memory_func = deprecated_tm_print_insn_info.read_memory_func;
instrlen = s390_readinstruction (instr, pc, &info);
if (instrlen < 0)
return -1;
@@ -819,7 +819,7 @@ s390_is_sigreturn (CORE_ADDR pc, struct frame_info *sighandler_fi,
scontext = temp_sregs = 0;
- info.read_memory_func = dis_asm_read_memory;
+ info.read_memory_func = deprecated_tm_print_insn_info.read_memory_func;
instrlen = s390_readinstruction (instr, pc, &info);
if (sigcaller_pc)
*sigcaller_pc = 0;
@@ -1150,7 +1150,7 @@ void
s390_store_return_value (struct type *valtype, char *valbuf)
{
int arglen;
- char *reg_buff = alloca (max (S390_FPR_SIZE, REGISTER_SIZE)), *value;
+ char *reg_buff = alloca (max (S390_FPR_SIZE, DEPRECATED_REGISTER_SIZE)), *value;
if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
{
@@ -1658,7 +1658,7 @@ s390_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
frame. This will help us get backtraces from within functions
called from GDB. */
write_memory_unsigned_integer (sp, (TARGET_PTR_BIT / TARGET_CHAR_BIT),
- read_fp ());
+ deprecated_read_fp ());
return sp;
}
@@ -1841,7 +1841,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_skip_prologue (gdbarch, s390_skip_prologue);
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, s390_init_extra_frame_info);
set_gdbarch_deprecated_init_frame_pc_first (gdbarch, s390_init_frame_pc_first);
- set_gdbarch_read_fp (gdbarch, s390_read_fp);
+ set_gdbarch_deprecated_target_read_fp (gdbarch, s390_read_fp);
/* This function that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
@@ -1856,7 +1856,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_byte (gdbarch, s390_register_byte);
set_gdbarch_pc_regnum (gdbarch, S390_PC_REGNUM);
set_gdbarch_sp_regnum (gdbarch, S390_SP_REGNUM);
- set_gdbarch_fp_regnum (gdbarch, S390_FP_REGNUM);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, S390_FP_REGNUM);
set_gdbarch_fp0_regnum (gdbarch, S390_FP0_REGNUM);
set_gdbarch_num_regs (gdbarch, S390_NUM_REGS);
set_gdbarch_cannot_fetch_register (gdbarch, s390_cannot_fetch_register);
@@ -1876,14 +1876,13 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
set_gdbarch_deprecated_push_return_address (gdbarch,
s390_push_return_address);
- set_gdbarch_sizeof_call_dummy_words (gdbarch,
- sizeof (s390_call_dummy_words));
- set_gdbarch_call_dummy_words (gdbarch, s390_call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (s390_call_dummy_words));
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, s390_call_dummy_words);
switch (info.bfd_arch_info->mach)
{
case bfd_mach_s390_31:
- set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_deprecated_register_size (gdbarch, 4);
set_gdbarch_register_raw_size (gdbarch, s390_register_raw_size);
set_gdbarch_register_virtual_size (gdbarch, s390_register_raw_size);
set_gdbarch_register_virtual_type (gdbarch, s390_register_virtual_type);
@@ -1892,7 +1891,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_bytes (gdbarch, S390_REGISTER_BYTES);
break;
case bfd_mach_s390_64:
- set_gdbarch_register_size (gdbarch, 8);
+ set_gdbarch_deprecated_register_size (gdbarch, 8);
set_gdbarch_register_raw_size (gdbarch, s390x_register_raw_size);
set_gdbarch_register_virtual_size (gdbarch, s390x_register_raw_size);
set_gdbarch_register_virtual_type (gdbarch,
@@ -1925,8 +1924,8 @@ _initialize_s390_tdep (void)
/* Hook us into the gdbarch mechanism. */
register_gdbarch_init (bfd_arch_s390, s390_gdbarch_init);
- if (!tm_print_insn) /* Someone may have already set it */
- tm_print_insn = gdb_print_insn_s390;
+ if (!deprecated_tm_print_insn) /* Someone may have already set it */
+ deprecated_tm_print_insn = gdb_print_insn_s390;
}
#endif /* GDBSERVER */
diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c
index 99a1fd5ba96..1af501d5829 100644
--- a/gdb/scm-lang.c
+++ b/gdb/scm-lang.c
@@ -33,6 +33,7 @@
#include "source.h"
#include "gdb_string.h"
#include "gdbcore.h"
+#include "infcall.h"
extern void _initialize_scheme_language (void);
static struct value *evaluate_subexp_scm (struct type *, struct expression *,
diff --git a/gdb/sentinel-frame.c b/gdb/sentinel-frame.c
index dab16478413..dcc583ec98e 100644
--- a/gdb/sentinel-frame.c
+++ b/gdb/sentinel-frame.c
@@ -56,7 +56,7 @@ sentinel_frame_prev_register (struct frame_info *next_frame,
onto the corresponding hardware register. */
*optimized = 0;
*lvalp = lval_register;
- *addrp = REGISTER_BYTE (regnum);
+ *addrp = register_offset_hack (current_gdbarch, regnum);
*realnum = regnum;
/* If needed, find and return the value of the register. */
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 0390e95f84f..0ef65de2c02 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -1003,7 +1003,7 @@ sh64_frame_chain (struct frame_info *frame)
if (gdbarch_tdep (current_gdbarch)->sh_abi == SH_ABI_32)
size = 4;
else
- size = REGISTER_RAW_SIZE (translate_insn_rn (FP_REGNUM, media_mode));
+ size = REGISTER_RAW_SIZE (translate_insn_rn (DEPRECATED_FP_REGNUM, media_mode));
return read_memory_integer (get_frame_base (frame)
+ get_frame_extra_info (frame)->f_offset,
size);
@@ -1172,7 +1172,7 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi)
{
if (where[rn] >= 0)
{
- if (rn == FP_REGNUM)
+ if (rn == DEPRECATED_FP_REGNUM)
have_fp = 1;
get_frame_saved_regs (fi)[rn] = get_frame_base (fi) - where[rn] + depth - 4;
@@ -1185,14 +1185,14 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi)
if (have_fp)
{
- get_frame_saved_regs (fi)[SP_REGNUM] = read_memory_integer (get_frame_saved_regs (fi)[FP_REGNUM], 4);
+ get_frame_saved_regs (fi)[SP_REGNUM] = read_memory_integer (get_frame_saved_regs (fi)[DEPRECATED_FP_REGNUM], 4);
}
else
{
get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) - 4;
}
- get_frame_extra_info (fi)->f_offset = depth - where[FP_REGNUM] - 4;
+ get_frame_extra_info (fi)->f_offset = depth - where[DEPRECATED_FP_REGNUM] - 4;
/* Work out the return pc - either from the saved pr or the pr
value */
}
@@ -1477,7 +1477,7 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi)
/* The frame pointer register is general register 14 in shmedia and
shcompact modes. In sh compact it is a pseudo register. Same goes
for the stack pointer register, which is register 15. */
- fp_regnum = translate_insn_rn (FP_REGNUM, media_mode);
+ fp_regnum = translate_insn_rn (DEPRECATED_FP_REGNUM, media_mode);
sp_regnum = translate_insn_rn (SP_REGNUM, media_mode);
for (opc = pc + (insn_size * 28); pc < opc; pc += insn_size)
@@ -1602,8 +1602,8 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi)
register r15 which still is the SP register. */
/* The place on the stack where fp is stored contains the sp of
the caller. */
- /* Again, saved_registers contains only space for the real registers,
- so we store in FP_REGNUM position. */
+ /* Again, saved_registers contains only space for the real
+ registers, so we store in DEPRECATED_FP_REGNUM position. */
int size;
if (tdep->sh_abi == SH_ABI_32)
size = 4;
@@ -1724,7 +1724,7 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi)
{
if (where[rn] >= 0)
{
- if (rn == FP_REGNUM)
+ if (rn == DEPRECATED_FP_REGNUM)
have_fp = 1;
get_frame_saved_regs (fi)[rn] = get_frame_base (fi) - where[rn] + depth - 4;
@@ -1738,14 +1738,14 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi)
if (have_fp)
{
get_frame_saved_regs (fi)[SP_REGNUM] =
- read_memory_integer (get_frame_saved_regs (fi)[FP_REGNUM], 4);
+ read_memory_integer (get_frame_saved_regs (fi)[DEPRECATED_FP_REGNUM], 4);
}
else
{
get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) - 4;
}
- get_frame_extra_info (fi)->f_offset = depth - where[FP_REGNUM] - 4;
+ get_frame_extra_info (fi)->f_offset = depth - where[DEPRECATED_FP_REGNUM] - 4;
/* Work out the return pc - either from the saved pr or the pr
value */
}
@@ -1763,14 +1763,14 @@ sh_init_extra_frame_info (int fromleaf, struct frame_info *fi)
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
get_frame_base (fi)))
{
- /* We need to setup fi->frame here because run_stack_dummy gets it wrong
- by assuming it's always FP. */
+ /* We need to setup fi->frame here because call_function_by_hand
+ gets it wrong by assuming it's always FP. */
deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi),
SP_REGNUM));
get_frame_extra_info (fi)->return_pc = deprecated_read_register_dummy (get_frame_pc (fi),
get_frame_base (fi),
PC_REGNUM);
- get_frame_extra_info (fi)->f_offset = -(CALL_DUMMY_LENGTH + 4);
+ get_frame_extra_info (fi)->f_offset = -(DEPRECATED_CALL_DUMMY_LENGTH + 4);
get_frame_extra_info (fi)->leaf_function = 0;
return;
}
@@ -1795,13 +1795,13 @@ sh64_init_extra_frame_info (int fromleaf, struct frame_info *fi)
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
get_frame_base (fi)))
{
- /* We need to setup fi->frame here because run_stack_dummy gets it wrong
- by assuming it's always FP. */
+ /* We need to setup fi->frame here because call_function_by_hand
+ gets it wrong by assuming it's always FP. */
deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM));
get_frame_extra_info (fi)->return_pc =
deprecated_read_register_dummy (get_frame_pc (fi),
get_frame_base (fi), PC_REGNUM);
- get_frame_extra_info (fi)->f_offset = -(CALL_DUMMY_LENGTH + 4);
+ get_frame_extra_info (fi)->f_offset = -(DEPRECATED_CALL_DUMMY_LENGTH + 4);
get_frame_extra_info (fi)->leaf_function = 0;
return;
}
@@ -1885,7 +1885,7 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
{
int size;
if (tdep->sh_abi == SH_ABI_32
- && (live_regnum == FP_REGNUM
+ && (live_regnum == DEPRECATED_FP_REGNUM
|| live_regnum == tdep->PR_REGNUM))
size = 4;
else
@@ -1993,7 +1993,7 @@ sh64_pop_frame (void)
{
int size;
if (tdep->sh_abi == SH_ABI_32
- && (regnum == FP_REGNUM
+ && (regnum == DEPRECATED_FP_REGNUM
|| regnum == tdep->PR_REGNUM))
size = 4;
else
@@ -3481,7 +3481,7 @@ sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
int reg_nr, void *buffer)
{
int base_regnum, portion;
- char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char temp_buffer[MAX_REGISTER_SIZE];
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
@@ -3520,7 +3520,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
int base_regnum;
int portion;
int offset = 0;
- char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char temp_buffer[MAX_REGISTER_SIZE];
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
@@ -3684,7 +3684,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int reg_nr, const void *buffer)
{
int base_regnum, portion;
- char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char temp_buffer[MAX_REGISTER_SIZE];
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
@@ -3721,7 +3721,7 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
int base_regnum, portion;
int offset;
- char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char temp_buffer[MAX_REGISTER_SIZE];
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
@@ -4087,7 +4087,7 @@ sh64_do_pseudo_register (int regnum)
static void
sh_do_register (int regnum)
{
- char *raw_buffer = alloca (max_register_size (current_gdbarch));
+ char raw_buffer[MAX_REGISTER_SIZE];
fputs_filtered (REGISTER_NAME (regnum), gdb_stdout);
print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), gdb_stdout);
@@ -4365,9 +4365,9 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_num_regs (gdbarch, SH_DEFAULT_NUM_REGS);
set_gdbarch_sp_regnum (gdbarch, 15);
- set_gdbarch_fp_regnum (gdbarch, 14);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, 14);
set_gdbarch_pc_regnum (gdbarch, 16);
- set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_deprecated_register_size (gdbarch, 4);
set_gdbarch_register_bytes (gdbarch, SH_DEFAULT_NUM_REGS * 4);
set_gdbarch_deprecated_do_registers_info (gdbarch, sh_do_registers_info);
set_gdbarch_breakpoint_from_pc (gdbarch, sh_breakpoint_from_pc);
@@ -4586,7 +4586,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* the number of real registers is the same whether we are in
ISA16(compact) or ISA32(media). */
set_gdbarch_num_regs (gdbarch, SIM_SH64_NR_REGS);
- set_gdbarch_register_size (gdbarch, 8); /*????*/
+ set_gdbarch_deprecated_register_size (gdbarch, 8); /*????*/
set_gdbarch_register_bytes (gdbarch,
((SIM_SH64_NR_FP_REGS + 1) * 4)
+ (SIM_SH64_NR_REGS - SIM_SH64_NR_FP_REGS -1) * 8);
@@ -4639,7 +4639,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_read_pc (gdbarch, generic_target_read_pc);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
- set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
@@ -4653,8 +4652,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
- set_gdbarch_call_dummy_words (gdbarch, sh_call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (sh_call_dummy_words));
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, sh_call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (sh_call_dummy_words));
set_gdbarch_deprecated_push_return_address (gdbarch, sh_push_return_address);
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 1d379e9ec19..8e2c4ad57a8 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -647,9 +647,9 @@ sol_thread_store_registers (int regno)
if (regno != -1)
{ /* Not writing all the regs */
/* save new register value */
- char* old_value = (char*) alloca (REGISTER_SIZE);
+ char* old_value = (char*) alloca (DEPRECATED_REGISTER_SIZE);
memcpy (old_value, &deprecated_registers[REGISTER_BYTE (regno)],
- REGISTER_SIZE);
+ DEPRECATED_REGISTER_SIZE);
val = p_td_thr_getgregs (&thandle, gregset);
if (val != TD_OK)
@@ -662,7 +662,7 @@ sol_thread_store_registers (int regno)
/* restore new register value */
memcpy (&deprecated_registers[REGISTER_BYTE (regno)], old_value,
- REGISTER_SIZE);
+ DEPRECATED_REGISTER_SIZE);
#if 0
/* thread_db doesn't seem to handle this right */
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index e1a0089f3c0..7f0ae4b2046 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -51,8 +51,11 @@
#if (GDB_MULTI_ARCH > 0)
-/* Does the target have Floating Point registers? */
-#define SPARC_HAS_FPU (gdbarch_tdep (current_gdbarch)->has_fpu)
+#if 0
+// OBSOLETE /* Does the target have Floating Point registers? */
+// OBSOLETE #define SPARC_HAS_FPU (gdbarch_tdep (current_gdbarch)->has_fpu)
+#endif
+#define SPARC_HAS_FPU 1
/* Number of bytes devoted to Floating Point registers: */
#define FP_REGISTER_BYTES (gdbarch_tdep (current_gdbarch)->fp_register_bytes)
/* Highest numbered Floating Point register. */
@@ -310,13 +313,11 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
: get_frame_base (get_next_frame (fi)))
: read_sp ());
- /* If fi->next is NULL, then we already set ->frame by passing read_fp()
- to create_new_frame. */
+ /* If fi->next is NULL, then we already set ->frame by passing
+ deprecated_read_fp() to create_new_frame. */
if (get_next_frame (fi))
{
- char *buf;
-
- buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
/* Compute ->frame as if not flat. If it is flat, we'll change
it later. */
@@ -335,7 +336,7 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
/* Should we adjust for stack bias here? */
ULONGEST tmp;
- frame_read_unsigned_register (fi, FP_REGNUM, &tmp);
+ frame_read_unsigned_register (fi, DEPRECATED_FP_REGNUM, &tmp);
deprecated_update_frame_base_hack (fi, tmp);
if (GDB_TARGET_IS_SPARC64 && (get_frame_base (fi) & 1))
deprecated_update_frame_base_hack (fi, get_frame_base (fi) + 2047);
@@ -365,9 +366,7 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
&& X_OP3 (insn) == 4
&& X_RS1 (insn) == 14)
{
- char *buf;
-
- buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
/* We definitely have a flat frame now. */
get_frame_extra_info (fi)->flat = 1;
@@ -471,10 +470,9 @@ sparc_extract_struct_value_address (char *regbuf)
CORE_ADDR
sparc_frame_saved_pc (struct frame_info *frame)
{
- char *buf;
+ char buf[MAX_REGISTER_SIZE];
CORE_ADDR addr;
- buf = alloca (MAX_REGISTER_RAW_SIZE);
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
{
/* This is the signal trampoline frame.
@@ -1065,16 +1063,16 @@ sparc_push_dummy_frame (void)
if (GDB_TARGET_IS_SPARC64)
{
/* Target is a 64 bit SPARC. */
- CORE_ADDR oldfp = read_register (FP_REGNUM);
+ CORE_ADDR oldfp = read_register (DEPRECATED_FP_REGNUM);
if (oldfp & 1)
- write_register (FP_REGNUM, old_sp - 2047);
+ write_register (DEPRECATED_FP_REGNUM, old_sp - 2047);
else
- write_register (FP_REGNUM, old_sp);
+ write_register (DEPRECATED_FP_REGNUM, old_sp);
}
else
{
/* Target is a 32 bit SPARC. */
- write_register (FP_REGNUM, old_sp);
+ write_register (DEPRECATED_FP_REGNUM, old_sp);
}
/* Set return address register for the call dummy to the current PC. */
write_register (I7_REGNUM, read_pc () - 8);
@@ -1084,7 +1082,7 @@ sparc_push_dummy_frame (void)
/* The call dummy will write this value to FP before executing
the 'save'. This ensures that register window flushes work
correctly in the simulator. */
- write_register (G0_REGNUM + 1, read_register (FP_REGNUM));
+ write_register (G0_REGNUM + 1, read_register (DEPRECATED_FP_REGNUM));
/* The call dummy will write this value to FP after executing
the 'save'. */
@@ -1096,7 +1094,7 @@ sparc_push_dummy_frame (void)
/* Set the FP that the call dummy will be using after the 'save'.
This makes backtraces from an inferior function call work properly. */
- write_register (FP_REGNUM, old_sp);
+ write_register (DEPRECATED_FP_REGNUM, old_sp);
}
}
@@ -2067,8 +2065,8 @@ sparc_print_registers (struct gdbarch *gdbarch,
{
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);
+ char raw_buffer[MAX_REGISTER_SIZE];
+ char virtual_buffer[MAX_REGISTER_SIZE];
for (i = 0; i < numregs; i++)
{
@@ -2308,9 +2306,7 @@ void
sparc_store_return_value (struct type *type, char *valbuf)
{
int regno;
- char *buffer;
-
- buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char buffer[MAX_REGISTER_SIZE];
if (TYPE_CODE (type) == TYPE_CODE_FLT && SPARC_HAS_FPU)
/* Floating-point values are returned in the register pair */
@@ -2354,9 +2350,10 @@ sparc_store_return_value (struct type *type, char *valbuf)
For structs and unions, if the function was compiled with Sun cc,
it expects 'unimp' after the call. But gcc doesn't use that
- (twisted) convention. So leave a nop there for gcc (FIX_CALL_DUMMY
- can assume it is operating on a pristine CALL_DUMMY, not one that
- has already been customized for a different function). */
+ (twisted) convention. So leave a nop there for gcc
+ (DEPRECATED_FIX_CALL_DUMMY can assume it is operating on a pristine
+ CALL_DUMMY, not one that has already been customized for a
+ different function). */
void
sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
@@ -2379,19 +2376,20 @@ sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
Adjust the call_dummy_breakpoint_offset for the bp_call_dummy breakpoint
to the proper address in the call dummy, so that `finish' after a stop
in a call dummy works.
- Tweeking current_gdbarch is not an optimal solution, but the call to
- sparc_fix_call_dummy is immediately followed by a call to run_stack_dummy,
- which is the only function where dummy_breakpoint_offset is actually
- used, if it is non-zero. */
+
+ Tweeking current_gdbarch is not an optimal solution, but the call
+ to sparc_fix_call_dummy is immediately followed by a call to
+ call_function_by_hand, which is the only function where
+ dummy_breakpoint_offset is actually used, if it is non-zero. */
if (TYPE_CODE (value_type) == TYPE_CODE_STRUCT
|| TYPE_CODE (value_type) == TYPE_CODE_UNION)
{
store_unsigned_integer (dummy + CALL_DUMMY_CALL_OFFSET + 8, 4,
TYPE_LENGTH (value_type) & 0x1fff);
- set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 0x30);
+ set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 0x30);
}
else
- set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 0x2c);
+ set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 0x2c);
if (!(GDB_TARGET_IS_SPARC64))
{
@@ -2459,8 +2457,8 @@ _initialize_sparc_tdep (void)
/* Hook us into the gdbarch mechanism. */
gdbarch_register (bfd_arch_sparc, sparc_gdbarch_init, sparc_dump_tdep);
- tm_print_insn = gdb_print_insn_sparc;
- tm_print_insn_info.mach = TM_PRINT_INSN_MACH; /* Selects sparc/sparclite */
+ deprecated_tm_print_insn = gdb_print_insn_sparc;
+ deprecated_tm_print_insn_info.mach = TM_PRINT_INSN_MACH; /* Selects sparc/sparclite */
/* OBSOLETE target_architecture_hook = sparc_target_architecture_hook; */
}
@@ -2480,7 +2478,7 @@ sparc64_read_sp (void)
CORE_ADDR
sparc64_read_fp (void)
{
- CORE_ADDR fp = read_register (FP_REGNUM);
+ CORE_ADDR fp = read_register (DEPRECATED_FP_REGNUM);
if (fp & 1)
fp += 2047;
@@ -2934,7 +2932,7 @@ static struct type *
sparc32_register_virtual_type (int regno)
{
if (regno == PC_REGNUM ||
- regno == FP_REGNUM ||
+ regno == DEPRECATED_FP_REGNUM ||
regno == SP_REGNUM)
return builtin_type_unsigned_int;
if (regno < 32)
@@ -2948,7 +2946,7 @@ static struct type *
sparc64_register_virtual_type (int regno)
{
if (regno == PC_REGNUM ||
- regno == FP_REGNUM ||
+ regno == DEPRECATED_FP_REGNUM ||
regno == SP_REGNUM)
return builtin_type_unsigned_long_long;
if (regno < 32)
@@ -3050,7 +3048,7 @@ sparc_gdbarch_fix_call_dummy (char *dummy,
static CORE_ADDR
sparc_call_dummy_address (void)
{
- return (CALL_DUMMY_START_OFFSET) + CALL_DUMMY_BREAKPOINT_OFFSET;
+ return (DEPRECATED_CALL_DUMMY_START_OFFSET) + DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET;
}
/* Supply the Y register number to those that need it. */
@@ -3159,9 +3157,9 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sparc_extract_struct_value_address);
- set_gdbarch_fix_call_dummy (gdbarch, sparc_gdbarch_fix_call_dummy);
+ set_gdbarch_deprecated_fix_call_dummy (gdbarch, sparc_gdbarch_fix_call_dummy);
set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
- set_gdbarch_fp_regnum (gdbarch, SPARC_FP_REGNUM);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, SPARC_FP_REGNUM);
set_gdbarch_fp0_regnum (gdbarch, SPARC_FP0_REGNUM);
set_gdbarch_deprecated_frame_chain (gdbarch, sparc_frame_chain);
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sparc_frame_init_saved_regs);
@@ -3217,10 +3215,18 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
#ifdef SPARC32_CALL_DUMMY_ON_STACK
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address);
- set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0x30);
- set_gdbarch_call_dummy_length (gdbarch, 0x38);
-
- /* NOTE: cagney/2002-04-26: Based from info posted by Peter
+ set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 0x30);
+ set_gdbarch_deprecated_call_dummy_length (gdbarch, 0x38);
+
+ /* NOTE: cagney/2003-05-01: Using the just added push_dummy_code
+ architecture method, it is now possible to implement a
+ generic dummy frames based inferior function call that stores
+ the breakpoint (and struct info) on the stack. Further, by
+ treating a SIGSEG at a breakpoint as equivalent to a SIGTRAP
+ it is even possible to make this work when the stack is
+ no-execute.
+
+ NOTE: cagney/2002-04-26: Based from info posted by Peter
Schauer around Oct '99. Briefly, due to aspects of the SPARC
ABI, it isn't possible to use ON_STACK with a strictly
compliant compiler.
@@ -3264,10 +3270,10 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
are explained in Appendix D.3. */
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
- set_gdbarch_call_dummy_words (gdbarch, call_dummy_32);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_32);
#else
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
- set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_nil);
#endif
set_gdbarch_deprecated_call_dummy_stack_adjust (gdbarch, 68);
set_gdbarch_frame_args_skip (gdbarch, 68);
@@ -3277,19 +3283,18 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pc_regnum (gdbarch, SPARC32_PC_REGNUM);
set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_deprecated_push_arguments (gdbarch, sparc32_push_arguments);
- set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
set_gdbarch_register_byte (gdbarch, sparc32_register_byte);
set_gdbarch_register_raw_size (gdbarch, sparc32_register_size);
- set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_deprecated_register_size (gdbarch, 4);
set_gdbarch_register_virtual_size (gdbarch, sparc32_register_size);
set_gdbarch_register_virtual_type (gdbarch,
sparc32_register_virtual_type);
#ifdef SPARC32_CALL_DUMMY_ON_STACK
- set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_32));
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_32));
#else
- set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
#endif
set_gdbarch_stack_align (gdbarch, sparc32_stack_align);
set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1);
@@ -3312,14 +3317,14 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
#ifdef SPARC64_CALL_DUMMY_ON_STACK
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address);
- set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 8 * 4);
- set_gdbarch_call_dummy_length (gdbarch, 192);
+ set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 8 * 4);
+ set_gdbarch_deprecated_call_dummy_length (gdbarch, 192);
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
- set_gdbarch_call_dummy_start_offset (gdbarch, 148);
- set_gdbarch_call_dummy_words (gdbarch, call_dummy_64);
+ set_gdbarch_deprecated_call_dummy_start_offset (gdbarch, 148);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_64);
#else
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
- set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_nil);
#endif
set_gdbarch_deprecated_call_dummy_stack_adjust (gdbarch, 128);
set_gdbarch_frame_args_skip (gdbarch, 136);
@@ -3330,20 +3335,20 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_ptr_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_deprecated_push_arguments (gdbarch, sparc64_push_arguments);
/* NOTE different for at_entry */
- set_gdbarch_read_fp (gdbarch, sparc64_read_fp);
+ set_gdbarch_deprecated_target_read_fp (gdbarch, sparc64_read_fp);
set_gdbarch_read_sp (gdbarch, sparc64_read_sp);
/* Some of the registers aren't 64 bits, but it's a lot simpler just
to assume they all are (since most of them are). */
set_gdbarch_register_byte (gdbarch, sparc64_register_byte);
set_gdbarch_register_raw_size (gdbarch, sparc64_register_size);
- set_gdbarch_register_size (gdbarch, 8);
+ set_gdbarch_deprecated_register_size (gdbarch, 8);
set_gdbarch_register_virtual_size (gdbarch, sparc64_register_size);
set_gdbarch_register_virtual_type (gdbarch,
sparc64_register_virtual_type);
#ifdef SPARC64_CALL_DUMMY_ON_STACK
- set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_64));
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_64));
#else
- set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
#endif
set_gdbarch_stack_align (gdbarch, sparc64_stack_align);
set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1);
diff --git a/gdb/stack.c b/gdb/stack.c
index 2cb9a95dc3d..0a0aaac2a75 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -614,10 +614,25 @@ frame_info (char *addr_exp, int from_tty)
int i, count, numregs;
char *funname = 0;
enum language funlang = language_unknown;
+ const char *pc_regname;
if (!target_has_stack)
error ("No stack.");
+ /* Name of the value returned by get_frame_pc(). Per comments, "pc"
+ is not a good name. */
+ if (PC_REGNUM >= 0)
+ /* OK, this is weird. The PC_REGNUM hardware register's value can
+ easily not match that of the internal value returned by
+ get_frame_pc(). */
+ pc_regname = REGISTER_NAME (PC_REGNUM);
+ else
+ /* But then, this is weird to. Even without PC_REGNUM, an
+ architectures will often have a hardware register called "pc",
+ and that register's value, again, can easily not match
+ get_frame_pc(). */
+ pc_regname = "pc";
+
fi = parse_frame_specification (addr_exp);
if (fi == NULL)
error ("Invalid frame specified.");
@@ -680,7 +695,7 @@ frame_info (char *addr_exp, int from_tty)
print_address_numeric (get_frame_base (fi), 1, gdb_stdout);
printf_filtered (":\n");
}
- printf_filtered (" %s = ", REGISTER_NAME (PC_REGNUM));
+ printf_filtered (" %s = ", pc_regname);
print_address_numeric (get_frame_pc (fi), 1, gdb_stdout);
wrap_here (" ");
@@ -695,7 +710,7 @@ frame_info (char *addr_exp, int from_tty)
printf_filtered (" (%s:%d)", sal.symtab->filename, sal.line);
puts_filtered ("; ");
wrap_here (" ");
- printf_filtered ("saved %s ", REGISTER_NAME (PC_REGNUM));
+ printf_filtered ("saved %s ", pc_regname);
print_address_numeric (frame_pc_unwind (fi), 1, gdb_stdout);
printf_filtered ("\n");
@@ -799,7 +814,7 @@ frame_info (char *addr_exp, int from_tty)
&realnum, NULL);
if (!optimized && lval == not_lval)
{
- void *value = alloca (MAX_REGISTER_RAW_SIZE);
+ char value[MAX_REGISTER_SIZE];
CORE_ADDR sp;
frame_register_unwind (fi, SP_REGNUM, &optimized, &lval, &addr,
&realnum, value);
diff --git a/gdb/std-regs.c b/gdb/std-regs.c
index 6078d1ab2b8..93d5102661c 100644
--- a/gdb/std-regs.c
+++ b/gdb/std-regs.c
@@ -74,39 +74,43 @@ value_of_builtin_frame_reg (struct frame_info *frame)
static struct value *
value_of_builtin_frame_fp_reg (struct frame_info *frame)
{
-#ifdef FP_REGNUM
- if (FP_REGNUM >= 0)
- return value_of_register (FP_REGNUM, frame);
-#endif
- {
- struct value *val = allocate_value (builtin_type_void_data_ptr);
- char *buf = VALUE_CONTENTS_RAW (val);
- if (frame == NULL)
- memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
- else
- ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
- get_frame_base (frame));
- return val;
- }
+ if (DEPRECATED_FP_REGNUM >= 0)
+ /* NOTE: cagney/2003-04-24: Since the mere presence of "fp" in the
+ register name table overrides this built-in $fp register, there
+ is no real reason for this DEPRECATED_FP_REGNUM trickery here.
+ An architecture wanting to implement "$fp" as alias for a raw
+ register can do so by adding "fp" to register name table (mind
+ you, doing this is probably a dangerous thing). */
+ return value_of_register (DEPRECATED_FP_REGNUM, frame);
+ else
+ {
+ struct value *val = allocate_value (builtin_type_void_data_ptr);
+ char *buf = VALUE_CONTENTS_RAW (val);
+ if (frame == NULL)
+ memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
+ else
+ ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
+ get_frame_base (frame));
+ return val;
+ }
}
static struct value *
value_of_builtin_frame_pc_reg (struct frame_info *frame)
{
-#ifdef PC_REGNUM
if (PC_REGNUM >= 0)
return value_of_register (PC_REGNUM, frame);
-#endif
- {
- struct value *val = allocate_value (builtin_type_void_data_ptr);
- char *buf = VALUE_CONTENTS_RAW (val);
- if (frame == NULL)
- memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
- else
- ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
- get_frame_pc (frame));
- return val;
- }
+ else
+ {
+ struct value *val = allocate_value (builtin_type_void_data_ptr);
+ char *buf = VALUE_CONTENTS_RAW (val);
+ if (frame == NULL)
+ memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
+ else
+ ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
+ get_frame_pc (frame));
+ return val;
+ }
}
static struct value *
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 70eb125c1ba..636b1d9c1ba 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -987,9 +987,9 @@ maintenance_print_objfiles (char *ignore, int from_tty)
}
-/* List all the symbol tables. */
+/* List all the symbol tables whose names match REGEXP (optional). */
void
-maintenance_list_symtabs (char *regexp, int from_tty)
+maintenance_info_symtabs (char *regexp, int from_tty)
{
struct objfile *objfile;
@@ -1036,9 +1036,9 @@ maintenance_list_symtabs (char *regexp, int from_tty)
}
-/* List all the partial symbol tables. */
+/* List all the partial symbol tables whose names match REGEXP (optional). */
void
-maintenance_list_psymtabs (char *regexp, int from_tty)
+maintenance_info_psymtabs (char *regexp, int from_tty)
{
struct objfile *objfile;
diff --git a/gdb/symtab.c b/gdb/symtab.c
index e144197d606..2c46f9d6751 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -40,6 +40,7 @@
#include "linespec.h"
#include "source.h"
#include "filenames.h" /* for FILENAME_CMP */
+#include "objc-lang.h"
#include "hashtab.h"
@@ -459,6 +460,18 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol,
if (gsymbol->language == language_unknown)
gsymbol->language = language_auto;
+
+ if (gsymbol->language == language_objc
+ || gsymbol->language == language_auto)
+ {
+ demangled =
+ objc_demangle (mangled, 0);
+ if (demangled != NULL)
+ {
+ gsymbol->language = language_objc;
+ return demangled;
+ }
+ }
if (gsymbol->language == language_cplus
|| gsymbol->language == language_auto)
{
@@ -607,7 +620,8 @@ symbol_init_demangled_name (struct general_symbol_info *gsymbol,
demangled = symbol_find_demangled_name (gsymbol, mangled);
if (gsymbol->language == language_cplus
- || gsymbol->language == language_java)
+ || gsymbol->language == language_java
+ || gsymbol->language == language_objc)
{
if (demangled)
{
@@ -993,7 +1007,7 @@ lookup_symbol_aux (const char *name, const char *mangled_name,
}
#endif /* 0 */
- /* C++: If requested to do so by the caller,
+ /* C++/Java/Objective-C: If requested to do so by the caller,
check to see if NAME is a field of `this'. */
if (is_a_field_of_this)
{
@@ -1653,9 +1667,9 @@ find_main_psymtab (void)
for now we don't worry about the slight inefficiency of looking for
a match we'll never find, since it will go pretty quick. Once the
binary search terminates, we drop through and do a straight linear
- search on the symbols. Each symbol which is marked as being a C++
- symbol (language_cplus set) has both the encoded and non-encoded names
- tested for a match.
+ search on the symbols. Each symbol which is marked as being a ObjC/C++
+ symbol (language_cplus or language_objc set) has both the encoded and
+ non-encoded names tested for a match.
If MANGLED_NAME is non-NULL, verify that any symbol we find has this
particular mangled name.
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 05275363936..4330b962257 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1233,9 +1233,9 @@ void maintenance_print_msymbols (char *, int);
void maintenance_print_objfiles (char *, int);
-void maintenance_list_symtabs (char *, int);
+void maintenance_info_symtabs (char *, int);
-void maintenance_list_psymtabs (char *, int);
+void maintenance_info_psymtabs (char *, int);
void maintenance_check_symtabs (char *, int);
diff --git a/gdb/target.c b/gdb/target.c
index 4de246cc174..fd0165a19ba 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1215,7 +1215,7 @@ find_default_create_inferior (char *exec_file, char *allargs, char **env)
static int
default_region_size_ok_for_hw_watchpoint (int byte_count)
{
- return (byte_count <= REGISTER_SIZE);
+ return (byte_count <= DEPRECATED_REGISTER_SIZE);
}
static int
@@ -1640,7 +1640,7 @@ debug_print_register (const char * func, int regno)
if (regno >= 0)
{
int i;
- unsigned char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ unsigned char buf[MAX_REGISTER_SIZE];
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 b3f43fce577..e757b6701d9 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -836,15 +836,15 @@ extern void target_load (char *arg, int from_tty);
#define target_async(CALLBACK,CONTEXT) \
(current_target.to_async((CALLBACK), (CONTEXT)))
-/* This is to be used ONLY within run_stack_dummy(). It
- provides a workaround, to have inferior function calls done in
- sychronous mode, even though the target is asynchronous. After
+/* This is to be used ONLY within call_function_by_hand(). It provides
+ a workaround, to have inferior function calls done in sychronous
+ mode, even though the target is asynchronous. After
target_async_mask(0) is called, calls to target_can_async_p() will
return FALSE , so that target_resume() will not try to start the
target asynchronously. After the inferior stops, we IMMEDIATELY
restore the previous nature of the target, by calling
target_async_mask(1). After that, target_can_async_p() will return
- TRUE. ANY OTHER USE OF THIS FEATURE IS DEPRECATED.
+ TRUE. ANY OTHER USE OF THIS FEATURE IS DEPRECATED.
FIXME ezannoni 1999-12-13: we won't need this once we move
the turning async on and off to the single execution commands,
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 7ace1507cf4..22ac56a3c1c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,56 @@
+2003-05-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * gdb.threads/schedlock.exp: Remove assumption that all threads
+ will run in a particular small time slice. Also ensure we break
+ in one of the child threads rather than the main thread.
+
+2003-05-07 Jim Blandy <jimb@redhat.com>
+
+ Add support for assembly source testing on the s390x.
+ * gdb.asm/asm-source.exp: Add a case for the s390x-*-*
+ architecture.
+ * gdb.asm/s390x.inc: New file.
+
+ * gdb.asm/asm-source.exp: Use a 'switch -glob' statement, not a
+ succession of 'if' statements.
+
+2003-05-05 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.base/maint.exp: Add tests for "maint print dummy-frames".
+
+2003-05-05 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.base/watchpoint.exp: Rename CALL_DUMMY_BREAKPOINT_OFFSET to
+ DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET in comments.
+
+2003-05-02 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.base/charset.exp: Update based on new behavior of set/show
+ charset commands.
+
+2003-05-01 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.asm/asm-source.exp: Check that "disassm" and "x/i" of a
+ variable do not give memory errors.
+
+2003-04-30 Adam Fedor <fedor@gnu.org>
+
+ * Makefile.in (ALL_SUBDIRS): Add gdb.objc
+ * configure.in (AC_OUTPUT): Add gdb.objc/Makefile
+ * gdb.objc/Makefile.in, gdb.objc/basicclass.exp,
+ gdb.objc/basicclass.m: : New files
+
+ * lib/gdb.exp (gdb_compile_objc): New procedure.
+
+2003-04-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/signals.exp: Make backtrace tests more specific.
+
+2003-04-23 David Carlton <carlton@bactrian.org>
+
+ * gdb.c++/maint.exp (test_first_component): Add tests for
+ 'operator' in more locations.
+
2003-04-16 Kevin Buettner <kevinb@redhat.com>
* gdb.base/args.exp: Invoke gdb_load for simulator targets.
diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
index c0ba9ab79c2..898e6ed28b4 100644
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -36,7 +36,7 @@ EXEEXT = @EXEEXT@
SUBDIRS = @subdirs@
RPATH_ENVVAR = @RPATH_ENVVAR@
ALL_SUBDIRS = gdb.arch gdb.asm gdb.base gdb.c++ gdb.disasm gdb.java gdb.mi \
- gdb.threads gdb.trace $(SUBDIRS)
+ gdb.objc gdb.threads gdb.trace $(SUBDIRS)
EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
echo $${rootme}/../../expect/expect ; \
diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure
index 2a2494e886a..31e3a079f95 100755
--- a/gdb/testsuite/configure
+++ b/gdb/testsuite/configure
@@ -34,7 +34,6 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
-sitefile=
srcdir=
target=NONE
verbose=
@@ -149,7 +148,6 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
- --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -320,11 +318,6 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
- -site-file | --site-file | --site-fil | --site-fi | --site-f)
- ac_prev=sitefile ;;
- -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
- sitefile="$ac_optarg" ;;
-
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -490,16 +483,12 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
- if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-else
- CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -560,7 +549,7 @@ ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:564: checking build system type" >&5
+echo "configure:553: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -584,7 +573,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:588: checking host system type" >&5
+echo "configure:577: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -605,7 +594,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:609: checking target system type" >&5
+echo "configure:598: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -720,7 +709,7 @@ fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:724: checking how to run the C preprocessor" >&5
+echo "configure:713: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -735,13 +724,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 739 "configure"
+#line 728 "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:745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:734: \"$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
:
@@ -752,13 +741,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 756 "configure"
+#line 745 "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:762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:751: \"$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
:
@@ -769,13 +758,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 773 "configure"
+#line 762 "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:779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:768: \"$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
:
@@ -803,17 +792,17 @@ for ac_hdr in pthread.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:807: checking for $ac_hdr" >&5
+echo "configure:796: 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 812 "configure"
+#line 801 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:806: \"$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*
@@ -841,12 +830,12 @@ done
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:845: checking for Cygwin environment" >&5
+echo "configure:834: 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 850 "configure"
+#line 839 "configure"
#include "confdefs.h"
int main() {
@@ -857,7 +846,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -874,19 +863,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:878: checking for mingw32 environment" >&5
+echo "configure:867: 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 883 "configure"
+#line 872 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:879: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -905,7 +894,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:909: checking for executable suffix" >&5
+echo "configure:898: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -915,10 +904,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;;
+ *.c | *.o | *.obj) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -1040,7 +1029,7 @@ ac_given_srcdir=$srcdir
trap 'rm -fr `echo "Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
gdb.c++/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \
- gdb.threads/Makefile gdb.trace/Makefile config.h:config.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+ gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile config.h:config.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -1134,7 +1123,7 @@ cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
gdb.c++/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \
- gdb.threads/Makefile gdb.trace/Makefile"}
+ gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
diff --git a/gdb/testsuite/configure.in b/gdb/testsuite/configure.in
index 8ba930f1600..f80b623cd36 100644
--- a/gdb/testsuite/configure.in
+++ b/gdb/testsuite/configure.in
@@ -115,4 +115,4 @@ AC_EXEEXT
AC_CONFIG_SUBDIRS($configdirs)
AC_OUTPUT([Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
gdb.c++/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \
- gdb.threads/Makefile gdb.trace/Makefile])
+ gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile])
diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
index ac1bcd28fe0..e4aa7be4fd9 100644
--- a/gdb/testsuite/gdb.asm/asm-source.exp
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -35,60 +35,66 @@ set asm-arch ""
set asm-flags ""
set link-flags ""
-if [istarget "*arm-*-*"] then {
- set asm-arch arm
-}
-if [istarget "xscale-*-*"] then {
- set asm-arch arm
-}
-if [istarget "d10v-*-*"] then {
- set asm-arch d10v
-}
-if [istarget "s390-*-*"] then {
- set asm-arch s390
-}
-if [istarget "x86_64-*-*"] then {
- set asm-arch x86_64
- set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
-}
-if [istarget "i\[3456\]86-*-*"] then {
- set asm-arch i386
- if [istarget "*-*-cygwin*"] then {
- set link-flags "--entry _start"
+switch -glob -- [istarget] {
+ "*arm-*-*" {
+ set asm-arch arm
+ }
+ "xscale-*-*" {
+ set asm-arch arm
+ }
+ "d10v-*-*" {
+ set asm-arch d10v
+ }
+ "s390-*-*" {
+ set asm-arch s390
+ }
+ "s390x-*-*" {
+ set asm-arch s390x
+ }
+ "x86_64-*-*" {
+ set asm-arch x86_64
+ set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ }
+ "i\[3456\]86-*-*" {
+ set asm-arch i386
+ if [istarget "*-*-cygwin*"] then {
+ set link-flags "--entry _start"
+ }
+ }
+ "m32r*-*" {
+ set asm-arch m32r
+ }
+ "m6811-*-*" {
+ set asm-arch m68hc11
+ set asm-flags "-mshort-double -m68hc11 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ }
+ "m6812-*-*" {
+ set asm-arch m68hc11
+ set asm-flags "-mshort-double -m68hc12 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ }
+ "mips*-*" {
+ set asm-arch mips
+ }
+ "powerpc*-*" {
+ set asm-arch powerpc
+ }
+ "sparc-*-*" {
+ set asm-arch sparc
+ }
+ "sparc64-*-*" {
+ set asm-arch sparc64
+ set asm-flags "-xarch=v9 -gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ }
+ "xstormy16-*-*" {
+ set asm-arch xstormy16
+ set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ }
+ "v850-*-*" {
+ set asm-arch v850
+ set gdb_wrapper_initialized 1
}
}
-if [istarget "m32r*-*"] then {
- set asm-arch m32r
-}
-if [istarget "m6811-*-*"] then {
- set asm-arch m68hc11
- set asm-flags "-mshort-double -m68hc11 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
-}
-if [istarget "m6812-*-*"] then {
- set asm-arch m68hc11
- set asm-flags "-mshort-double -m68hc12 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
-}
-if [istarget "mips*-*"] then {
- set asm-arch mips
-}
-if [istarget "powerpc*-*"] then {
- set asm-arch powerpc
-}
-if [istarget "sparc-*-*"] then {
- set asm-arch sparc
-}
-if [istarget "sparc64-*-*"] then {
- set asm-arch sparc64
- set asm-flags "-xarch=v9 -gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
-}
-if [istarget "xstormy16-*-*"] then {
- set asm-arch xstormy16
- set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
-}
-if [istarget "v850-*-*"] then {
- set asm-arch v850
- set gdb_wrapper_initialized 1
-}
+
if { "${asm-arch}" == "" } {
gdb_suppress_entire_file "Assembly source test -- not implemented for this target."
}
@@ -293,11 +299,35 @@ gdb_test "next" "17\[ \t\]+gdbasm_leave" "next over foo3"
gdb_test "return" "\#0 main .*37\[ \t\]+gdbasm_exit0" "return from foo2" \
"Make (foo2|selected stack frame) return now\?.*" "y"
-# See if we can look at a global variable
+# Disassemble something, check the output
+proc test_dis { command var } {
+ global gdb_prompt
+ send_gdb "${command}\n"
+ gdb_expect {
+ -re "${var}.*:.*Cannot access" {
+ # The "disassembler" was only accessing the local
+ # executable and that would cause attempts to disassemble
+ # variables to fail (memory not valid).
+ fail "${command} (memory read error)"
+ }
+ -re "${var}.*:.*${gdb_prompt}" {
+ pass "${command}"
+ }
+ timeout {
+ fail "${command} (timeout)"
+ }
+ }
+}
+
+# See if we can look at a global variable, three ways
gdb_test "print globalvar" ".* = 11" "look at global variable"
+test_dis "x/i globalvar" "globalvar"
+test_dis "disassem &globalvar &globalvar+1" "globalvar"
-# See if we can look at a static variable
+# See if we can look at a static variable, three ways
gdb_test "print staticvar" ".* = 5" "look at static variable"
+test_dis "x/i &staticvar" "staticvar"
+test_dis "disassem &staticvar &staticvar+1" "staticvar"
# See if we can look at a static function
gdb_test "disassem foostatic" ".*<foostatic\\+0>:.*End of assembler dump." \
diff --git a/gdb/testsuite/gdb.asm/s390x.inc b/gdb/testsuite/gdb.asm/s390x.inc
new file mode 100644
index 00000000000..4e5bf2ea65d
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/s390x.inc
@@ -0,0 +1,68 @@
+### entry point code
+ .macro gdbasm_startup
+
+ # Align the stack pointer to an 8-byte boundary.
+ lghi %r0,-16
+ ngr %r15,%r0
+
+ # Reserve space for the standard stack frame:
+ # back chain, and space for the callee to save its registers.
+ aghi %r15,-168
+
+ # Zero this frame's back chain pointer.
+ xc 0(8,%r15),0(%r15)
+ .endm
+
+
+### Call a function.
+ .macro gdbasm_call subr
+ brasl %r14, \subr
+ .endm
+
+
+### Exit with a zero status.
+ .macro gdbasm_exit0
+ lghi %r2, 0
+ svc 1
+ .endm
+
+### Standard subroutine prologue.
+ .macro gdbasm_enter
+
+ # Save all the callee-saves registers. What the heck.
+ stmg %r6,%r15,48(%r15)
+
+ # Allocate the stack frame, and write the back chain pointer.
+ # Keep the original SP in %r11.
+ lgr %r11,%r15
+ aghi %r15,-168
+ stg %r11,0(%r15)
+ .endm
+
+
+### Standard subroutine epilogue.
+ .macro gdbasm_leave
+
+ # Restore all our registers. This also pops the frame, and
+ # restores our return address.
+ lmg %r6,%r15,216(%r15)
+
+ # Jump to the return address.
+ br %r14
+
+ .endm
+
+### Several nops.
+ .macro gdbasm_several_nops
+ lr %r0, %r0
+ lr %r0, %r0
+ lr %r0, %r0
+ lr %r0, %r0
+ .endm
+
+### Declare an `int' variable.
+ .macro gdbasm_datavar name value
+ .data
+\name:
+ .long \value
+ .endm
diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
index 8e765aa3a95..e17bb14bbce 100644
--- a/gdb/testsuite/gdb.base/charset.exp
+++ b/gdb/testsuite/gdb.base/charset.exp
@@ -48,11 +48,23 @@ proc parse_show_charset_output {testname} {
-re "The current host and target character set is `(.*)'\\.\[\r\n\]+$gdb_prompt $" {
set host_charset $expect_out(1,string)
set target_charset $expect_out(1,string)
+ set retlist [list $host_charset $target_charset]
pass $testname
}
-re "The current host character set is `(.*)'\\.\[\r\n\]+The current target character set is `(.*)'\\.\[\r\n\]+$gdb_prompt $" {
set host_charset $expect_out(1,string)
set target_charset $expect_out(2,string)
+ set retlist [list $host_charset $target_charset]
+ pass $testname
+ }
+ -re "The host character set is \"(.*)\"\\.\[\r\n\]+$gdb_prompt $" {
+ set host_charset $expect_out(1,string)
+ set retlist [list $host_charset]
+ pass $testname
+ }
+ -re "The target character set is \"(.*)\"\\.\[\r\n\]+$gdb_prompt $" {
+ set target_charset $expect_out(1,string)
+ set retlist [list $target_charset]
pass $testname
}
-re ".*$gdb_prompt $" {
@@ -63,7 +75,7 @@ proc parse_show_charset_output {testname} {
}
}
- return [list $host_charset $target_charset]
+ return $retlist
}
@@ -77,7 +89,7 @@ set show_charset [parse_show_charset_output "show charset"]
send_gdb "show target-charset\n"
set show_target_charset [parse_show_charset_output "show target-charset"]
-if {! [string compare $show_charset $show_target_charset]} {
+if {[lsearch $show_charset $show_target_charset] >= 0} {
pass "check `show target-charset' against `show charset'"
} else {
fail "check `show target-charset' against `show charset'"
@@ -86,21 +98,71 @@ if {! [string compare $show_charset $show_target_charset]} {
send_gdb "show host-charset\n"
set show_host_charset [parse_show_charset_output "show host-charset"]
-if {! [string compare $show_charset $show_host_charset]} {
+if {[lsearch $show_charset $show_host_charset] >= 0} {
pass "check `show host-charset' against `show charset'"
} else {
fail "check `show host-charset' against `show charset'"
}
-# Get the list of supported charsets.
-send_gdb "set charset\n"
+# Get the list of supported (host) charsets as possible completions.
+send_gdb "set charset \t\t"
-# True iff we've seen the "Valid character sets are:" message.
-set seen_valid 0
+# Check that we can at least use ASCII as a host character set.
+sleep 1
+gdb_expect {
+ -re "^set charset .*\r\nASCII.*\r\n$gdb_prompt set charset " {
+ # We got the output that we wanted, including ASCII as possible
+ # charset. Send a newline to get us back to the prompt. This will
+ # also generate an error message. Let's not check here that the error
+ # message makes sense, we do that below, as a separate testcase.
+ send_gdb "\n"
+ gdb_expect {
+ -re ".*Requires an argument.*$gdb_prompt $" {
+ pass "get valid character sets"
+ }
+ -re ".*$gdb_prompt $" {
+ send_gdb "\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ fail "get valid character sets"
+ }
+ }
+ }
+ timeout {
+ fail "(timeout) get valid character sets"
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ # We got some output that ended with a regular prompt
+ fail "get valid character sets"
+ }
+ -re "^set charset.*$" {
+ # We got some other output, send a cntrl-c to gdb to get us back
+ # to the prompt.
+ send_gdb "\003"
+ fail "get valid character sets"
+ }
+ timeout {
+ fail "get valid character sets (timeout)"
+ }
+}
+
+# Try a malformed `set charset'.
+gdb_test "set charset" \
+ "Requires an argument. Valid arguments are.*" \
+ "try malformed `set charset'"
+
+# Try using `set host-charset' on an invalid character set.
+gdb_test "set host-charset my_grandma_bonnie" \
+ "Undefined item: \"my_grandma_bonnie\"." \
+ "try `set host-charset' with invalid charset"
-# True iff we've seen the "can be used as a host character set" message.
-set seen_can_host 0
+# Try using `set target-charset' on an invalid character set.
+gdb_test "set target-charset my_grandma_bonnie" \
+ "Undefined item: \"my_grandma_bonnie\"." \
+ "try `set target-charset' with invalid charset"
# A Tcl array mapping the names of all the character sets we've seen
# to "1" if the character set can be used as a host character set, or
@@ -113,73 +175,73 @@ proc all_charset_names {} {
return [array names charsets]
}
-proc charset_exists {charset} {
- global charsets
- return [info exists charsets($charset)]
-}
-
proc valid_host_charset {charset} {
global charsets
return $charsets($charset)
}
+send_gdb "set host-charset\n"
gdb_expect {
- -re "Valid character sets are:\[\r\n\]+" {
- # There's no ^ at the beginning of the pattern above, so that
- # expect can skip the echoed `set charset' command.
- set seen_valid 1
- exp_continue
+ -re "Requires an argument. Valid arguments are (\[^ \t\n\r,.\]*)" {
+ #set host_charset_list $expect_out(1,string)
+ set charsets($expect_out(1,string)) 1
+ exp_continue
+ #pass "capture valid host charsets"
}
- -re "^ (\[^ \t\n\]*) \\*\[\r\n\]+" {
- set charsets($expect_out(1,string)) 1
- exp_continue
- }
- -re "^ (\[^ \t\n\]*)\[ \t\]*\[\r\n\]+" {
- set charsets($expect_out(1,string)) 0
- exp_continue
+
+ -re ", (\[^ \t\n\r,.\]*)" {
+ #set host_charset_list $expect_out(1,string)
+ set charsets($expect_out(1,string)) 1
+ exp_continue
+ #pass "capture valid host charsets"
}
- -re "^\\* - can be used as a host character set\[\r\n\]+" {
- set seen_can_host 1
- exp_continue
+
+ -re "\\.\r\n$gdb_prompt $" {
+ #set host_charset_list $expect_out(1,string)
+ set charsets($expect_out(1,string)) 1
+ pass "capture valid host charsets"
}
- -re ".*${gdb_prompt} $" {
- # We don't do an exp_continue here.
+
+ -re ".*$gdb_prompt $" {
+ fail "capture valid host charsets"
}
timeout {
- fail "get valid character sets (timeout)"
+ fail "(timeout) capture valid host charsets"
}
}
-# Check that we've seen all the right pieces of the output, and that
-# we can at least use ASCII as a host character set.
-if {$seen_valid && $seen_can_host && [charset_exists ascii]} {
- # We can't do the below as part of the test above, since all the
- # [] substitution takes place before any expression evaluation
- # takes place; && doesn't really short circuit things the way
- # you'd like. We'd get an "can't read $charsets(ascii)" error
- # even when `info exists' had returned zero.
- if {[valid_host_charset ascii]} {
- pass "get valid character sets"
- } else {
- fail "get valid character sets"
+send_gdb "set target-charset\n"
+gdb_expect {
+ -re "Requires an argument. Valid arguments are (\[^ \t\n\r,.\]*)" {
+ set target_charset $expect_out(1,string)
+ if {! [info exists charsets($target_charset)]} {
+ set charsets($target_charset) 0
+ }
+ exp_continue
}
-} else {
- fail "get valid character sets (no ascii charset)"
-}
+ -re ", (\[^ \t\n\r,.\]*)" {
+ set target_charset $expect_out(1,string)
+ if {! [info exists charsets($target_charset)]} {
+ set charsets($target_charset) 0
+ }
+ exp_continue
+ }
-# Try using `set host-charset' on an invalid character set.
-gdb_test "set host-charset my_grandma_bonnie" \
- "GDB doesn't know of any character set named `my_grandma_bonnie'." \
- "try `set host-charset' with invalid charset"
+ -re "\\.\r\n$gdb_prompt $" {
+ pass "capture valid target charsets"
+ }
-# Try using `set target-charset' on an invalid character set.
-gdb_test "set target-charset my_grandma_bonnie" \
- "GDB doesn't know of any character set named `my_grandma_bonnie'." \
- "try `set target-charset' with invalid charset"
+ -re ".*$gdb_prompt $" {
+ fail "capture valid target charsets"
+ }
+ timeout {
+ fail "(timeout) capture valid target charsets"
+ }
+}
# Make sure that GDB supports every host/target charset combination.
foreach host_charset [all_charset_names] {
@@ -341,7 +403,7 @@ gdb_expect {
}
-gdb_test "set host-charset ascii" ""
+gdb_test "set host-charset ASCII" ""
foreach target_charset [all_charset_names] {
send_gdb "set target-charset $target_charset\n"
gdb_expect {
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index d8286508699..f82bf0202b0 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -35,6 +35,7 @@
#maintenance info -- Commands for showing internal info about the program being debugged
#maintenance internal-error -- Give GDB an internal error.
#
+#maintenance print dummy-frames -- Print the dummy frame stack
#maintenance print statistics -- Print statistics about internal gdb state
#maintenance print objfiles -- Print dump of current object file definitions
#maintenance print psymbols -- Print dump of current partial symbol definitions
@@ -186,6 +187,9 @@ gdb_expect {
timeout { fail "(timeout) maint print statistics" }
}
+# There aren't any ...
+gdb_test "maint print dummy-frames" ""
+
send_gdb "maint print objfiles\n"
# To avoid timeouts, we avoid expects with many .* patterns that match
@@ -524,6 +528,9 @@ gdb_expect {
timeout { fail "(timeout) help maint print statistics" }
}
+gdb_test "help maint print dummy-frames" \
+ "Print the contents of the internal dummy-frame stack."
+
send_gdb "help maint print objfiles\n"
gdb_expect {
-re "Print dump of current object file definitions\\..*$gdb_prompt $"\
diff --git a/gdb/testsuite/gdb.base/signals.exp b/gdb/testsuite/gdb.base/signals.exp
index 2bf719234bd..be974550e21 100644
--- a/gdb/testsuite/gdb.base/signals.exp
+++ b/gdb/testsuite/gdb.base/signals.exp
@@ -1,4 +1,4 @@
-# Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+# Copyright 1997, 1998, 1999, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -185,7 +185,7 @@ proc signal_tests_1 {} {
# #2, #3, or higher. At some point this should be fixed (but
# it quite possibly would introduce new FAILs on some systems).
setup_xfail "i*86-*-bsdi2.0"
- gdb_test "backtrace 10" "#0.*handler.*#1.*#2.*main.*" \
+ gdb_test "backtrace 10" "#0.*handler.*#1.*signal handler.*#2.* main .*" \
"backtrace in signals_tests_1"
gdb_test "break func1" "Breakpoint \[0-9\]+ .*"
@@ -415,7 +415,7 @@ The program being debugged stopped while in a function called from GDB.*" \
# But we should be able to backtrace...
# On alpha-*-osf2.0 this test works when run manually but sometime fails when
# run under dejagnu, making it very hard to debug the problem. Weird...
- gdb_test "bt 10" "#0.*handler.*#1.*#2.*main.*" "bt in signals.exp"
+ gdb_test "bt 10" "#0.*handler.*#1.*signal handler.*#2.* main .*" "bt in signals.exp"
# ...and continue...
gdb_test "continue" "Continuing\\." "continue in signals.exp"
# ...and then count should have been incremented
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp
index c5e37d451a5..fd5d8f286b2 100644
--- a/gdb/testsuite/gdb.base/watchpoint.exp
+++ b/gdb/testsuite/gdb.base/watchpoint.exp
@@ -377,7 +377,7 @@ proc test_stepping {} {
# The problem is that GDB confuses stepping through the call
# dummy with hitting the breakpoint at the end of the call dummy.
# Will be fixed once all architectures define
- # CALL_DUMMY_BREAKPOINT_OFFSET.
+ # DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET.
setup_xfail "*-*-*"
# This doesn't occur if the call dummy starts with a call,
# because we are out of the dummy by the first time the inferior
@@ -388,7 +388,7 @@ proc test_stepping {} {
clear_xfail "m68*-*-*"
clear_xfail "i*86*-*-*"
clear_xfail "vax-*-*"
- # The following architectures define CALL_DUMMY_BREAKPOINT_OFFSET.
+ # The following architectures define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET.
clear_xfail "alpha-*-*"
clear_xfail "mips*-*-*"
clear_xfail "sparc-*-*"
diff --git a/gdb/testsuite/gdb.c++/maint.exp b/gdb/testsuite/gdb.c++/maint.exp
index 6e1da97bd52..a0f15f96bc5 100644
--- a/gdb/testsuite/gdb.c++/maint.exp
+++ b/gdb/testsuite/gdb.c++/maint.exp
@@ -63,6 +63,18 @@ proc test_first_component {} {
test_single_component "foo(std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >)"
test_single_component "operator>(X::Y)"
+ # Operator names can show up in weird places.
+
+ test_single_component "int operator<< <char>()"
+ test_single_component "T<Cooperator>"
+
+ # NOTE: carlton/2003-04-23: I've only seen the first of these
+ # produced by the demangler, but I'm including two more just to be
+ # on the safe side.
+ test_single_component "int foo<&(operator<<(C, C))>()"
+ test_single_component "int foo<&operator<<(C, C)>()"
+ test_single_component "int foo<operator<<(C, C)>()"
+
gdb_test "maint cp first_component foo::bar" "foo"
gdb_test "maint cp first_component foo::bar::baz" "foo"
gdb_test "maint cp first_component C<A>::bar" "C<A>"
diff --git a/gdb/testsuite/gdb.mi/ChangeLog b/gdb/testsuite/gdb.mi/ChangeLog
index d2aae785bb4..e4aec350f68 100644
--- a/gdb/testsuite/gdb.mi/ChangeLog
+++ b/gdb/testsuite/gdb.mi/ChangeLog
@@ -1,3 +1,9 @@
+2003-05-03 J. Brobecker <brobecker@gnat.com>
+
+ From Thierry Schneider <tpschneider1@yahoo.com>:
+ * mi1-symbol.exp (-symbol-list-lines): New test file to
+ validate all symbol-related commands
+
2003-04-08 Andrew Cagney <cagney@redhat.com>
* gdb792.exp: Skip when C++.
diff --git a/gdb/testsuite/gdb.mi/mi1-symbol.exp b/gdb/testsuite/gdb.mi/mi1-symbol.exp
new file mode 100644
index 00000000000..f0da1975b0c
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi1-symbol.exp
@@ -0,0 +1,61 @@
+# Copyright 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 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
+
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi1"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_run_to_main
+
+proc test_list_lines {} {
+ global mi_gdb_prompt
+ global hex
+ global decimal
+ global srcfile
+
+ # Test list-lines.
+ # Tests:
+ # -symbol-list-lines ${srcfile}
+
+ mi_gdb_test "-symbol-list-lines ${srcfile}" \
+ "\\^done,lines=\[\{pc=\"$hex\",line=\"$decimal\"\}.*\]" \
+ "symbol-list-lines for source file ${srcfile}"
+
+}
+
+test_list_lines
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.objc/Makefile.in b/gdb/testsuite/gdb.objc/Makefile.in
new file mode 100644
index 00000000000..381e48a0789
--- /dev/null
+++ b/gdb/testsuite/gdb.objc/Makefile.in
@@ -0,0 +1,22 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = basicclass
+
+all:
+ @echo "Nothing to be done for all..."
+
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
+
+clean mostlyclean:
+ -rm -f *~ *.o *.ci
+ -rm -f core ${EXECUTABLES}
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
diff --git a/gdb/testsuite/gdb.objc/basicclass.exp b/gdb/testsuite/gdb.objc/basicclass.exp
new file mode 100644
index 00000000000..44b709e3e27
--- /dev/null
+++ b/gdb/testsuite/gdb.objc/basicclass.exp
@@ -0,0 +1,199 @@
+# Copyright 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was written by Adam Fedor (fedor@gnu.org)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set testfile "basicclass"
+set srcfile ${testfile}.m
+set binfile ${objdir}/${subdir}/${testfile}
+
+#
+# Objective-C program compilation isn't standard. We need to figure out
+# which libraries to link in. Most of the time it uses pthread
+#
+if {[gdb_compile_objc "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+#
+# Deduce language of main()
+#
+
+proc deduce_language_of_main {} {
+ global gdb_prompt
+
+ # See what language gdb thinks main() is, prior to reading full symbols.
+ # I think this fails for COFF targets.
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"auto; currently objective-c\".*$gdb_prompt $" {
+ pass "deduced language is Objective-C, before full symbols"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "source language not correct for Objective-C (psymtabs only)"
+ return
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return
+ }
+ }
+
+ runto_main
+
+ # See if our idea of the language has changed.
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"auto; currently objective-c\".*$gdb_prompt $" {
+ pass "deduced language is Objective-C, after full symbols"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "source language not correct for Objective-C (full symbols)"
+ return
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return
+ }
+ }
+}
+
+proc do_objc_tests {} {
+ global prms_id
+ global bug_id
+ global subdir
+ global objdir
+ global srcdir
+ global binfile
+ global gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ deduce_language_of_main
+}
+
+do_objc_tests
+
+#
+# Breakpoint tests
+#
+gdb_test "break doIt" \
+ "Breakpoint.*at.* file .*$srcfile, line.29.*" \
+ "breakpoint method"
+
+gdb_test "break takeArg:" \
+ "Breakpoint.*at.* file .*$srcfile, line.34.*" \
+ "breakpoint method with colon"
+
+gdb_test "break newWithArg:" \
+ "Breakpoint.*at.* file .*$srcfile, line.22.*" \
+ "breakpoint class method with colon"
+
+#
+# Continue until breakpoint (test re-setting breakpoint)
+#
+gdb_test continue \
+ "Continuing\\..*Breakpoint \[0-9\]+, -.BasicClass takeArg:. \\(self=.*, _cmd=.*, arg=.*\\) at .*$srcfile:34.*" \
+ "continue until method breakpoint"
+
+#
+# Test resetting breakpoints when re-running program
+#
+send_gdb "run\n"
+gdb_expect {
+ -re "The program .* has been started already.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:.*$gdb_prompt $"\
+ { pass "resetting breakpoints when rerunning" }
+ -re ".*$gdb_prompt $" { fail "resetting breakpoints when rerunning" }
+ timeout { fail "resetting breakpoints when rerunning" }
+}
+
+#
+# Continue until breakpoint (test re-setting breakpoint)
+#
+gdb_test continue \
+ "Continuing\\..*Breakpoint \[0-9\]+, -.BasicClass takeArg:. \\(self=.*, _cmd=.*, arg=.*\\) at .*$srcfile:34.*" \
+ "continue until method breakpoint"
+
+#
+# Test printing objects
+#
+gdb_test "print object" \
+ "\\$\[0-9\] = .*0x0" \
+ " print an ivar of self"
+
+gdb_test "print self" \
+ "\\$\[0-9\] = \\(.*BasicClass \\*\\) 0x\[0-9a-f\]+" \
+ " print self"
+
+gdb_test "print \*self" \
+ "\\$\[0-9\] = \{isa = 0x\[0-9a-f\]+, object = 0x0\}" \
+ " print contents of self"
+
+#
+# Break in a category
+#
+gdb_test "break hiddenMethod" \
+ "Breakpoint.*at.* file .*$srcfile, line.61." \
+ "breakpoint in category method"
+
+
+#
+# Continue until breakpoint (test re-setting category breakpoint)
+#
+gdb_test continue \
+ "Continuing\\..*Breakpoint \[0-9\]+, -.BasicClass\\(Private\\) hiddenMethod. \\(self=.*, _cmd=.*\\) at .*$srcfile:61.*" \
+ "continue until category method"
+
+#
+# Test calling Objective-C methods
+#
+gdb_test "print \[self printHi\]" \
+ "Hi.*\\$\[0-9\] = \[0-9\]+" \
+ "Call an Objective-C method with no arguments"
+
+gdb_test "print \[self printNumber: 42\]" \
+ "42.*\\$\[0-9\] = 43" \
+ "Call an Objective-C method with one argument"
+
+#
+# Test printing the object description
+#
+gdb_test "print-object object" \
+ "BasicClass gdb test object" \
+ "Use of the print-object command"
+
+gdb_test "po self" \
+ "BasicClass gdb test object" \
+ "Use of the po (print-object) command"
+
+
diff --git a/gdb/testsuite/gdb.objc/basicclass.m b/gdb/testsuite/gdb.objc/basicclass.m
new file mode 100644
index 00000000000..0de12db25a1
--- /dev/null
+++ b/gdb/testsuite/gdb.objc/basicclass.m
@@ -0,0 +1,81 @@
+#include <objc/Object.h>
+
+@interface BasicClass: Object
+{
+ id object;
+}
++ newWithArg: arg;
+- doIt;
+- takeArg: arg;
+- printHi;
+- (int) printNumber: (int)number;
+- (const char *) myDescription;
+@end
+
+@interface BasicClass (Private)
+- hiddenMethod;
+@end
+
+@implementation BasicClass
++ newWithArg: arg
+{
+ id obj = [self new];
+ [obj takeArg: arg];
+ return obj;
+}
+
+- doIt
+{
+ return self;
+}
+
+- takeArg: arg
+{
+ object = arg;
+ [self hiddenMethod];
+ return self;
+}
+
+- printHi
+{
+ printf("Hi\n");
+ return self;
+}
+
+- (int) printNumber: (int)number
+{
+ printf("%d\n", number);
+ return number+1;
+}
+
+- (const char *) myDescription
+{
+ return "BasicClass gdb test object";
+}
+
+@end
+
+@implementation BasicClass (Private)
+- hiddenMethod
+{
+ return self;
+}
+@end
+
+int main (int argc, const char *argv[])
+{
+ id obj;
+ obj = [BasicClass new];
+ [obj takeArg: obj];
+ return 0;
+}
+
+const char *_NSPrintForDebugger(id object)
+{
+ /* This is not really what _NSPrintForDebugger should do, but it
+ is a simple test if gdb can call this function */
+ if (object && [object respondsTo: @selector(myDescription)])
+ return [object myDescription];
+
+ return NULL;
+}
diff --git a/gdb/testsuite/gdb.threads/schedlock.exp b/gdb/testsuite/gdb.threads/schedlock.exp
index 28298c684a9..44785808ce3 100644
--- a/gdb/testsuite/gdb.threads/schedlock.exp
+++ b/gdb/testsuite/gdb.threads/schedlock.exp
@@ -112,8 +112,8 @@ proc my_continue { msg } {
stop_process "stop all threads ($msg)"
- # Make sure we're in one of the looping threads.
- gdb_breakpoint [gdb_get_line_number "schedlock.exp: main loop"]
+ # Make sure we're in one of the non-main looping threads.
+ gdb_breakpoint [concat [gdb_get_line_number "schedlock.exp: main loop"] " if arg != 5"]
gdb_continue_to_breakpoint "return to loop ($msg)"
delete_breakpoints
}
@@ -230,12 +230,11 @@ if {$curthread == $newthread} {
set start_args $cont_args
set cont_args [get_args]
+set num_other_threads 0
for {set i 0} {[expr $i < 6]} {set i [expr $i + 1]} {
if {[lindex $start_args $i] == [lindex $cont_args $i]} {
if {$i == $curthread} {
fail "current thread stepped (didn't run)"
- } else {
- fail "other thread $i ran (didn't run) (1)"
}
} else {
if {$i == $curthread} {
@@ -245,10 +244,15 @@ for {set i 0} {[expr $i < 6]} {set i [expr $i + 1]} {
fail "current thread stepped (wrong amount)"
}
} else {
- pass "other thread $i ran (1)"
+ set num_other_threads [expr $num_other_threads + 1]
}
}
}
+if {$num_other_threads > 0} {
+ pass "other threads ran (1)"
+} else {
+ fail "other threads ran (no other threads ran) (1)"
+}
# Test continue with scheduler locking
gdb_test "set scheduler-locking on" ""
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 4dfbf76c950..a16b0fa7fec 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1283,6 +1283,46 @@ proc gdb_compile_pthreads {source dest type options} {
}
}
+# This is just like gdb_compile_pthreads, above, except that we always add the
+# objc library for compiling Objective-C programs
+proc gdb_compile_objc {source dest type options} {
+ set built_binfile 0
+ set why_msg "unrecognized error"
+ foreach lib {-lobjc -lpthreads -lpthread -lthread solaris} {
+ # This kind of wipes out whatever libs the caller may have
+ # set. Or maybe theirs will override ours. How infelicitous.
+ if { $lib == "solaris" } {
+ set lib "-lpthread -lposix4"
+ }
+ if { $lib != "-lobjc" } {
+ set lib "-lobjc $lib"
+ }
+ set options_with_lib [concat $options [list libs=$lib quiet]]
+ set ccout [gdb_compile $source $dest $type $options_with_lib]
+ switch -regexp -- $ccout {
+ ".*no posix threads support.*" {
+ set why_msg "missing threads include file"
+ break
+ }
+ ".*cannot open -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ ".*Can't find library for -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ {^$} {
+ pass "successfully compiled objc with posix threads test case"
+ set built_binfile 1
+ break
+ }
+ }
+ }
+ if {!$built_binfile} {
+ unsupported "Couldn't compile $source: ${why_msg}"
+ return -1
+ }
+}
+
proc send_gdb { string } {
global suppress_flag;
if { $suppress_flag } {
diff --git a/gdb/thread-db.c b/gdb/thread-db.c
index bac464151fa..0a6138b3afa 100644
--- a/gdb/thread-db.c
+++ b/gdb/thread-db.c
@@ -945,7 +945,7 @@ thread_db_store_registers (int regno)
if (regno != -1)
{
- char *raw = alloca (max_register_size (current_gdbarch));
+ char raw[MAX_REGISTER_SIZE];
deprecated_read_register_gen (regno, raw);
thread_db_fetch_registers (-1);
diff --git a/gdb/thread.c b/gdb/thread.c
index 53a2d4f49f4..315f33b1c4a 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -292,7 +292,6 @@ gdb_list_thread_ids (struct ui_out *uiout)
void
load_infrun_state (ptid_t ptid,
CORE_ADDR *prev_pc,
- char **prev_func_name,
int *trap_expected,
struct breakpoint **step_resume_breakpoint,
struct breakpoint **through_sigtramp_breakpoint,
@@ -316,7 +315,6 @@ load_infrun_state (ptid_t ptid,
return;
*prev_pc = tp->prev_pc;
- *prev_func_name = tp->prev_func_name;
*trap_expected = tp->trap_expected;
*step_resume_breakpoint = tp->step_resume_breakpoint;
*through_sigtramp_breakpoint = tp->through_sigtramp_breakpoint;
@@ -340,7 +338,6 @@ load_infrun_state (ptid_t ptid,
void
save_infrun_state (ptid_t ptid,
CORE_ADDR prev_pc,
- char *prev_func_name,
int trap_expected,
struct breakpoint *step_resume_breakpoint,
struct breakpoint *through_sigtramp_breakpoint,
@@ -364,7 +361,6 @@ save_infrun_state (ptid_t ptid,
return;
tp->prev_pc = prev_pc;
- tp->prev_func_name = prev_func_name;
tp->trap_expected = trap_expected;
tp->step_resume_breakpoint = step_resume_breakpoint;
tp->through_sigtramp_breakpoint = through_sigtramp_breakpoint;
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 855a5b23b42..17ee07c898d 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1115,7 +1115,7 @@ memrange_sortmerge (struct collection_list *memranges)
{
if (memranges->list[a].type == memranges->list[b].type &&
memranges->list[b].start - memranges->list[a].end <=
- MAX_REGISTER_VIRTUAL_SIZE)
+ MAX_REGISTER_SIZE)
{
/* memrange b starts before memrange a ends; merge them. */
if (memranges->list[b].end > memranges->list[a].end)
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index 7069f965796..f44f9aa9a48 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,3 +1,19 @@
+2003-05-08 Andrew Cagney <cagney@redhat.com>
+
+ * tuiRegs.c: Use MAX_REGISTER_SIZE instead of
+ MAX_REGISTER_RAW_SIZE.
+
+2003-05-03 Andrew Cagney <cagney@redhat.com>
+
+ * tuiDisassem.c (tui_disassemble): Call gdb_print_insn, instead of
+ TARGET_PRINT_INSN. Do not initialize a disassemble_info object.
+
+2003-04-30 Andrew Cagney <cagney@redhat.com>
+
+ * tuiDisassem.c (tui_disassemble): Use
+ "deprecated_tm_print_insn_info" instead of TARGET_PRINT_INSN_INFO,
+ add comment.
+
2003-03-14 Andrew Cagney <cagney@redhat.com>
* tuiRegs.c (_tuiGetRegisterRawValue): Use frame_read_register,
diff --git a/gdb/tui/tuiDisassem.c b/gdb/tui/tuiDisassem.c
index 93d2df42dc9..0ddf32c1b99 100644
--- a/gdb/tui/tuiDisassem.c
+++ b/gdb/tui/tuiDisassem.c
@@ -68,22 +68,10 @@ static CORE_ADDR
tui_disassemble (struct tui_asm_line* lines, CORE_ADDR pc, int count)
{
struct ui_file *gdb_dis_out;
- disassemble_info asm_info;
/* now init the ui_file structure */
gdb_dis_out = tui_sfileopen (256);
- memcpy (&asm_info, TARGET_PRINT_INSN_INFO, sizeof (asm_info));
- asm_info.stream = gdb_dis_out;
-
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- asm_info.endian = BFD_ENDIAN_BIG;
- else
- asm_info.endian = BFD_ENDIAN_LITTLE;
-
- if (TARGET_ARCHITECTURE != NULL)
- asm_info.mach = TARGET_ARCHITECTURE->mach;
-
/* Now construct each line */
for (; count > 0; count--, lines++)
{
@@ -98,7 +86,7 @@ tui_disassemble (struct tui_asm_line* lines, CORE_ADDR pc, int count)
ui_file_rewind (gdb_dis_out);
- pc = pc + TARGET_PRINT_INSN (pc, &asm_info);
+ pc = pc + gdb_print_insn (pc, gdb_dis_out);
lines->insn = xstrdup (tui_file_get_strbuf (gdb_dis_out));
diff --git a/gdb/tui/tuiRegs.c b/gdb/tui/tuiRegs.c
index 6920d80d975..61b933444da 100644
--- a/gdb/tui/tuiRegs.c
+++ b/gdb/tui/tuiRegs.c
@@ -489,7 +489,7 @@ tuiCheckRegisterValues (struct frame_info *frame)
else
{
int i, j;
- char rawBuf[MAX_REGISTER_RAW_SIZE];
+ char rawBuf[MAX_REGISTER_SIZE];
for (i = 0;
(i < dataWin->detail.dataDisplayInfo.regsContentCount); i++)
@@ -766,7 +766,7 @@ _tuiRegValueHasChanged (TuiDataElementPtr dataElement,
if (dataElement->itemNo != UNDEFINED_ITEM &&
_tuiRegisterName (dataElement->itemNo) != (char *) NULL)
{
- char rawBuf[MAX_REGISTER_RAW_SIZE];
+ char rawBuf[MAX_REGISTER_SIZE];
int i;
if (_tuiGetRegisterRawValue (
@@ -830,7 +830,7 @@ _tuiSetRegisterElement (int regNum, struct frame_info *frame,
dataElement->highlight = FALSE;
}
if (dataElement->value == (Opaque) NULL)
- dataElement->value = (Opaque) xmalloc (MAX_REGISTER_RAW_SIZE);
+ dataElement->value = (Opaque) xmalloc (MAX_REGISTER_SIZE);
if (dataElement->value != (Opaque) NULL)
_tuiGetRegisterRawValue (regNum, dataElement->value, frame);
}
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index de810565e04..1828d1c74df 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -613,8 +613,8 @@ v850_scan_prologue (CORE_ADDR pc, struct prologue_info *pi)
int insn2 = -1; /* dummy value */
#ifdef DEBUG
- printf_filtered ("0x%.8lx ", (long) current_pc);
- TARGET_PRINT_INSN (current_pc, &tm_print_insn_info);
+ fprintf_filtered (gdb_stdlog, "0x%.8lx ", (long) current_pc);
+ gdb_print_insn (current_pc, gdb_stdlog);
#endif
insn = read_memory_unsigned_integer (current_pc, 2);
@@ -1155,9 +1155,10 @@ v850_frame_init_saved_regs (struct frame_info *fi)
be valid only if this routine uses FP. For previous frames, fi-frame will
always be correct (since that is derived from v850_frame_chain ()).
- We can be called with the PC in the call dummy under two circumstances.
- First, during normal backtracing, second, while figuring out the frame
- pointer just prior to calling the target function (see run_stack_dummy). */
+ We can be called with the PC in the call dummy under two
+ circumstances. First, during normal backtracing, second, while
+ figuring out the frame pointer just prior to calling the target
+ function (see call_function_by_hand). */
static void
v850_init_extra_frame_info (int fromleaf, struct frame_info *fi)
@@ -1214,7 +1215,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
if (v850_processor_type_table[i].mach == info.bfd_arch_info->mach)
{
v850_register_names = v850_processor_type_table[i].regnames;
- tm_print_insn_info.mach = info.bfd_arch_info->mach;
+ deprecated_tm_print_insn_info.mach = info.bfd_arch_info->mach;
break;
}
}
@@ -1225,10 +1226,10 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_num_regs (gdbarch, E_NUM_REGS);
set_gdbarch_num_pseudo_regs (gdbarch, 0);
set_gdbarch_sp_regnum (gdbarch, E_SP_REGNUM);
- set_gdbarch_fp_regnum (gdbarch, E_FP_REGNUM);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, E_FP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
set_gdbarch_register_name (gdbarch, v850_register_name);
- set_gdbarch_register_size (gdbarch, v850_reg_size);
+ set_gdbarch_deprecated_register_size (gdbarch, v850_reg_size);
set_gdbarch_register_bytes (gdbarch, E_ALL_REGS_SIZE);
set_gdbarch_register_byte (gdbarch, v850_register_byte);
set_gdbarch_register_raw_size (gdbarch, v850_register_raw_size);
@@ -1237,7 +1238,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_max_register_virtual_size (gdbarch, v850_reg_size);
set_gdbarch_register_virtual_type (gdbarch, v850_reg_virtual_type);
- set_gdbarch_read_fp (gdbarch, v850_target_read_fp);
+ set_gdbarch_deprecated_target_read_fp (gdbarch, v850_target_read_fp);
/*
* Frame Info
@@ -1276,9 +1277,9 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_store_return_value (gdbarch, v850_store_return_value);
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, v850_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, v850_use_struct_convention);
- set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
- set_gdbarch_fix_call_dummy (gdbarch, v850_fix_call_dummy);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_nil);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_deprecated_fix_call_dummy (gdbarch, v850_fix_call_dummy);
set_gdbarch_breakpoint_from_pc (gdbarch, v850_breakpoint_from_pc);
set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
@@ -1295,6 +1296,6 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
void
_initialize_v850_tdep (void)
{
- tm_print_insn = print_insn_v850;
+ deprecated_tm_print_insn = print_insn_v850;
register_gdbarch_init (bfd_arch_v850, v850_gdbarch_init);
}
diff --git a/gdb/valarith.c b/gdb/valarith.c
index ed0fe05f35e..854a1517ae6 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -31,6 +31,7 @@
#include "gdb_string.h"
#include "doublest.h"
#include <math.h>
+#include "infcall.h"
/* Define whether or not the C operator '/' truncates towards zero for
differently signed operands (truncation direction is undefined in C). */
diff --git a/gdb/valops.c b/gdb/valops.c
index a2a2e978bd3..e54969c3743 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -34,6 +34,7 @@
#include "regcache.h"
#include "cp-abi.h"
#include "block.h"
+#include "infcall.h"
#include <errno.h>
#include "gdb_string.h"
@@ -49,10 +50,6 @@ extern int overload_debug;
static int typecmp (int staticp, int varargs, int nargs,
struct field t1[], struct value *t2[]);
-static CORE_ADDR find_function_addr (struct value *, struct type **);
-static struct value *value_arg_coerce (struct value *, struct type *, int);
-
-
static CORE_ADDR value_push (CORE_ADDR, struct value *);
static struct value *search_struct_field (char *, struct value *, int,
@@ -84,37 +81,6 @@ static int auto_abandon = 0;
int overload_resolution = 0;
-/* This boolean tells what gdb should do if a signal is received while in
- a function called from gdb (call dummy). If set, gdb unwinds the stack
- and restore the context to what as it was before the call.
- The default is to stop in the frame where the signal was received. */
-
-int unwind_on_signal_p = 0;
-
-/* How you should pass arguments to a function depends on whether it
- was defined in K&R style or prototype style. If you define a
- function using the K&R syntax that takes a `float' argument, then
- callers must pass that argument as a `double'. If you define the
- function using the prototype syntax, then you must pass the
- argument as a `float', with no promotion.
-
- Unfortunately, on certain older platforms, the debug info doesn't
- indicate reliably how each function was defined. A function type's
- TYPE_FLAG_PROTOTYPED flag may be clear, even if the function was
- defined in prototype style. When calling a function whose
- TYPE_FLAG_PROTOTYPED flag is clear, GDB consults this flag to decide
- what to do.
-
- For modern targets, it is proper to assume that, if the prototype
- flag is clear, that can be trusted: `float' arguments should be
- promoted to `double'. For some older targets, if the prototype
- flag is clear, that doesn't tell us anything. The default is to
- trust the debug information; the user can override this behavior
- with "set coerce-float-to-double 0". */
-
-static int coerce_float_to_double;
-
-
/* Find the address of function name NAME in the inferior. */
struct value *
@@ -514,7 +480,7 @@ value_assign (struct value *toval, struct value *fromval)
{
register struct type *type;
struct value *val;
- char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
int use_buffer = 0;
struct frame_id old_frame;
@@ -668,8 +634,7 @@ value_assign (struct value *toval, struct value *fromval)
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);
+ buffer = (char *) alloca (amount_to_copy + MAX_REGISTER_SIZE);
/* Copy it in. */
for (regno = reg_offset, amount_copied = 0;
@@ -996,8 +961,8 @@ value_ind (struct value *arg1)
CORE_ADDR
push_word (CORE_ADDR sp, ULONGEST word)
{
- register int len = REGISTER_SIZE;
- char *buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ register int len = DEPRECATED_REGISTER_SIZE;
+ char buffer[MAX_REGISTER_SIZE];
store_unsigned_integer (buffer, len, word);
if (INNER_THAN (1, 2))
@@ -1089,774 +1054,6 @@ legacy_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
return sp;
}
-/* Perform the standard coercions that are specified
- for arguments to be passed to C functions.
-
- If PARAM_TYPE is non-NULL, it is the expected parameter type.
- IS_PROTOTYPED is non-zero if the function declaration is prototyped. */
-
-static struct value *
-value_arg_coerce (struct value *arg, struct type *param_type,
- int is_prototyped)
-{
- register struct type *arg_type = check_typedef (VALUE_TYPE (arg));
- register struct type *type
- = param_type ? check_typedef (param_type) : arg_type;
-
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_REF:
- if (TYPE_CODE (arg_type) != TYPE_CODE_REF
- && TYPE_CODE (arg_type) != TYPE_CODE_PTR)
- {
- arg = value_addr (arg);
- VALUE_TYPE (arg) = param_type;
- return arg;
- }
- break;
- case TYPE_CODE_INT:
- case TYPE_CODE_CHAR:
- case TYPE_CODE_BOOL:
- case TYPE_CODE_ENUM:
- /* If we don't have a prototype, coerce to integer type if necessary. */
- if (!is_prototyped)
- {
- if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_int))
- type = builtin_type_int;
- }
- /* Currently all target ABIs require at least the width of an integer
- type for an argument. We may have to conditionalize the following
- type coercion for future targets. */
- if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_int))
- type = builtin_type_int;
- break;
- case TYPE_CODE_FLT:
- if (!is_prototyped && coerce_float_to_double)
- {
- if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_double))
- type = builtin_type_double;
- else if (TYPE_LENGTH (type) > TYPE_LENGTH (builtin_type_double))
- type = builtin_type_long_double;
- }
- break;
- case TYPE_CODE_FUNC:
- type = lookup_pointer_type (type);
- break;
- case TYPE_CODE_ARRAY:
- /* Arrays are coerced to pointers to their first element, unless
- they are vectors, in which case we want to leave them alone,
- because they are passed by value. */
- if (current_language->c_style_arrays)
- if (!TYPE_VECTOR (type))
- type = lookup_pointer_type (TYPE_TARGET_TYPE (type));
- break;
- case TYPE_CODE_UNDEF:
- case TYPE_CODE_PTR:
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- case TYPE_CODE_VOID:
- case TYPE_CODE_SET:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_STRING:
- case TYPE_CODE_BITSTRING:
- case TYPE_CODE_ERROR:
- case TYPE_CODE_MEMBER:
- case TYPE_CODE_METHOD:
- case TYPE_CODE_COMPLEX:
- default:
- break;
- }
-
- return value_cast (type, arg);
-}
-
-/* Determine a function's address and its return type from its value.
- Calls error() if the function is not valid for calling. */
-
-static CORE_ADDR
-find_function_addr (struct value *function, struct type **retval_type)
-{
- register struct type *ftype = check_typedef (VALUE_TYPE (function));
- register enum type_code code = TYPE_CODE (ftype);
- struct type *value_type;
- CORE_ADDR funaddr;
-
- /* If it's a member function, just look at the function
- part of it. */
-
- /* Determine address to call. */
- if (code == TYPE_CODE_FUNC || code == TYPE_CODE_METHOD)
- {
- funaddr = VALUE_ADDRESS (function);
- value_type = TYPE_TARGET_TYPE (ftype);
- }
- else if (code == TYPE_CODE_PTR)
- {
- funaddr = value_as_address (function);
- ftype = check_typedef (TYPE_TARGET_TYPE (ftype));
- if (TYPE_CODE (ftype) == TYPE_CODE_FUNC
- || TYPE_CODE (ftype) == TYPE_CODE_METHOD)
- {
- funaddr = CONVERT_FROM_FUNC_PTR_ADDR (funaddr);
- value_type = TYPE_TARGET_TYPE (ftype);
- }
- else
- value_type = builtin_type_int;
- }
- else if (code == TYPE_CODE_INT)
- {
- /* Handle the case of functions lacking debugging info.
- Their values are characters since their addresses are char */
- if (TYPE_LENGTH (ftype) == 1)
- funaddr = value_as_address (value_addr (function));
- else
- /* Handle integer used as address of a function. */
- funaddr = (CORE_ADDR) value_as_long (function);
-
- value_type = builtin_type_int;
- }
- else
- error ("Invalid data type for function to be called.");
-
- *retval_type = value_type;
- return funaddr;
-}
-
-/* All this stuff with a dummy frame may seem unnecessarily complicated
- (why not just save registers in GDB?). The purpose of pushing a dummy
- frame which looks just like a real frame is so that if you call a
- function and then hit a breakpoint (get a signal, etc), "backtrace"
- will look right. Whether the backtrace needs to actually show the
- stack at the time the inferior function was called is debatable, but
- it certainly needs to not display garbage. So if you are contemplating
- making dummy frames be different from normal frames, consider that. */
-
-/* Perform a function call in the inferior.
- ARGS is a vector of values of arguments (NARGS of them).
- FUNCTION is a value, the function to be called.
- Returns a value representing what the function returned.
- May fail to return, if a breakpoint or signal is hit
- during the execution of the function.
-
- ARGS is modified to contain coerced values. */
-
-struct value *
-call_function_by_hand (struct value *function, int nargs, struct value **args)
-{
- register CORE_ADDR sp;
- register int i;
- int rc;
- CORE_ADDR start_sp;
- /* CALL_DUMMY is an array of words (REGISTER_SIZE), but each word
- is in host byte order. Before calling FIX_CALL_DUMMY, we byteswap it
- and remove any extra bytes which might exist because ULONGEST is
- bigger than REGISTER_SIZE.
-
- NOTE: This is pretty wierd, as the call dummy is actually a
- sequence of instructions. But CISC machines will have
- to pack the instructions into REGISTER_SIZE units (and
- so will RISC machines for which INSTRUCTION_SIZE is not
- REGISTER_SIZE).
-
- NOTE: This is pretty stupid. CALL_DUMMY should be in strict
- target byte order. */
-
- static ULONGEST *dummy;
- int sizeof_dummy1;
- char *dummy1;
- CORE_ADDR dummy_addr;
- CORE_ADDR old_sp;
- struct type *value_type;
- unsigned char struct_return;
- CORE_ADDR struct_addr = 0;
- struct regcache *retbuf;
- struct cleanup *retbuf_cleanup;
- struct inferior_status *inf_status;
- struct cleanup *inf_status_cleanup;
- CORE_ADDR funaddr;
- int using_gcc; /* Set to version of gcc in use, or zero if not gcc */
- CORE_ADDR real_pc;
- struct type *param_type = NULL;
- struct type *ftype = check_typedef (SYMBOL_TYPE (function));
- int n_method_args = 0;
-
- dummy = alloca (SIZEOF_CALL_DUMMY_WORDS);
- sizeof_dummy1 = REGISTER_SIZE * SIZEOF_CALL_DUMMY_WORDS / sizeof (ULONGEST);
- dummy1 = alloca (sizeof_dummy1);
- memcpy (dummy, CALL_DUMMY_WORDS, SIZEOF_CALL_DUMMY_WORDS);
-
- if (!target_has_execution)
- noprocess ();
-
- /* Create a cleanup chain that contains the retbuf (buffer
- containing the register values). This chain is create BEFORE the
- inf_status chain so that the inferior status can cleaned up
- (restored or discarded) without having the retbuf freed. */
- retbuf = regcache_xmalloc (current_gdbarch);
- retbuf_cleanup = make_cleanup_regcache_xfree (retbuf);
-
- /* A cleanup for the inferior status. Create this AFTER the retbuf
- so that this can be discarded or applied without interfering with
- the regbuf. */
- inf_status = save_inferior_status (1);
- inf_status_cleanup = make_cleanup_restore_inferior_status (inf_status);
-
- if (DEPRECATED_PUSH_DUMMY_FRAME_P ())
- {
- /* DEPRECATED_PUSH_DUMMY_FRAME is responsible for saving the
- inferior registers (and frame_pop() for restoring them). (At
- least on most machines) they are saved on the stack in the
- inferior. */
- DEPRECATED_PUSH_DUMMY_FRAME;
- }
- else
- {
- /* FIXME: cagney/2003-02-26: Step zero of this little tinker is
- to extract the generic dummy frame code from the architecture
- vector. Hence this direct call.
-
- A follow-on change is to modify this interface so that it takes
- thread OR frame OR tpid as a parameter, and returns a dummy
- frame handle. The handle can then be used further down as a
- parameter SAVE_DUMMY_FRAME_TOS. Hmm, thinking about it, since
- everything is ment to be using generic dummy frames, why not
- even use some of the dummy frame code to here - do a regcache
- dup and then pass the duped regcache, along with all the other
- stuff, at one single point.
-
- In fact, you can even save the structure's return address in the
- dummy frame and fix one of those nasty lost struct return edge
- conditions. */
- generic_push_dummy_frame ();
- }
-
- old_sp = read_sp ();
-
- /* Ensure that the initial SP is correctly aligned. */
- if (gdbarch_frame_align_p (current_gdbarch))
- {
- /* NOTE: cagney/2002-09-18:
-
- On a RISC architecture, a void parameterless generic dummy
- frame (i.e., no parameters, no result) typically does not
- need to push anything the stack and hence can leave SP and
- FP. Similarly, a framelss (possibly leaf) function does not
- push anything on the stack and, hence, that too can leave FP
- and SP unchanged. As a consequence, a sequence of void
- parameterless generic dummy frame calls to frameless
- functions will create a sequence of effectively identical
- frames (SP, FP and TOS and PC the same). This, not
- suprisingly, results in what appears to be a stack in an
- infinite loop --- when GDB tries to find a generic dummy
- frame on the internal dummy frame stack, it will always find
- the first one.
-
- To avoid this problem, the code below always grows the stack.
- That way, two dummy frames can never be identical. It does
- burn a few bytes of stack but that is a small price to pay
- :-). */
- sp = gdbarch_frame_align (current_gdbarch, old_sp);
- if (sp == old_sp)
- {
- if (INNER_THAN (1, 2))
- /* Stack grows down. */
- sp = gdbarch_frame_align (current_gdbarch, old_sp - 1);
- else
- /* Stack grows up. */
- sp = gdbarch_frame_align (current_gdbarch, old_sp + 1);
- }
- gdb_assert ((INNER_THAN (1, 2) && sp <= old_sp)
- || (INNER_THAN (2, 1) && sp >= old_sp));
- }
- else
- /* FIXME: cagney/2002-09-18: Hey, you loose! Who knows how badly
- aligned the SP is! Further, per comment above, if the generic
- dummy frame ends up empty (because nothing is pushed) GDB won't
- be able to correctly perform back traces. If a target is
- having trouble with backtraces, first thing to do is add
- FRAME_ALIGN() to its architecture vector. After that, try
- adding SAVE_DUMMY_FRAME_TOS() and modifying
- DEPRECATED_FRAME_CHAIN so that when the next outer frame is a
- generic dummy, it returns the current frame's base. */
- sp = old_sp;
-
- if (INNER_THAN (1, 2))
- {
- /* Stack grows down */
- sp -= sizeof_dummy1;
- start_sp = sp;
- }
- else
- {
- /* Stack grows up */
- start_sp = sp;
- sp += sizeof_dummy1;
- }
-
- /* NOTE: cagney/2002-09-10: Don't bother re-adjusting the stack
- after allocating space for the call dummy. A target can specify
- a SIZEOF_DUMMY1 (via SIZEOF_CALL_DUMMY_WORDS) such that all local
- alignment requirements are met. */
-
- funaddr = find_function_addr (function, &value_type);
- CHECK_TYPEDEF (value_type);
-
- {
- struct block *b = block_for_pc (funaddr);
- /* If compiled without -g, assume GCC 2. */
- using_gcc = (b == NULL ? 2 : BLOCK_GCC_COMPILED (b));
- }
-
- /* Are we returning a value using a structure return or a normal
- value return? */
-
- struct_return = using_struct_return (function, funaddr, value_type,
- using_gcc);
-
- /* Create a call sequence customized for this function
- and the number of arguments for it. */
- for (i = 0; i < (int) (SIZEOF_CALL_DUMMY_WORDS / sizeof (dummy[0])); i++)
- store_unsigned_integer (&dummy1[i * REGISTER_SIZE],
- REGISTER_SIZE,
- (ULONGEST) dummy[i]);
-
-#ifdef GDB_TARGET_IS_HPPA
- real_pc = FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
- value_type, using_gcc);
-#else
- if (FIX_CALL_DUMMY_P ())
- {
- /* gdb_assert (CALL_DUMMY_LOCATION == ON_STACK) true? */
- FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args, value_type,
- using_gcc);
- }
- real_pc = start_sp;
-#endif
-
- switch (CALL_DUMMY_LOCATION)
- {
- case ON_STACK:
- dummy_addr = start_sp;
- write_memory (start_sp, (char *) dummy1, sizeof_dummy1);
- if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
- generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1);
- break;
- case AT_ENTRY_POINT:
- real_pc = funaddr;
- dummy_addr = CALL_DUMMY_ADDRESS ();
- if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
- /* NOTE: cagney/2002-04-13: The entry point is going to be
- modified with a single breakpoint. */
- generic_save_call_dummy_addr (CALL_DUMMY_ADDRESS (),
- CALL_DUMMY_ADDRESS () + 1);
- break;
- default:
- internal_error (__FILE__, __LINE__, "bad switch");
- }
-
-#ifdef lint
- sp = old_sp; /* It really is used, for some ifdef's... */
-#endif
-
- if (nargs < TYPE_NFIELDS (ftype))
- error ("too few arguments in function call");
-
- for (i = nargs - 1; i >= 0; i--)
- {
- int prototyped;
-
- /* FIXME drow/2002-05-31: Should just always mark methods as
- prototyped. Can we respect TYPE_VARARGS? Probably not. */
- if (TYPE_CODE (ftype) == TYPE_CODE_METHOD)
- prototyped = 1;
- else
- prototyped = TYPE_PROTOTYPED (ftype);
-
- if (i < TYPE_NFIELDS (ftype))
- args[i] = value_arg_coerce (args[i], TYPE_FIELD_TYPE (ftype, i),
- prototyped);
- else
- args[i] = value_arg_coerce (args[i], NULL, 0);
-
- /*elz: this code is to handle the case in which the function to be called
- has a pointer to function as parameter and the corresponding actual argument
- is the address of a function and not a pointer to function variable.
- In aCC compiled code, the calls through pointers to functions (in the body
- of the function called by hand) are made via $$dyncall_external which
- requires some registers setting, this is taken care of if we call
- via a function pointer variable, but not via a function address.
- In cc this is not a problem. */
-
- if (using_gcc == 0)
- if (param_type && TYPE_CODE (ftype) != TYPE_CODE_METHOD)
- /* if this parameter is a pointer to function */
- if (TYPE_CODE (param_type) == TYPE_CODE_PTR)
- if (TYPE_CODE (TYPE_TARGET_TYPE (param_type)) == TYPE_CODE_FUNC)
- /* elz: FIXME here should go the test about the compiler used
- to compile the target. We want to issue the error
- message only if the compiler used was HP's aCC.
- If we used HP's cc, then there is no problem and no need
- to return at this point */
- if (using_gcc == 0) /* && compiler == aCC */
- /* go see if the actual parameter is a variable of type
- pointer to function or just a function */
- if (args[i]->lval == not_lval)
- {
- char *arg_name;
- if (find_pc_partial_function ((CORE_ADDR) args[i]->aligner.contents[0], &arg_name, NULL, NULL))
- error ("\
-You cannot use function <%s> as argument. \n\
-You must use a pointer to function type variable. Command ignored.", arg_name);
- }
- }
-
- if (REG_STRUCT_HAS_ADDR_P ())
- {
- /* This is a machine like the sparc, where we may need to pass a
- pointer to the structure, not the structure itself. */
- for (i = nargs - 1; i >= 0; i--)
- {
- struct type *arg_type = check_typedef (VALUE_TYPE (args[i]));
- if ((TYPE_CODE (arg_type) == TYPE_CODE_STRUCT
- || TYPE_CODE (arg_type) == TYPE_CODE_UNION
- || TYPE_CODE (arg_type) == TYPE_CODE_ARRAY
- || TYPE_CODE (arg_type) == TYPE_CODE_STRING
- || TYPE_CODE (arg_type) == TYPE_CODE_BITSTRING
- || TYPE_CODE (arg_type) == TYPE_CODE_SET
- || (TYPE_CODE (arg_type) == TYPE_CODE_FLT
- && TYPE_LENGTH (arg_type) > 8)
- )
- && REG_STRUCT_HAS_ADDR (using_gcc, arg_type))
- {
- CORE_ADDR addr;
- int len; /* = TYPE_LENGTH (arg_type); */
- int aligned_len;
- arg_type = check_typedef (VALUE_ENCLOSING_TYPE (args[i]));
- len = TYPE_LENGTH (arg_type);
-
- if (STACK_ALIGN_P ())
- /* MVS 11/22/96: I think at least some of this
- stack_align code is really broken. Better to let
- PUSH_ARGUMENTS adjust the stack in a target-defined
- manner. */
- aligned_len = STACK_ALIGN (len);
- else
- aligned_len = len;
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= aligned_len;
- /* ... so the address of the thing we push is the
- stack pointer after we push it. */
- addr = sp;
- }
- else
- {
- /* The stack grows up, so the address of the thing
- we push is the stack pointer before we push it. */
- addr = sp;
- sp += aligned_len;
- }
- /* Push the structure. */
- write_memory (addr, VALUE_CONTENTS_ALL (args[i]), len);
- /* The value we're going to pass is the address of the
- thing we just pushed. */
- /*args[i] = value_from_longest (lookup_pointer_type (value_type),
- (LONGEST) addr); */
- args[i] = value_from_pointer (lookup_pointer_type (arg_type),
- addr);
- }
- }
- }
-
-
- /* Reserve space for the return structure to be written on the
- stack, if necessary. Make certain that the value is correctly
- aligned. */
-
- if (struct_return)
- {
- int len = TYPE_LENGTH (value_type);
- if (STACK_ALIGN_P ())
- /* NOTE: cagney/2003-03-22: Should rely on frame align, rather
- than stack align to force the alignment of the stack. */
- len = STACK_ALIGN (len);
- if (INNER_THAN (1, 2))
- {
- /* Stack grows downward. Align STRUCT_ADDR and SP after
- making space for the return value. */
- sp -= len;
- if (gdbarch_frame_align_p (current_gdbarch))
- sp = gdbarch_frame_align (current_gdbarch, sp);
- struct_addr = sp;
- }
- else
- {
- /* Stack grows upward. Align the frame, allocate space, and
- then again, re-align the frame??? */
- if (gdbarch_frame_align_p (current_gdbarch))
- sp = gdbarch_frame_align (current_gdbarch, sp);
- struct_addr = sp;
- sp += len;
- if (gdbarch_frame_align_p (current_gdbarch))
- sp = gdbarch_frame_align (current_gdbarch, sp);
- }
- }
-
- /* elz: on HPPA no need for this extra alignment, maybe it is needed
- on other architectures. This is because all the alignment is
- taken care of in the above code (ifdef REG_STRUCT_HAS_ADDR) and
- in hppa_push_arguments */
- /* NOTE: cagney/2003-03-24: The below code is very broken. Given an
- odd sized parameter the below will mis-align the stack. As was
- suggested back in '96, better to let PUSH_ARGUMENTS handle it. */
- if (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)
- {
- /* MVS 11/22/96: I think at least some of this stack_align code
- is really broken. Better to let push_dummy_call() adjust the
- stack in a target-defined manner. */
- if (STACK_ALIGN_P () && INNER_THAN (1, 2))
- {
- /* If stack grows down, we must leave a hole at the top. */
- int len = 0;
-
- for (i = nargs - 1; i >= 0; i--)
- len += TYPE_LENGTH (VALUE_ENCLOSING_TYPE (args[i]));
- if (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P ())
- len += DEPRECATED_CALL_DUMMY_STACK_ADJUST;
- sp -= STACK_ALIGN (len) - len;
- }
- }
-
- /* Create the dummy stack frame. Pass in the call dummy address as,
- presumably, the ABI code knows where, in the call dummy, the
- return address should be pointed. */
- if (gdbarch_push_dummy_call_p (current_gdbarch))
- /* When there is no push_dummy_call method, should this code
- simply error out. That would the implementation of this method
- for all ABIs (which is probably a good thing). */
- sp = gdbarch_push_dummy_call (current_gdbarch, current_regcache,
- dummy_addr, nargs, args, sp, struct_return,
- struct_addr);
- else if (DEPRECATED_PUSH_ARGUMENTS_P ())
- /* Keep old targets working. */
- sp = DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return,
- struct_addr);
- else
- sp = legacy_push_arguments (nargs, args, sp, struct_return, struct_addr);
-
- if (DEPRECATED_PUSH_RETURN_ADDRESS_P ())
- /* for targets that use no CALL_DUMMY */
- /* There are a number of targets now which actually don't write
- any CALL_DUMMY instructions into the target, but instead just
- save the machine state, push the arguments, and jump directly
- to the callee function. Since this doesn't actually involve
- executing a JSR/BSR instruction, the return address must be set
- up by hand, either by pushing onto the stack or copying into a
- return-address register as appropriate. Formerly this has been
- done in PUSH_ARGUMENTS, but that's overloading its
- functionality a bit, so I'm making it explicit to do it here. */
- sp = DEPRECATED_PUSH_RETURN_ADDRESS (real_pc, sp);
-
- /* NOTE: cagney/2003-03-23: Diable this code when there is a
- push_dummy_call() method. Since that method will have already
- handled any alignment issues, the code below is entirely
- redundant. */
- if (!gdbarch_push_dummy_call_p (current_gdbarch)
- && STACK_ALIGN_P () && !INNER_THAN (1, 2))
- {
- /* If stack grows up, we must leave a hole at the bottom, note
- that sp already has been advanced for the arguments! */
- if (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P ())
- sp += DEPRECATED_CALL_DUMMY_STACK_ADJUST;
- sp = STACK_ALIGN (sp);
- }
-
-/* XXX This seems wrong. For stacks that grow down we shouldn't do
- anything here! */
- /* MVS 11/22/96: I think at least some of this stack_align code is
- really broken. Better to let PUSH_ARGUMENTS adjust the stack in
- a target-defined manner. */
- if (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P ())
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= DEPRECATED_CALL_DUMMY_STACK_ADJUST;
- }
-
- /* Store the address at which the structure is supposed to be
- written. */
- /* NOTE: 2003-03-24: Since PUSH_ARGUMENTS can (and typically does)
- store the struct return address, this call is entirely redundant. */
- if (struct_return && DEPRECATED_STORE_STRUCT_RETURN_P ())
- DEPRECATED_STORE_STRUCT_RETURN (struct_addr, sp);
-
- /* Write the stack pointer. This is here because the statements above
- might fool with it. On SPARC, this write also stores the register
- window into the right place in the new stack frame, which otherwise
- wouldn't happen. (See store_inferior_registers in sparc-nat.c.) */
- /* NOTE: cagney/2003-03-23: Disable this code when there is a
- push_dummy_call() method. Since that method will have already
- stored the stack pointer (as part of creating the fake call
- frame), and none of the code following that code adjusts the
- stack-pointer value, the below call is entirely redundant. */
- if (DEPRECATED_DUMMY_WRITE_SP_P ())
- DEPRECATED_DUMMY_WRITE_SP (sp);
-
- if (SAVE_DUMMY_FRAME_TOS_P ())
- SAVE_DUMMY_FRAME_TOS (sp);
-
- {
- char *name;
- struct symbol *symbol;
-
- name = NULL;
- symbol = find_pc_function (funaddr);
- if (symbol)
- {
- name = SYMBOL_PRINT_NAME (symbol);
- }
- else
- {
- /* Try the minimal symbols. */
- struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (funaddr);
-
- if (msymbol)
- {
- name = SYMBOL_PRINT_NAME (msymbol);
- }
- }
- if (name == NULL)
- {
- char format[80];
- sprintf (format, "at %s", local_hex_format ());
- name = alloca (80);
- /* FIXME-32x64: assumes funaddr fits in a long. */
- sprintf (name, format, (unsigned long) funaddr);
- }
-
- /* Execute the stack dummy routine, calling FUNCTION.
- When it is done, discard the empty frame
- after storing the contents of all regs into retbuf. */
- rc = run_stack_dummy (real_pc + CALL_DUMMY_START_OFFSET, retbuf);
-
- if (rc == 1)
- {
- /* We stopped inside the FUNCTION because of a random signal.
- Further execution of the FUNCTION is not allowed. */
-
- if (unwind_on_signal_p)
- {
- /* The user wants the context restored. */
-
- /* We must get back to the frame we were before the dummy
- call. */
- frame_pop (get_current_frame ());
-
- /* FIXME: Insert a bunch of wrap_here; name can be very long if it's
- a C++ name with arguments and stuff. */
- error ("\
-The program being debugged was signaled while in a function called from GDB.\n\
-GDB has restored the context to what it was before the call.\n\
-To change this behavior use \"set unwindonsignal off\"\n\
-Evaluation of the expression containing the function (%s) will be abandoned.",
- name);
- }
- else
- {
- /* The user wants to stay in the frame where we stopped (default).*/
-
- /* If we restored the inferior status (via the cleanup),
- we would print a spurious error message (Unable to
- restore previously selected frame), would write the
- registers from the inf_status (which is wrong), and
- would do other wrong things. */
- discard_cleanups (inf_status_cleanup);
- discard_inferior_status (inf_status);
-
- /* FIXME: Insert a bunch of wrap_here; name can be very long if it's
- a C++ name with arguments and stuff. */
- error ("\
-The program being debugged was signaled while in a function called from GDB.\n\
-GDB remains in the frame where the signal was received.\n\
-To change this behavior use \"set unwindonsignal on\"\n\
-Evaluation of the expression containing the function (%s) will be abandoned.",
- name);
- }
- }
-
- if (rc == 2)
- {
- /* We hit a breakpoint inside the FUNCTION. */
-
- /* If we restored the inferior status (via the cleanup), we
- would print a spurious error message (Unable to restore
- previously selected frame), would write the registers from
- the inf_status (which is wrong), and would do other wrong
- things. */
- discard_cleanups (inf_status_cleanup);
- discard_inferior_status (inf_status);
-
- /* The following error message used to say "The expression
- which contained the function call has been discarded." It
- is a hard concept to explain in a few words. Ideally, GDB
- would be able to resume evaluation of the expression when
- the function finally is done executing. Perhaps someday
- this will be implemented (it would not be easy). */
-
- /* FIXME: Insert a bunch of wrap_here; name can be very long if it's
- a C++ name with arguments and stuff. */
- error ("\
-The program being debugged stopped while in a function called from GDB.\n\
-When the function (%s) is done executing, GDB will silently\n\
-stop (instead of continuing to evaluate the expression containing\n\
-the function call).", name);
- }
-
- /* If we get here the called FUNCTION run to completion. */
-
- /* Restore the inferior status, via its cleanup. At this stage,
- leave the RETBUF alone. */
- do_cleanups (inf_status_cleanup);
-
- /* Figure out the value returned by the function. */
- /* elz: I defined this new macro for the hppa architecture only.
- this gives us a way to get the value returned by the function
- from the stack, at the same address we told the function to put
- it. We cannot assume on the pa that r28 still contains the
- address of the returned structure. Usually this will be
- overwritten by the callee. I don't know about other
- architectures, so I defined this macro */
-#ifdef VALUE_RETURNED_FROM_STACK
- if (struct_return)
- {
- do_cleanups (retbuf_cleanup);
- return VALUE_RETURNED_FROM_STACK (value_type, struct_addr);
- }
-#endif
- /* NOTE: cagney/2002-09-10: Only when the stack has been correctly
- aligned (using frame_align()) do we can trust STRUCT_ADDR and
- fetch the return value direct from the stack. This lack of
- trust comes about because legacy targets have a nasty habit of
- silently, and local to PUSH_ARGUMENTS(), moving STRUCT_ADDR.
- For such targets, just hope that value_being_returned() can
- find the adjusted value. */
- if (struct_return && gdbarch_frame_align_p (current_gdbarch))
- {
- struct value *retval = value_at (value_type, struct_addr, NULL);
- do_cleanups (retbuf_cleanup);
- return retval;
- }
- else
- {
- struct value *retval = value_being_returned (value_type, retbuf,
- struct_return);
- do_cleanups (retbuf_cleanup);
- return retval;
- }
- }
-}
-
/* Create a value for an array by allocating space in the inferior, copying
the data into that space, and then setting up an array value.
@@ -3485,29 +2682,4 @@ _initialize_valops (void)
&setlist),
&showlist);
overload_resolution = 1;
-
- add_show_from_set (
- add_set_cmd ("unwindonsignal", no_class, var_boolean,
- (char *) &unwind_on_signal_p,
-"Set unwinding of stack if a signal is received while in a call dummy.\n\
-The unwindonsignal lets the user determine what gdb should do if a signal\n\
-is received while in a function called from gdb (call dummy). If set, gdb\n\
-unwinds the stack and restore the context to what as it was before the call.\n\
-The default is to stop in the frame where the signal was received.", &setlist),
- &showlist);
-
- add_show_from_set
- (add_set_cmd ("coerce-float-to-double", class_obscure, var_boolean,
- (char *) &coerce_float_to_double,
- "Set coercion of floats to doubles when calling functions\n"
- "Variables of type float should generally be converted to doubles before\n"
- "calling an unprototyped function, and left alone when calling a prototyped\n"
- "function. However, some older debug info formats do not provide enough\n"
- "information to determine that a function is prototyped. If this flag is\n"
- "set, GDB will perform the conversion for a function it considers\n"
- "unprototyped.\n"
- "The default is to perform the conversion.\n",
- &setlist),
- &showlist);
- coerce_float_to_double = 1;
}
diff --git a/gdb/value.h b/gdb/value.h
index ad488a788fa..54854e5f563 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -549,9 +549,6 @@ extern struct value *varying_to_slice (struct value *);
extern struct value *value_slice (struct value *, int, int);
-extern struct value *call_function_by_hand (struct value *, int,
- struct value **);
-
extern struct value *value_literal_complex (struct value *, struct value *,
struct type *);
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index 859e2b377d5..54ca48dd58a 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -50,7 +50,6 @@ static gdbarch_deprecated_extract_struct_value_address_ftype
vax_extract_struct_value_address;
static gdbarch_deprecated_push_dummy_frame_ftype vax_push_dummy_frame;
-static gdbarch_fix_call_dummy_ftype vax_fix_call_dummy;
/* Return 1 if P points to an invalid floating point value.
LEN is the length in bytes -- not relevant on the Vax. */
@@ -143,12 +142,12 @@ vax_frame_init_saved_regs (struct frame_info *frame)
}
get_frame_saved_regs (frame)[SP_REGNUM] = next_addr + 4;
- if (regmask & (1 << FP_REGNUM))
+ if (regmask & (1 << DEPRECATED_FP_REGNUM))
get_frame_saved_regs (frame)[SP_REGNUM] +=
4 + (4 * read_memory_integer (next_addr + 4, 4));
get_frame_saved_regs (frame)[PC_REGNUM] = get_frame_base (frame) + 16;
- get_frame_saved_regs (frame)[FP_REGNUM] = get_frame_base (frame) + 12;
+ get_frame_saved_regs (frame)[DEPRECATED_FP_REGNUM] = get_frame_base (frame) + 12;
get_frame_saved_regs (frame)[VAX_AP_REGNUM] = get_frame_base (frame) + 8;
get_frame_saved_regs (frame)[PS_REGNUM] = get_frame_base (frame) + 4;
}
@@ -252,19 +251,19 @@ vax_push_dummy_frame (void)
for (regnum = 11; regnum >= 0; regnum--)
sp = push_word (sp, read_register (regnum));
sp = push_word (sp, read_register (PC_REGNUM));
- sp = push_word (sp, read_register (FP_REGNUM));
+ sp = push_word (sp, read_register (DEPRECATED_FP_REGNUM));
sp = push_word (sp, read_register (VAX_AP_REGNUM));
sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) + 0x2fff0000);
sp = push_word (sp, 0);
write_register (SP_REGNUM, sp);
- write_register (FP_REGNUM, sp);
+ write_register (DEPRECATED_FP_REGNUM, sp);
write_register (VAX_AP_REGNUM, sp + (17 * 4));
}
static void
vax_pop_frame (void)
{
- CORE_ADDR fp = read_register (FP_REGNUM);
+ CORE_ADDR fp = read_register (DEPRECATED_FP_REGNUM);
int regnum;
int regmask = read_memory_integer (fp + 4, 4);
@@ -272,7 +271,7 @@ vax_pop_frame (void)
(regmask & 0xffff)
| (read_register (PS_REGNUM) & 0xffff0000));
write_register (PC_REGNUM, read_memory_integer (fp + 16, 4));
- write_register (FP_REGNUM, read_memory_integer (fp + 12, 4));
+ write_register (DEPRECATED_FP_REGNUM, read_memory_integer (fp + 12, 4));
write_register (VAX_AP_REGNUM, read_memory_integer (fp + 8, 4));
fp += 16;
for (regnum = 0; regnum < 12; regnum++)
@@ -622,12 +621,12 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Register info */
set_gdbarch_num_regs (gdbarch, VAX_NUM_REGS);
set_gdbarch_sp_regnum (gdbarch, VAX_SP_REGNUM);
- set_gdbarch_fp_regnum (gdbarch, VAX_FP_REGNUM);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, VAX_FP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, VAX_PC_REGNUM);
set_gdbarch_ps_regnum (gdbarch, VAX_PS_REGNUM);
set_gdbarch_register_name (gdbarch, vax_register_name);
- set_gdbarch_register_size (gdbarch, VAX_REGISTER_SIZE);
+ set_gdbarch_deprecated_register_size (gdbarch, VAX_REGISTER_SIZE);
set_gdbarch_register_bytes (gdbarch, VAX_REGISTER_BYTES);
set_gdbarch_register_byte (gdbarch, vax_register_byte);
set_gdbarch_register_raw_size (gdbarch, vax_register_raw_size);
@@ -667,10 +666,10 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_push_dummy_frame (gdbarch, vax_push_dummy_frame);
set_gdbarch_deprecated_pop_frame (gdbarch, vax_pop_frame);
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
- set_gdbarch_call_dummy_words (gdbarch, vax_call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof_vax_call_dummy_words);
- set_gdbarch_fix_call_dummy (gdbarch, vax_fix_call_dummy);
- set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 7);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, vax_call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof_vax_call_dummy_words);
+ set_gdbarch_deprecated_fix_call_dummy (gdbarch, vax_fix_call_dummy);
+ set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 7);
set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
@@ -696,5 +695,5 @@ _initialize_vax_tdep (void)
{
gdbarch_register (bfd_arch_vax, vax_gdbarch_init, NULL);
- tm_print_insn = vax_print_insn;
+ deprecated_tm_print_insn = vax_print_insn;
}
diff --git a/gdb/version.in b/gdb/version.in
index 47a3e49edaa..f67ef295d96 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-2003-04-19-cvs
+2003-05-09-cvs
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index f3c08e340d5..7dd5f1e11d2 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -935,7 +935,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
/* Register numbers of various important registers. */
set_gdbarch_sp_regnum (gdbarch, 7); /* %rsp */
- set_gdbarch_fp_regnum (gdbarch, 6); /* %rbp */
+ set_gdbarch_deprecated_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) */
@@ -954,7 +954,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
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_deprecated_register_size (gdbarch, 8);
/* Total amount of space needed to store our copies of the machine's
register (SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS +
@@ -977,7 +977,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_deprecated_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);
+ set_gdbarch_deprecated_target_read_fp (gdbarch, cfi_read_fp);
set_gdbarch_extract_return_value (gdbarch, x86_64_extract_return_value);
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index 2d3b7afe41c..d6aa0183e1e 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -1035,10 +1035,10 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_num_regs (gdbarch, E_NUM_REGS);
set_gdbarch_num_pseudo_regs (gdbarch, 0);
set_gdbarch_sp_regnum (gdbarch, E_SP_REGNUM);
- set_gdbarch_fp_regnum (gdbarch, E_FP_REGNUM);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, E_FP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
set_gdbarch_register_name (gdbarch, xstormy16_register_name);
- set_gdbarch_register_size (gdbarch, xstormy16_reg_size);
+ set_gdbarch_deprecated_register_size (gdbarch, xstormy16_reg_size);
set_gdbarch_register_bytes (gdbarch, E_ALL_REGS_SIZE);
set_gdbarch_register_byte (gdbarch, xstormy16_register_byte);
set_gdbarch_register_raw_size (gdbarch, xstormy16_register_raw_size);
@@ -1092,8 +1092,8 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch,
xstormy16_use_struct_convention);
- set_gdbarch_call_dummy_words (gdbarch, call_dummy_words);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_breakpoint_from_pc (gdbarch, xstormy16_breakpoint_from_pc);
set_gdbarch_char_signed (gdbarch, 0);
@@ -1130,5 +1130,5 @@ _initialize_xstormy16_tdep (void)
extern int print_insn_xstormy16 ();
register_gdbarch_init (bfd_arch_xstormy16, xstormy16_gdbarch_init);
- tm_print_insn = print_insn_xstormy16;
+ deprecated_tm_print_insn = print_insn_xstormy16;
}
diff --git a/include/ChangeLog b/include/ChangeLog
index 37bf7132a0f..b88ca788078 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,21 @@
+2003-05-09 Alan Modra <amodra@bigpond.net.au>
+
+ * xtensa-isa-internal.h (xtensa_isa_module_struct): Remove const on
+ gen_num_opcodes_fn return type.
+
+2003-05-07 Jason Merrill <jason@redhat.com>
+
+ * hashtab.h (iterative_hash): Prototype.
+ (iterative_hash_object): New macro.
+
+2003-04-28 H.J. Lu <hjl@gnu.org>
+
+ * bfdlink.h (bfd_link_info): Add relax_finalizing.
+
+2003-04-23 H.J. Lu <hjl@gnu.org>
+
+ * bfdlink.h (bfd_link_callbacks): Add error_handler.
+
2003-04-04 Svein E. Seldal <Svein.Seldal@solidas.com>
* coff/tic4x.h: Namespace cleanup. Replace s/c4x/tic4x
diff --git a/include/bfdlink.h b/include/bfdlink.h
index c25826207c5..380923a9792 100644
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -288,6 +288,9 @@ struct bfd_link_info
/* TRUE if global symbols in discarded sections should be stripped. */
unsigned int strip_discarded: 1;
+ /* TRUE if relaxation is being finalized. */
+ unsigned int relax_finalizing: 1;
+
/* Which symbols to strip. */
enum bfd_link_strip strip;
@@ -481,6 +484,11 @@ struct bfd_link_callbacks
bfd_boolean (*notice)
PARAMS ((struct bfd_link_info *, const char *name,
bfd *abfd, asection *section, bfd_vma address));
+ /* A function which is called for reporting a linker error. ID is the
+ error identifier. The remaining input is the same as einfo () in
+ ld. */
+ bfd_boolean (*error_handler)
+ PARAMS ((int id, const char * fmt, ...));
};
/* The linker builds link_order structures which tell the code how to
diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog
index 353eb599149..b6db3064d4f 100644
--- a/include/coff/ChangeLog
+++ b/include/coff/ChangeLog
@@ -1,3 +1,8 @@
+2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
+
+ * coff/h8300.h (H8300HNMAGIC, H8300SNMAGIC): New.
+ (H8300HNBADMAG, H8300SNBADMAG): New.
+
2003-04-15 Rohit Kumar Srivastava <rohits@kpitcummins.com>
* sh.h: Replace occurrances of 'Hitachi' with 'Renesas'.
diff --git a/include/coff/h8300.h b/include/coff/h8300.h
index c30dc009709..908848c181f 100644
--- a/include/coff/h8300.h
+++ b/include/coff/h8300.h
@@ -22,12 +22,16 @@
#define H8300MAGIC 0x8300
#define H8300HMAGIC 0x8301
#define H8300SMAGIC 0x8302
+#define H8300HNMAGIC 0x8303
+#define H8300SNMAGIC 0x8304
-#define H8300BADMAG(x) (((x).f_magic != H8300MAGIC))
-#define H8300HBADMAG(x) (((x).f_magic != H8300HMAGIC))
-#define H8300SBADMAG(x) (((x).f_magic != H8300SMAGIC))
+#define H8300BADMAG(x) (((x).f_magic != H8300MAGIC))
+#define H8300HBADMAG(x) (((x).f_magic != H8300HMAGIC))
+#define H8300SBADMAG(x) (((x).f_magic != H8300SMAGIC))
+#define H8300HNBADMAG(x) (((x).f_magic != H8300HNMAGIC))
+#define H8300SNBADMAG(x) (((x).f_magic != H8300SNMAGIC))
-/********************** RELOCATION DIRECTIVES **********************/
+/* Relocation directives. */
/* The external reloc has an offset field, because some of the reloc
types on the h8 don't have room in the instruction for the entire
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index b84eac52821..945ce63bc71 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,16 @@
+2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
+
+ * elf/h8.h (E_H8_MACH_H8300HN, E_H8_MACH_H8300SN): New
+
+2003-04-23 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * common.h (EM_SH): Amend comment to refer to SuperH.
+
+2003-04-22 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * common.h: Replace references to Mitsubishi M32R with
+ references to Renesas M32R.
+
2003-04-15 Rohit Kumar Srivastava <rohits@kpitcummins.com>
* common.h: Replace occurrances of 'Hitachi' with 'Renesas'.
diff --git a/include/elf/common.h b/include/elf/common.h
index 02665b71555..ca793428601 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -126,7 +126,7 @@
#define EM_RCE 39 /* Old name for MCore */
#define EM_ARM 40 /* ARM */
#define EM_OLD_ALPHA 41 /* Digital Alpha */
-#define EM_SH 42 /* Renesas (formerly Hitachi) SH */
+#define EM_SH 42 /* Renesas (formerly Hitachi) / SuperH SH */
#define EM_SPARCV9 43 /* SPARC v9 64-bit */
#define EM_TRICORE 44 /* Siemens Tricore embedded processor */
#define EM_ARC 45 /* ARC Cores */
@@ -172,7 +172,7 @@
#define EM_D10V 85 /* Mitsubishi D10V */
#define EM_D30V 86 /* Mitsubishi D30V */
#define EM_V850 87 /* NEC v850 */
-#define EM_M32R 88 /* Mitsubishi M32R */
+#define EM_M32R 88 /* Renesas M32R (formerly Mitsubishi M32R) */
#define EM_MN10300 89 /* Matsushita MN10300 */
#define EM_MN10200 90 /* Matsushita MN10200 */
#define EM_PJ 91 /* picoJava */
diff --git a/include/elf/h8.h b/include/elf/h8.h
index ac9db566a48..5fdf62c500e 100644
--- a/include/elf/h8.h
+++ b/include/elf/h8.h
@@ -1,5 +1,5 @@
/* H8300/h8500 ELF support for BFD.
- Copyright 2001 Free Software Foundation, Inc.
+ Copyright 2001, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -92,5 +92,7 @@ END_RELOC_NUMBERS (R_H8_max)
#define E_H8_MACH_H8300 0x00800000
#define E_H8_MACH_H8300H 0x00810000
#define E_H8_MACH_H8300S 0x00820000
+#define E_H8_MACH_H8300HN 0x00830000
+#define E_H8_MACH_H8300SN 0x00840000
#endif
diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog
index 9a216a0f3e2..77a8551a460 100644
--- a/include/gdb/ChangeLog
+++ b/include/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2003-05-07 Andrew Cagney <cagney@redhat.com>
+
+ * sim-d10v.h (sim_d10v_translate_addr): Add regcache parameter.
+ (sim_d10v_translate_imap_addr): Add regcache parameter.
+ (sim_d10v_translate_dmap_addr): Ditto.
+
2003-03-27 Nick Clifton <nickc@redhat.com>
* sim-arm.h (sim_arm_regs): Add iWMMXt registers.
diff --git a/include/gdb/sim-d10v.h b/include/gdb/sim-d10v.h
index f153a419478..8294b14858b 100644
--- a/include/gdb/sim-d10v.h
+++ b/include/gdb/sim-d10v.h
@@ -58,20 +58,23 @@ extern unsigned long sim_d10v_translate_dmap_addr
(unsigned long offset,
int nr_bytes,
unsigned long *phys,
- unsigned long (*dmap_register) (int reg_nr));
+ void *regcache,
+ unsigned long (*dmap_register) (void *regcache, int reg_nr));
extern unsigned long sim_d10v_translate_imap_addr
(unsigned long offset,
int nr_bytes,
unsigned long *phys,
- unsigned long (*imap_register) (int reg_nr));
+ void *regcache,
+ unsigned long (*imap_register) (void *regcache, int reg_nr));
extern unsigned long sim_d10v_translate_addr
(unsigned long vaddr,
int nr_bytes,
unsigned long *phys,
- unsigned long (*dmap_register) (int reg_nr),
- unsigned long (*imap_register) (int reg_nr));
+ void *regcache,
+ unsigned long (*dmap_register) (void *regcache, int reg_nr),
+ unsigned long (*imap_register) (void *regcache, int reg_nr));
/* The simulator makes use of the following register information. */
diff --git a/include/hashtab.h b/include/hashtab.h
index 7acb5eb2859..f7bd4ae69d3 100644
--- a/include/hashtab.h
+++ b/include/hashtab.h
@@ -183,6 +183,11 @@ extern htab_eq htab_eq_pointer;
/* A hash function for null-terminated strings. */
extern hashval_t htab_hash_string PARAMS ((const PTR));
+/* An iterative hash function for arbitrary data. */
+extern hashval_t iterative_hash PARAMS ((const PTR, size_t, hashval_t));
+/* Shorthand for hashing something with an intrinsic size. */
+#define iterative_hash_object(OB,INIT) iterative_hash (&OB, sizeof (OB), INIT)
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/include/xtensa-isa-internal.h b/include/xtensa-isa-internal.h
index d2244c510a5..7f221eae48e 100644
--- a/include/xtensa-isa-internal.h
+++ b/include/xtensa-isa-internal.h
@@ -104,7 +104,7 @@ typedef struct xtensa_isa_internal_struct
typedef struct xtensa_isa_module_struct
{
- const int (*get_num_opcodes_fn) (void);
+ int (*get_num_opcodes_fn) (void);
xtensa_opcode_internal **(*get_opcodes_fn) (void);
int (*decode_insn_fn) (const xtensa_insnbuf);
struct config_struct *(*get_config_table_fn) (void);
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 027fe91c0f1..066980339ba 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,29 @@
+2003-05-07 Josef Zlomek <zlomekj@suse.cz>
+
+ * splay-tree.c (splay_tree_predecessor): Fix comment.
+ (splay_tree_successor): Fix comment.
+
+2003-05-07 Jason Merrill <jason@redhat.com>
+
+ * hashtab.c (iterative_hash): New fn.
+ * configure.in: Add AC_C_BIGENDIAN_CROSS.
+ * aclocal.m4: Include accross.m4.
+ * configure, config.in: Regenerate.
+
+2003-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * configure.in (AC_CHECK_FUNCS): Don't make multiple calls.
+ * configure: Regenerate.
+
+2003-05-03 Carlo Wood <carlo@alinoe.com>
+
+ * cp-demangle.c: Fix typo in "char_traints" string-literal.
+
+2003-04-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * vsnprintf.c (vsnprintf): Don't pad string with extra nulls.
+ (main): Test that we don't write too much data.
+
2003-04-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.in (funcs, AC_CHECK_FUNCS): Add snprintf and
diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
index 6c5dc6ac64b..a3349f3b08f 100644
--- a/libiberty/aclocal.m4
+++ b/libiberty/aclocal.m4
@@ -1,3 +1,5 @@
+sinclude(../config/accross.m4)
+
dnl See whether strncmp reads past the end of its string parameters.
dnl On some versions of SunOS4 at least, strncmp reads a word at a time
dnl but erroneously reads past the end of strings. This can cause
diff --git a/libiberty/config.in b/libiberty/config.in
index 1cc6d6132e5..14ab3793c5c 100644
--- a/libiberty/config.in
+++ b/libiberty/config.in
@@ -291,6 +291,16 @@
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* whether byteorder is bigendian */
+#undef WORDS_BIGENDIAN
+
+/* Define if the host machine stores words of multi-word integers in
+ big-endian order. */
+#undef HOST_WORDS_BIG_ENDIAN
+
+/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
+#undef BYTEORDER
+
/* Define if errno must be declared even when <errno.h> is included. */
#undef NEED_DECLARATION_ERRNO
diff --git a/libiberty/configure b/libiberty/configure
index f1ba0c85832..d0899a2dcbb 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -1198,6 +1198,142 @@ EOF
;;
esac
+echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
+echo "configure:1203: checking whether byte ordering is bigendian" >&5
+if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_cv_c_bigendian=unknown
+# See if sys/param.h defines the BYTE_ORDER macro.
+cat > conftest.$ac_ext <<EOF
+#line 1210 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/param.h>
+int main() {
+
+#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
+ bogus endian macros
+#endif
+; return 0; }
+EOF
+if { (eval echo configure:1221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+cat > conftest.$ac_ext <<EOF
+#line 1225 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/param.h>
+int main() {
+
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+#endif
+; return 0; }
+EOF
+if { (eval echo configure:1236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_bigendian=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_c_bigendian=no
+fi
+rm -f conftest*
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+if test $ac_cv_c_bigendian = unknown; then
+if test "$cross_compiling" = yes; then
+ echo $ac_n "cross-compiling... " 2>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1256 "configure"
+#include "confdefs.h"
+main () {
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long l;
+ char c[sizeof (long)];
+ } u;
+ u.l = 1;
+ exit (u.c[sizeof (long) - 1] == 1);
+}
+EOF
+if { (eval echo configure:1269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_c_bigendian=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_c_bigendian=yes
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_c_bigendian" 1>&6
+if test $ac_cv_c_bigendian = unknown; then
+echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
+echo "configure:1287: checking to probe for byte ordering" >&5
+
+cat >conftest.c <<EOF
+short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; }
+short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; }
+int main() { _ascii (); _ebcdic (); return 0; }
+EOF
+ if test -f conftest.c ; then
+ if ${CC-cc} ${CFLAGS} conftest.c -o conftest.o && test -f conftest.o ; then
+ if test `grep -l BIGenDianSyS conftest.o` ; then
+ echo $ac_n ' big endian probe OK, ' 1>&6
+ ac_cv_c_bigendian=yes
+ fi
+ if test `grep -l LiTTleEnDian conftest.o` ; then
+ echo $ac_n ' little endian probe OK, ' 1>&6
+ if test $ac_cv_c_bigendian = yes ; then
+ ac_cv_c_bigendian=unknown;
+ else
+ ac_cv_c_bigendian=no
+ fi
+ fi
+ echo $ac_n 'guessing bigendian ... ' >&6
+ fi
+ fi
+echo "$ac_t""$ac_cv_c_bigendian" 1>&6
+fi
+if test $ac_cv_c_bigendian = yes; then
+ cat >> confdefs.h <<\EOF
+#define WORDS_BIGENDIAN 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define HOST_WORDS_BIG_ENDIAN 1
+EOF
+
+ BYTEORDER=4321
+else
+ BYTEORDER=1234
+fi
+cat >> confdefs.h <<EOF
+#define BYTEORDER $BYTEORDER
+EOF
+
+if test $ac_cv_c_bigendian = unknown; then
+ { echo "configure: error: unknown endianess - sorry" 1>&2; exit 1; }
+fi
+
@@ -1216,7 +1352,7 @@ esac
# 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:1220: checking for a BSD compatible install" >&5
+echo "configure:1356: 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
@@ -1277,7 +1413,7 @@ host_makefile_frag=${frag}
# able to link anything, it had better be able to at least compile
# something.
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1281: checking how to run the C preprocessor" >&5
+echo "configure:1417: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1292,13 +1428,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 1296 "configure"
+#line 1432 "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:1302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1438: \"$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
:
@@ -1309,13 +1445,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1313 "configure"
+#line 1449 "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:1319: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1455: \"$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
:
@@ -1326,13 +1462,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1330 "configure"
+#line 1466 "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:1336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1472: \"$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
:
@@ -1360,17 +1496,17 @@ for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1364: checking for $ac_hdr" >&5
+echo "configure:1500: 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 1369 "configure"
+#line 1505 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1510: \"$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*
@@ -1397,12 +1533,12 @@ fi
done
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1401: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1537: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1406 "configure"
+#line 1542 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -1418,7 +1554,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:1422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -1439,12 +1575,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1443: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1579: 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 1448 "configure"
+#line 1584 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -1453,7 +1589,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:1457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -1475,19 +1611,19 @@ fi
echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6
-echo "configure:1479: checking whether errno must be declared" >&5
+echo "configure:1615: checking whether errno must be declared" >&5
if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1484 "configure"
+#line 1620 "configure"
#include "confdefs.h"
#include <errno.h>
int main() {
int x = errno;
; return 0; }
EOF
-if { (eval echo configure:1491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libiberty_cv_declare_errno=no
else
@@ -1509,12 +1645,12 @@ fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1513: checking for ANSI C header files" >&5
+echo "configure:1649: 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 1518 "configure"
+#line 1654 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1522,7 +1658,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1662: \"$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*
@@ -1539,7 +1675,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 1543 "configure"
+#line 1679 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1557,7 +1693,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 1561 "configure"
+#line 1697 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1578,7 +1714,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1582 "configure"
+#line 1718 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1589,7 +1725,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1613,12 +1749,12 @@ EOF
fi
echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6
-echo "configure:1617: checking for uintptr_t" >&5
+echo "configure:1753: checking for uintptr_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1622 "configure"
+#line 1758 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1654,12 +1790,12 @@ EOF
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1658: checking for pid_t" >&5
+echo "configure:1794: 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 1663 "configure"
+#line 1799 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1748,455 +1884,23 @@ checkfuncs="$checkfuncs getsysinfo table sysctl"
# These are neither executed nor required, but they help keep
# autoheader happy without adding a bunch of text to acconfig.h.
if test "x" = "y"; then
- for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1755: 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 1760 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
- for ac_func in getcwd getpagesize index insque mkstemps memchr memcmp memcpy
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1810: 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 1815 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
- for ac_func in memmove mempcpy memset putenv random rename rindex sigsetmask
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1865: 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 1870 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
- for ac_func in strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1920: 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 1925 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
- for ac_func in strtod strtol strtoul tmpnam vasprintf vfprintf vprintf
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1975: 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 1980 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:2003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
- for ac_func in vsprintf waitpid getrusage on_exit psignal strerror strsignal
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2030: 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 2035 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:2058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
- for ac_func in sysconf times sbrk gettimeofday ffs snprintf vsnprintf
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2085: 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 2090 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:2113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
- for ac_func in pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2140: 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 2145 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
- for ac_func in realpath canonicalize_file_name
+ for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock \
+ getcwd getpagesize index insque mkstemps memchr memcmp memcpy \
+ memmove mempcpy memset putenv random rename rindex sigsetmask \
+ strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr \
+ strtod strtol strtoul tmpnam vasprintf vfprintf vprintf \
+ vsprintf waitpid getrusage on_exit psignal strerror strsignal \
+ sysconf times sbrk gettimeofday ffs snprintf vsnprintf \
+ pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl \
+ realpath canonicalize_file_name
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2195: checking for $ac_func" >&5
+echo "configure:1899: 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 2200 "configure"
+#line 1904 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2219,7 +1923,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1927: \"$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
@@ -2453,7 +2157,7 @@ if test -z "${setobjs}"; then
# We haven't set the list of objects yet. Use the standard autoconf
# tests. This will only work if the compiler works.
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2457: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2161: 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.
@@ -2464,12 +2168,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 2468 "configure"
+#line 2172 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:2473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2177: \"$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
@@ -2495,19 +2199,19 @@ 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:2499: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2203: 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
for ac_func in $funcs
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2506: checking for $ac_func" >&5
+echo "configure:2210: 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 2511 "configure"
+#line 2215 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2530,7 +2234,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2557,12 +2261,12 @@ done
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2561: checking whether alloca needs Cray hooks" >&5
+echo "configure:2265: 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 2566 "configure"
+#line 2270 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -2587,12 +2291,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:2591: checking for $ac_func" >&5
+echo "configure:2295: 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 2596 "configure"
+#line 2300 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2615,7 +2319,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2323: \"$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
@@ -2641,7 +2345,7 @@ fi
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2645: checking stack direction for C alloca" >&5
+echo "configure:2349: 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
@@ -2649,7 +2353,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2653 "configure"
+#line 2357 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2668,7 +2372,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2376: \"$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
@@ -2690,17 +2394,17 @@ EOF
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2694: checking for vfork.h" >&5
+echo "configure:2398: 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 2699 "configure"
+#line 2403 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2408: \"$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*
@@ -2725,18 +2429,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2729: checking for working vfork" >&5
+echo "configure:2433: 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:2735: checking for vfork" >&5
+echo "configure:2439: 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 2740 "configure"
+#line 2444 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -2759,7 +2463,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:2763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2467: \"$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
@@ -2781,7 +2485,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 2785 "configure"
+#line 2489 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -2876,7 +2580,7 @@ main() {
}
}
EOF
-if { (eval echo configure:2880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2584: \"$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
@@ -2908,12 +2612,12 @@ fi
for ac_func in _doprnt
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2912: checking for $ac_func" >&5
+echo "configure:2616: 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 2917 "configure"
+#line 2621 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2936,7 +2640,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2644: \"$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
@@ -2966,12 +2670,12 @@ done
for ac_func in _doprnt
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2970: checking for $ac_func" >&5
+echo "configure:2674: 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 2975 "configure"
+#line 2679 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2994,7 +2698,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2702: \"$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
@@ -3022,19 +2726,19 @@ done
for v in $vars; do
echo $ac_n "checking for $v""... $ac_c" 1>&6
-echo "configure:3026: checking for $v" >&5
+echo "configure:2730: checking for $v" >&5
if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3031 "configure"
+#line 2735 "configure"
#include "confdefs.h"
int *p;
int main() {
extern int $v []; p = $v;
; return 0; }
EOF
-if { (eval echo configure:3038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "libiberty_cv_var_$v=yes"
else
@@ -3060,12 +2764,12 @@ EOF
for ac_func in $checkfuncs
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3064: checking for $ac_func" >&5
+echo "configure:2768: 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 3069 "configure"
+#line 2773 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3088,7 +2792,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2796: \"$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
@@ -3113,12 +2817,12 @@ fi
done
echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
-echo "configure:3117: checking whether canonicalize_file_name must be declared" >&5
+echo "configure:2821: checking whether canonicalize_file_name must be declared" >&5
if eval "test \"`echo '$''{'libiberty_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3122 "configure"
+#line 2826 "configure"
#include "confdefs.h"
#include "confdefs.h"
@@ -3140,7 +2844,7 @@ int main() {
char *(*pfn) = (char *(*)) canonicalize_file_name
; return 0; }
EOF
-if { (eval echo configure:3144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libiberty_cv_decl_needed_canonicalize_file_name=no
else
@@ -3176,17 +2880,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3180: checking for $ac_hdr" >&5
+echo "configure:2884: 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 3185 "configure"
+#line 2889 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2894: \"$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*
@@ -3215,12 +2919,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3219: checking for $ac_func" >&5
+echo "configure:2923: 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 3224 "configure"
+#line 2928 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3243,7 +2947,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2951: \"$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
@@ -3268,7 +2972,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3272: checking for working mmap" >&5
+echo "configure:2976: 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
@@ -3276,7 +2980,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 3280 "configure"
+#line 2984 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3416,7 +3120,7 @@ main()
}
EOF
-if { (eval echo configure:3420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3124: \"$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
@@ -3440,7 +3144,7 @@ fi
echo $ac_n "checking for working strncmp""... $ac_c" 1>&6
-echo "configure:3444: checking for working strncmp" >&5
+echo "configure:3148: checking for working strncmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3448,7 +3152,7 @@ else
ac_cv_func_strncmp_works=no
else
cat > conftest.$ac_ext <<EOF
-#line 3452 "configure"
+#line 3156 "configure"
#include "confdefs.h"
/* Test by Jim Wilson and Kaveh Ghazi.
@@ -3512,7 +3216,7 @@ main ()
}
EOF
-if { (eval echo configure:3516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_strncmp_works=yes
else
diff --git a/libiberty/configure.in b/libiberty/configure.in
index e142cf501c8..4a704e8cec2 100644
--- a/libiberty/configure.in
+++ b/libiberty/configure.in
@@ -114,6 +114,7 @@ AC_SUBST(OUTPUT_OPTION)
AC_ISC_POSIX
AC_C_CONST
AC_C_INLINE
+AC_C_BIGENDIAN_CROSS
dnl When we start using libtool:
dnl Default to a non shared library. This may be overridden by the
@@ -217,15 +218,15 @@ checkfuncs="$checkfuncs getsysinfo table sysctl"
# These are neither executed nor required, but they help keep
# autoheader happy without adding a bunch of text to acconfig.h.
if test "x" = "y"; then
- AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock)
- AC_CHECK_FUNCS(getcwd getpagesize index insque mkstemps memchr memcmp memcpy)
- AC_CHECK_FUNCS(memmove mempcpy memset putenv random rename rindex sigsetmask)
- AC_CHECK_FUNCS(strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr)
- AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf)
- AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal)
- AC_CHECK_FUNCS(sysconf times sbrk gettimeofday ffs snprintf vsnprintf)
- AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl)
- AC_CHECK_FUNCS(realpath canonicalize_file_name)
+ AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock \
+ getcwd getpagesize index insque mkstemps memchr memcmp memcpy \
+ memmove mempcpy memset putenv random rename rindex sigsetmask \
+ strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr \
+ strtod strtol strtoul tmpnam vasprintf vfprintf vprintf \
+ vsprintf waitpid getrusage on_exit psignal strerror strsignal \
+ sysconf times sbrk gettimeofday ffs snprintf vsnprintf \
+ pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl \
+ realpath canonicalize_file_name)
AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.])
AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.])
AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.])
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 9adf5fd0503..5dcce5560ee 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -3398,7 +3398,7 @@ demangle_substitution (dm, template_p)
}
else
{
- RETURN_IF_ERROR (result_add (dm, "std::basic_istream<char, std::char_traints<char> >"));
+ RETURN_IF_ERROR (result_add (dm, "std::basic_istream<char, std::char_traits<char> >"));
new_last_source_name = "basic_istream";
}
*template_p = 0;
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index 32067afb5b8..3896328717a 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -709,3 +709,141 @@ htab_hash_string (p)
return r;
}
+
+/* DERIVED FROM:
+--------------------------------------------------------------------
+lookup2.c, by Bob Jenkins, December 1996, Public Domain.
+hash(), hash2(), hash3, and mix() are externally useful functions.
+Routines to test the hash are included if SELF_TEST is defined.
+You can use this free for any purpose. It has no warranty.
+--------------------------------------------------------------------
+*/
+
+/*
+--------------------------------------------------------------------
+mix -- mix 3 32-bit values reversibly.
+For every delta with one or two bit set, and the deltas of all three
+ high bits or all three low bits, whether the original value of a,b,c
+ is almost all zero or is uniformly distributed,
+* If mix() is run forward or backward, at least 32 bits in a,b,c
+ have at least 1/4 probability of changing.
+* If mix() is run forward, every bit of c will change between 1/3 and
+ 2/3 of the time. (Well, 22/100 and 78/100 for some 2-bit deltas.)
+mix() was built out of 36 single-cycle latency instructions in a
+ structure that could supported 2x parallelism, like so:
+ a -= b;
+ a -= c; x = (c>>13);
+ b -= c; a ^= x;
+ b -= a; x = (a<<8);
+ c -= a; b ^= x;
+ c -= b; x = (b>>13);
+ ...
+ Unfortunately, superscalar Pentiums and Sparcs can't take advantage
+ of that parallelism. They've also turned some of those single-cycle
+ latency instructions into multi-cycle latency instructions. Still,
+ this is the fastest good hash I could find. There were about 2^^68
+ to choose from. I only looked at a billion or so.
+--------------------------------------------------------------------
+*/
+/* same, but slower, works on systems that might have 8 byte hashval_t's */
+#define mix(a,b,c) \
+{ \
+ a -= b; a -= c; a ^= (c>>13); \
+ b -= c; b -= a; b ^= (a<< 8); \
+ c -= a; c -= b; c ^= ((b&0xffffffff)>>13); \
+ a -= b; a -= c; a ^= ((c&0xffffffff)>>12); \
+ b -= c; b -= a; b = (b ^ (a<<16)) & 0xffffffff; \
+ c -= a; c -= b; c = (c ^ (b>> 5)) & 0xffffffff; \
+ a -= b; a -= c; a = (a ^ (c>> 3)) & 0xffffffff; \
+ b -= c; b -= a; b = (b ^ (a<<10)) & 0xffffffff; \
+ c -= a; c -= b; c = (c ^ (b>>15)) & 0xffffffff; \
+}
+
+/*
+--------------------------------------------------------------------
+hash() -- hash a variable-length key into a 32-bit value
+ k : the key (the unaligned variable-length array of bytes)
+ len : the length of the key, counting by bytes
+ level : can be any 4-byte value
+Returns a 32-bit value. Every bit of the key affects every bit of
+the return value. Every 1-bit and 2-bit delta achieves avalanche.
+About 36+6len instructions.
+
+The best hash table sizes are powers of 2. There is no need to do
+mod a prime (mod is sooo slow!). If you need less than 32 bits,
+use a bitmask. For example, if you need only 10 bits, do
+ h = (h & hashmask(10));
+In which case, the hash table should have hashsize(10) elements.
+
+If you are hashing n strings (ub1 **)k, do it like this:
+ for (i=0, h=0; i<n; ++i) h = hash( k[i], len[i], h);
+
+By Bob Jenkins, 1996. bob_jenkins@burtleburtle.net. You may use this
+code any way you wish, private, educational, or commercial. It's free.
+
+See http://burtleburtle.net/bob/hash/evahash.html
+Use for hash table lookup, or anything where one collision in 2^32 is
+acceptable. Do NOT use for cryptographic purposes.
+--------------------------------------------------------------------
+*/
+
+hashval_t iterative_hash (k_in, length, initval)
+ const PTR k_in; /* the key */
+ register size_t length; /* the length of the key */
+ register hashval_t initval; /* the previous hash, or an arbitrary value */
+{
+ register const unsigned char *k = (const unsigned char *)k_in;
+ register hashval_t a,b,c,len;
+
+ /* Set up the internal state */
+ len = length;
+ a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */
+ c = initval; /* the previous hash value */
+
+ /*---------------------------------------- handle most of the key */
+#ifndef WORDS_BIGENDIAN
+ /* On a little-endian machine, if the data is 4-byte aligned we can hash
+ by word for better speed. This gives nondeterministic results on
+ big-endian machines. */
+ if (sizeof (hashval_t) == 4 && (((size_t)k)&3) == 0)
+ while (len >= 12) /* aligned */
+ {
+ a += *(hashval_t *)(k+0);
+ b += *(hashval_t *)(k+4);
+ c += *(hashval_t *)(k+8);
+ mix(a,b,c);
+ k += 12; len -= 12;
+ }
+ else /* unaligned */
+#endif
+ while (len >= 12)
+ {
+ a += (k[0] +((hashval_t)k[1]<<8) +((hashval_t)k[2]<<16) +((hashval_t)k[3]<<24));
+ b += (k[4] +((hashval_t)k[5]<<8) +((hashval_t)k[6]<<16) +((hashval_t)k[7]<<24));
+ c += (k[8] +((hashval_t)k[9]<<8) +((hashval_t)k[10]<<16)+((hashval_t)k[11]<<24));
+ mix(a,b,c);
+ k += 12; len -= 12;
+ }
+
+ /*------------------------------------- handle the last 11 bytes */
+ c += length;
+ switch(len) /* all the case statements fall through */
+ {
+ case 11: c+=((hashval_t)k[10]<<24);
+ case 10: c+=((hashval_t)k[9]<<16);
+ case 9 : c+=((hashval_t)k[8]<<8);
+ /* the first byte of c is reserved for the length */
+ case 8 : b+=((hashval_t)k[7]<<24);
+ case 7 : b+=((hashval_t)k[6]<<16);
+ case 6 : b+=((hashval_t)k[5]<<8);
+ case 5 : b+=k[4];
+ case 4 : a+=((hashval_t)k[3]<<24);
+ case 3 : a+=((hashval_t)k[2]<<16);
+ case 2 : a+=((hashval_t)k[1]<<8);
+ case 1 : a+=k[0];
+ /* case 0: nothing left to add */
+ }
+ mix(a,b,c);
+ /*-------------------------------------------- report the result */
+ return c;
+}
diff --git a/libiberty/splay-tree.c b/libiberty/splay-tree.c
index 6f90fde05fb..fc98db167f3 100644
--- a/libiberty/splay-tree.c
+++ b/libiberty/splay-tree.c
@@ -472,7 +472,7 @@ splay_tree_predecessor (sp, key)
if (comparison < 0)
return sp->root;
- /* Otherwise, find the leftmost element of the right subtree. */
+ /* Otherwise, find the rightmost element of the left subtree. */
node = sp->root->left;
if (node)
while (node->right)
@@ -505,7 +505,7 @@ splay_tree_successor (sp, key)
if (comparison > 0)
return sp->root;
- /* Otherwise, find the rightmost element of the left subtree. */
+ /* Otherwise, find the leftmost element of the right subtree. */
node = sp->root->right;
if (node)
while (node->left)
diff --git a/libiberty/vsnprintf.c b/libiberty/vsnprintf.c
index 9328e430097..fd3dd18a91c 100644
--- a/libiberty/vsnprintf.c
+++ b/libiberty/vsnprintf.c
@@ -78,9 +78,13 @@ vsnprintf (s, n, format, ap)
result = strlen (buf);
if (n > 0)
{
- strncpy (s, buf, n);
- if (n - 1 < (size_t) result)
- s[n - 1] = 0;
+ if ((long) n > result)
+ memcpy (s, buf, result+1);
+ else
+ {
+ memcpy (s, buf, n-1);
+ s[n - 1] = 0;
+ }
}
free (buf);
return result;
@@ -114,35 +118,35 @@ main ()
CLEAR (buf);
status = checkit (buf, 10, "%s:%d", "foobar", 9);
- VERIFY (status==8 && strcmp (buf, "foobar:9") == 0);
+ VERIFY (status==8 && memcmp (buf, "foobar:9\0XXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 9, "%s:%d", "foobar", 9);
- VERIFY (status==8 && strcmp (buf, "foobar:9") == 0);
+ VERIFY (status==8 && memcmp (buf, "foobar:9\0XXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 8, "%s:%d", "foobar", 9);
- VERIFY (status==8 && strcmp (buf, "foobar:") == 0);
+ VERIFY (status==8 && memcmp (buf, "foobar:\0XXXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 7, "%s:%d", "foobar", 9);
- VERIFY (status==8 && strcmp (buf, "foobar") == 0);
+ VERIFY (status==8 && memcmp (buf, "foobar\0XXXXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 6, "%s:%d", "foobar", 9);
- VERIFY (status==8 && strcmp (buf, "fooba") == 0);
+ VERIFY (status==8 && memcmp (buf, "fooba\0XXXXXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 2, "%s:%d", "foobar", 9);
- VERIFY (status==8 && strcmp (buf, "f") == 0);
+ VERIFY (status==8 && memcmp (buf, "f\0XXXXXXXXXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 1, "%s:%d", "foobar", 9);
- VERIFY (status==8 && strcmp (buf, "") == 0);
+ VERIFY (status==8 && memcmp (buf, "\0XXXXXXXXXXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 0, "%s:%d", "foobar", 9);
- VERIFY (status==8 && strcmp (buf, "XXXXXXXXXXXXXX") == 0);
+ VERIFY (status==8 && memcmp (buf, "XXXXXXXXXXXXXX\0", 15) == 0);
return 0;
}
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 8148ca9ff4a..97ae91eb3d0 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,26 @@
+2003-05-09 Alan Modra <amodra@bigpond.net.au>
+
+ * i386-dis.c (print_insn): Test intel_syntax against (char) -1 in
+ case char is unsigned.
+
+2003-05-01 Christian Groessler <chris@groessler.org>
+
+ * z8k-dis.c (z8k_lookup_instr): Optimize FETCH_DATA calls.
+ (unpack_instr): Fix representation of segmented addresses.
+ (intr_name): Added, contains names of the parameters to the EI/DI
+ instructions.
+ (unparse_instr): Fix display of EI/DI parameters.
+
+2003-04-22 Doug Evans <dje@sebabeach.org>
+
+ * fr30-desc.c,fr30-desc.h,fr30-opc.c,fr30-opc.h: Regenerate.
+ * frv-desc.c,frv-desc.h,frv-opc.c,frv-opc.h: Regenerate.
+ * ip2k-desc.c,ip2k-desc.h,ip2k-opc.c,ip2k-opc.h: Regenerate.
+ * m32r-desc.c,m32r-desc.h,m32r-opc.c,m32r-opc.h: Regenerate.
+ * m32r-opinst.c: Regenerate.
+ * openrisc-desc.c,openrisc-desc.h,openrisc-opc.c,openrisc-opc.h: Regenerate.
+ * xstormy16-desc.c,xstormy16-desc.h,xstormy16-opc.c,xstormy16-opc.h: Regenerate.
+
2003-04-15 Rohit Kumar Srivastava <rohits@kpitcummins.com>
* h8500-opc.c: Replace occurrances of 'Hitachi' with 'Renesas'.
diff --git a/opcodes/fr30-desc.c b/opcodes/fr30-desc.c
index a263da7206e..01d896f28ea 100644
--- a/opcodes/fr30-desc.c
+++ b/opcodes/fr30-desc.c
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/fr30-desc.h b/opcodes/fr30-desc.h
index 41de0bbb286..6be96d933ab 100644
--- a/opcodes/fr30-desc.h
+++ b/opcodes/fr30-desc.h
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/fr30-opc.c b/opcodes/fr30-opc.c
index b47cbcd1d6f..34c51566369 100644
--- a/opcodes/fr30-opc.c
+++ b/opcodes/fr30-opc.c
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/fr30-opc.h b/opcodes/fr30-opc.h
index 2b89a906599..bfa2427626e 100644
--- a/opcodes/fr30-opc.h
+++ b/opcodes/fr30-opc.h
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/frv-desc.c b/opcodes/frv-desc.c
index 54bed6bad7a..5fac77a0dd7 100644
--- a/opcodes/frv-desc.c
+++ b/opcodes/frv-desc.c
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
@@ -1826,6 +1826,7 @@ const CGEN_IFLD frv_cgen_ifld_table[] =
{ FRV_F_S5, "f-s5", 0, 32, 4, 5, { 0, { (1<<MACH_BASE) } } },
{ FRV_F_U12_H, "f-u12-h", 0, 32, 17, 6, { 0, { (1<<MACH_BASE) } } },
{ FRV_F_U12_L, "f-u12-l", 0, 32, 5, 6, { 0, { (1<<MACH_BASE) } } },
+ { FRV_F_U12, "f-u12", 0, 0, 0, 0,{ 0|A(VIRTUAL), { (1<<MACH_BASE) } } },
{ FRV_F_INT_CC, "f-int-cc", 0, 32, 30, 4, { 0, { (1<<MACH_BASE) } } },
{ FRV_F_FLT_CC, "f-flt-cc", 0, 32, 30, 4, { 0, { (1<<MACH_BASE) } } },
{ FRV_F_COND, "f-cond", 0, 32, 8, 1, { 0, { (1<<MACH_BASE) } } },
@@ -1838,9 +1839,11 @@ const CGEN_IFLD frv_cgen_ifld_table[] =
{ FRV_F_AE, "f-ae", 0, 32, 25, 1, { 0, { (1<<MACH_BASE) } } },
{ FRV_F_SPR_H, "f-spr-h", 0, 32, 30, 6, { 0, { (1<<MACH_BASE) } } },
{ FRV_F_SPR_L, "f-spr-l", 0, 32, 17, 6, { 0, { (1<<MACH_BASE) } } },
+ { FRV_F_SPR, "f-spr", 0, 0, 0, 0,{ 0|A(VIRTUAL), { (1<<MACH_BASE) } } },
{ FRV_F_LABEL16, "f-label16", 0, 32, 15, 16, { 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
{ FRV_F_LABELH6, "f-labelH6", 0, 32, 30, 6, { 0, { (1<<MACH_BASE) } } },
{ FRV_F_LABELL18, "f-labelL18", 0, 32, 17, 18, { 0, { (1<<MACH_BASE) } } },
+ { FRV_F_LABEL24, "f-label24", 0, 0, 0, 0,{ 0|A(PCREL_ADDR)|A(VIRTUAL), { (1<<MACH_BASE) } } },
{ FRV_F_ICCI_1_NULL, "f-ICCi_1-null", 0, 32, 11, 2, { 0|A(RESERVED), { (1<<MACH_BASE) } } },
{ FRV_F_ICCI_2_NULL, "f-ICCi_2-null", 0, 32, 26, 2, { 0|A(RESERVED), { (1<<MACH_BASE) } } },
{ FRV_F_ICCI_3_NULL, "f-ICCi_3-null", 0, 32, 1, 2, { 0|A(RESERVED), { (1<<MACH_BASE) } } },
@@ -1890,20 +1893,20 @@ const CGEN_MAYBE_MULTI_IFLD FRV_F_LABEL24_MULTI_IFIELD [];
const CGEN_MAYBE_MULTI_IFLD FRV_F_U12_MULTI_IFIELD [] =
{
- { 0, { (const PTR) &frv_cgen_ifld_table[46] } },
- { 0, { (const PTR) &frv_cgen_ifld_table[47] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_U12_H] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_U12_L] } },
{ 0, { (const PTR) 0 } }
};
const CGEN_MAYBE_MULTI_IFLD FRV_F_SPR_MULTI_IFIELD [] =
{
- { 0, { (const PTR) &frv_cgen_ifld_table[58] } },
- { 0, { (const PTR) &frv_cgen_ifld_table[59] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_SPR_H] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_SPR_L] } },
{ 0, { (const PTR) 0 } }
};
const CGEN_MAYBE_MULTI_IFLD FRV_F_LABEL24_MULTI_IFIELD [] =
{
- { 0, { (const PTR) &frv_cgen_ifld_table[61] } },
- { 0, { (const PTR) &frv_cgen_ifld_table[62] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_LABELH6] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_LABELL18] } },
{ 0, { (const PTR) 0 } }
};
@@ -1924,247 +1927,247 @@ const CGEN_OPERAND frv_cgen_operand_table[] =
{
/* pc: program counter */
{ "pc", FRV_OPERAND_PC, HW_H_PC, 0, 0,
- { 0, { (const PTR) &frv_cgen_ifld_table[0] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_NIL] } },
{ 0|A(SEM_ONLY), { (1<<MACH_BASE) } } },
/* pack: packing bit */
{ "pack", FRV_OPERAND_PACK, HW_H_PACK, 31, 1,
- { 0, { (const PTR) &frv_cgen_ifld_table[2] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_PACK] } },
{ 0, { (1<<MACH_BASE) } } },
/* GRi: source register 1 */
{ "GRi", FRV_OPERAND_GRI, HW_H_GR, 17, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[8] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_GRI] } },
{ 0, { (1<<MACH_BASE) } } },
/* GRj: source register 2 */
{ "GRj", FRV_OPERAND_GRJ, HW_H_GR, 5, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[9] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_GRJ] } },
{ 0, { (1<<MACH_BASE) } } },
/* GRk: destination register */
{ "GRk", FRV_OPERAND_GRK, HW_H_GR, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[10] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_GRK] } },
{ 0, { (1<<MACH_BASE) } } },
/* GRkhi: destination register */
{ "GRkhi", FRV_OPERAND_GRKHI, HW_H_GR_HI, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[10] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_GRK] } },
{ 0, { (1<<MACH_BASE) } } },
/* GRklo: destination register */
{ "GRklo", FRV_OPERAND_GRKLO, HW_H_GR_LO, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[10] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_GRK] } },
{ 0, { (1<<MACH_BASE) } } },
/* GRdoublek: destination register */
{ "GRdoublek", FRV_OPERAND_GRDOUBLEK, HW_H_GR_DOUBLE, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[10] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_GRK] } },
{ 0, { (1<<MACH_BASE) } } },
/* ACC40Si: signed accumulator */
{ "ACC40Si", FRV_OPERAND_ACC40SI, HW_H_ACC40S, 17, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[19] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_ACC40SI] } },
{ 0, { (1<<MACH_BASE) } } },
/* ACC40Ui: unsigned accumulator */
{ "ACC40Ui", FRV_OPERAND_ACC40UI, HW_H_ACC40U, 17, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[20] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_ACC40UI] } },
{ 0, { (1<<MACH_BASE) } } },
/* ACC40Sk: target accumulator */
{ "ACC40Sk", FRV_OPERAND_ACC40SK, HW_H_ACC40S, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[21] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_ACC40SK] } },
{ 0, { (1<<MACH_BASE) } } },
/* ACC40Uk: target accumulator */
{ "ACC40Uk", FRV_OPERAND_ACC40UK, HW_H_ACC40U, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[22] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_ACC40UK] } },
{ 0, { (1<<MACH_BASE) } } },
/* ACCGi: source register */
{ "ACCGi", FRV_OPERAND_ACCGI, HW_H_ACCG, 17, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[17] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_ACCGI] } },
{ 0, { (1<<MACH_BASE) } } },
/* ACCGk: target register */
{ "ACCGk", FRV_OPERAND_ACCGK, HW_H_ACCG, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[18] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_ACCGK] } },
{ 0, { (1<<MACH_BASE) } } },
/* CPRi: source register */
{ "CPRi", FRV_OPERAND_CPRI, HW_H_CPR, 17, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[14] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_CPRI] } },
{ 0, { (1<<MACH_FRV) } } },
/* CPRj: source register */
{ "CPRj", FRV_OPERAND_CPRJ, HW_H_CPR, 5, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[15] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_CPRJ] } },
{ 0, { (1<<MACH_FRV) } } },
/* CPRk: destination register */
{ "CPRk", FRV_OPERAND_CPRK, HW_H_CPR, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[16] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_CPRK] } },
{ 0, { (1<<MACH_FRV) } } },
/* CPRdoublek: destination register */
{ "CPRdoublek", FRV_OPERAND_CPRDOUBLEK, HW_H_CPR_DOUBLE, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[16] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_CPRK] } },
{ 0, { (1<<MACH_FRV) } } },
/* FRinti: source register 1 */
{ "FRinti", FRV_OPERAND_FRINTI, HW_H_FR_INT, 17, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[11] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FRI] } },
{ 0, { (1<<MACH_BASE) } } },
/* FRintj: source register 2 */
{ "FRintj", FRV_OPERAND_FRINTJ, HW_H_FR_INT, 5, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[12] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FRJ] } },
{ 0, { (1<<MACH_BASE) } } },
/* FRintk: target register */
{ "FRintk", FRV_OPERAND_FRINTK, HW_H_FR_INT, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[13] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FRK] } },
{ 0, { (1<<MACH_BASE) } } },
/* FRi: source register 1 */
{ "FRi", FRV_OPERAND_FRI, HW_H_FR, 17, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[11] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FRI] } },
{ 0, { (1<<MACH_BASE) } } },
/* FRj: source register 2 */
{ "FRj", FRV_OPERAND_FRJ, HW_H_FR, 5, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[12] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FRJ] } },
{ 0, { (1<<MACH_BASE) } } },
/* FRk: destination register */
{ "FRk", FRV_OPERAND_FRK, HW_H_FR, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[13] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FRK] } },
{ 0, { (1<<MACH_BASE) } } },
/* FRkhi: destination register */
{ "FRkhi", FRV_OPERAND_FRKHI, HW_H_FR_HI, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[13] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FRK] } },
{ 0, { (1<<MACH_BASE) } } },
/* FRklo: destination register */
{ "FRklo", FRV_OPERAND_FRKLO, HW_H_FR_LO, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[13] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FRK] } },
{ 0, { (1<<MACH_BASE) } } },
/* FRdoublei: source register 1 */
{ "FRdoublei", FRV_OPERAND_FRDOUBLEI, HW_H_FR_DOUBLE, 17, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[11] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FRI] } },
{ 0, { (1<<MACH_BASE) } } },
/* FRdoublej: source register 2 */
{ "FRdoublej", FRV_OPERAND_FRDOUBLEJ, HW_H_FR_DOUBLE, 5, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[12] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FRJ] } },
{ 0, { (1<<MACH_BASE) } } },
/* FRdoublek: target register */
{ "FRdoublek", FRV_OPERAND_FRDOUBLEK, HW_H_FR_DOUBLE, 30, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[13] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FRK] } },
{ 0, { (1<<MACH_BASE) } } },
/* CRi: source register 1 */
{ "CRi", FRV_OPERAND_CRI, HW_H_CCCR, 14, 3,
- { 0, { (const PTR) &frv_cgen_ifld_table[23] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_CRI] } },
{ 0, { (1<<MACH_BASE) } } },
/* CRj: source register 2 */
{ "CRj", FRV_OPERAND_CRJ, HW_H_CCCR, 2, 3,
- { 0, { (const PTR) &frv_cgen_ifld_table[24] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_CRJ] } },
{ 0, { (1<<MACH_BASE) } } },
/* CRj_int: destination register */
{ "CRj_int", FRV_OPERAND_CRJ_INT, HW_H_CCCR, 26, 2,
- { 0, { (const PTR) &frv_cgen_ifld_table[27] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_CRJ_INT] } },
{ 0, { (1<<MACH_BASE) } } },
/* CRj_float: destination register */
{ "CRj_float", FRV_OPERAND_CRJ_FLOAT, HW_H_CCCR, 26, 2,
- { 0, { (const PTR) &frv_cgen_ifld_table[28] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_CRJ_FLOAT] } },
{ 0, { (1<<MACH_BASE) } } },
/* CRk: destination register */
{ "CRk", FRV_OPERAND_CRK, HW_H_CCCR, 27, 3,
- { 0, { (const PTR) &frv_cgen_ifld_table[25] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_CRK] } },
{ 0, { (1<<MACH_BASE) } } },
/* CCi: condition register */
{ "CCi", FRV_OPERAND_CCI, HW_H_CCCR, 11, 3,
- { 0, { (const PTR) &frv_cgen_ifld_table[26] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_CCI] } },
{ 0, { (1<<MACH_BASE) } } },
/* ICCi_1: condition register */
{ "ICCi_1", FRV_OPERAND_ICCI_1, HW_H_ICCR, 11, 2,
- { 0, { (const PTR) &frv_cgen_ifld_table[29] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_ICCI_1] } },
{ 0, { (1<<MACH_BASE) } } },
/* ICCi_2: condition register */
{ "ICCi_2", FRV_OPERAND_ICCI_2, HW_H_ICCR, 26, 2,
- { 0, { (const PTR) &frv_cgen_ifld_table[30] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_ICCI_2] } },
{ 0, { (1<<MACH_BASE) } } },
/* ICCi_3: condition register */
{ "ICCi_3", FRV_OPERAND_ICCI_3, HW_H_ICCR, 1, 2,
- { 0, { (const PTR) &frv_cgen_ifld_table[31] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_ICCI_3] } },
{ 0, { (1<<MACH_BASE) } } },
/* FCCi_1: condition register */
{ "FCCi_1", FRV_OPERAND_FCCI_1, HW_H_FCCR, 11, 2,
- { 0, { (const PTR) &frv_cgen_ifld_table[32] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FCCI_1] } },
{ 0, { (1<<MACH_BASE) } } },
/* FCCi_2: condition register */
{ "FCCi_2", FRV_OPERAND_FCCI_2, HW_H_FCCR, 26, 2,
- { 0, { (const PTR) &frv_cgen_ifld_table[33] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FCCI_2] } },
{ 0, { (1<<MACH_BASE) } } },
/* FCCi_3: condition register */
{ "FCCi_3", FRV_OPERAND_FCCI_3, HW_H_FCCR, 1, 2,
- { 0, { (const PTR) &frv_cgen_ifld_table[34] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FCCI_3] } },
{ 0, { (1<<MACH_BASE) } } },
/* FCCk: condition register */
{ "FCCk", FRV_OPERAND_FCCK, HW_H_FCCR, 26, 2,
- { 0, { (const PTR) &frv_cgen_ifld_table[35] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FCCK] } },
{ 0, { (1<<MACH_BASE) } } },
/* eir: exception insn reg */
{ "eir", FRV_OPERAND_EIR, HW_H_UINT, 17, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[36] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_EIR] } },
{ 0, { (1<<MACH_BASE) } } },
/* s10: 10 bit signed immediate */
{ "s10", FRV_OPERAND_S10, HW_H_SINT, 9, 10,
- { 0, { (const PTR) &frv_cgen_ifld_table[37] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_S10] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* u16: 16 bit unsigned immediate */
{ "u16", FRV_OPERAND_U16, HW_H_UINT, 15, 16,
- { 0, { (const PTR) &frv_cgen_ifld_table[40] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_U16] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* s16: 16 bit signed immediate */
{ "s16", FRV_OPERAND_S16, HW_H_SINT, 15, 16,
- { 0, { (const PTR) &frv_cgen_ifld_table[41] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_S16] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* s6: 6 bit signed immediate */
{ "s6", FRV_OPERAND_S6, HW_H_SINT, 5, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[42] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_S6] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* s6_1: 6 bit signed immediate */
{ "s6_1", FRV_OPERAND_S6_1, HW_H_SINT, 11, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[43] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_S6_1] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* u6: 6 bit unsigned immediate */
{ "u6", FRV_OPERAND_U6, HW_H_UINT, 5, 6,
- { 0, { (const PTR) &frv_cgen_ifld_table[44] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_U6] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* s5: 5 bit signed immediate */
{ "s5", FRV_OPERAND_S5, HW_H_SINT, 4, 5,
- { 0, { (const PTR) &frv_cgen_ifld_table[45] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_S5] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* cond: conditional arithmetic */
{ "cond", FRV_OPERAND_COND, HW_H_UINT, 8, 1,
- { 0, { (const PTR) &frv_cgen_ifld_table[50] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_COND] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* ccond: lr branch condition */
{ "ccond", FRV_OPERAND_CCOND, HW_H_UINT, 12, 1,
- { 0, { (const PTR) &frv_cgen_ifld_table[51] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_CCOND] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* hint: 2 bit branch predictor */
{ "hint", FRV_OPERAND_HINT, HW_H_UINT, 17, 2,
- { 0, { (const PTR) &frv_cgen_ifld_table[52] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_HINT] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* hint_taken: 2 bit branch predictor */
{ "hint_taken", FRV_OPERAND_HINT_TAKEN, HW_H_HINT_TAKEN, 17, 2,
- { 0, { (const PTR) &frv_cgen_ifld_table[52] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_HINT] } },
{ 0, { (1<<MACH_BASE) } } },
/* hint_not_taken: 2 bit branch predictor */
{ "hint_not_taken", FRV_OPERAND_HINT_NOT_TAKEN, HW_H_HINT_NOT_TAKEN, 17, 2,
- { 0, { (const PTR) &frv_cgen_ifld_table[52] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_HINT] } },
{ 0, { (1<<MACH_BASE) } } },
/* LI: link indicator */
{ "LI", FRV_OPERAND_LI, HW_H_UINT, 25, 1,
- { 0, { (const PTR) &frv_cgen_ifld_table[53] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_LI] } },
{ 0, { (1<<MACH_BASE) } } },
/* lock: cache lock indicator */
{ "lock", FRV_OPERAND_LOCK, HW_H_UINT, 25, 1,
- { 0, { (const PTR) &frv_cgen_ifld_table[54] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_LOCK] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* debug: debug mode indicator */
{ "debug", FRV_OPERAND_DEBUG, HW_H_UINT, 25, 1,
- { 0, { (const PTR) &frv_cgen_ifld_table[55] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_DEBUG] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* A: all accumulator indicator */
{ "A", FRV_OPERAND_A, HW_H_UINT, 17, 1,
- { 0, { (const PTR) &frv_cgen_ifld_table[56] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_A] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* ae: all entries indicator */
{ "ae", FRV_OPERAND_AE, HW_H_UINT, 25, 1,
- { 0, { (const PTR) &frv_cgen_ifld_table[57] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_AE] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* label16: 18 bit pc relative address */
{ "label16", FRV_OPERAND_LABEL16, HW_H_IADDR, 15, 16,
- { 0, { (const PTR) &frv_cgen_ifld_table[60] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_LABEL16] } },
{ 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
/* label24: 26 bit pc relative address */
{ "label24", FRV_OPERAND_LABEL24, HW_H_IADDR, 17, 24,
@@ -2172,11 +2175,11 @@ const CGEN_OPERAND frv_cgen_operand_table[] =
{ 0|A(PCREL_ADDR)|A(VIRTUAL), { (1<<MACH_BASE) } } },
/* d12: 12 bit signed immediate */
{ "d12", FRV_OPERAND_D12, HW_H_SINT, 11, 12,
- { 0, { (const PTR) &frv_cgen_ifld_table[39] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_D12] } },
{ 0, { (1<<MACH_BASE) } } },
/* s12: 12 bit signed immediate */
{ "s12", FRV_OPERAND_S12, HW_H_SINT, 11, 12,
- { 0, { (const PTR) &frv_cgen_ifld_table[39] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_D12] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* u12: 12 bit signed immediate */
{ "u12", FRV_OPERAND_U12, HW_H_SINT, 5, 12,
@@ -2188,15 +2191,15 @@ const CGEN_OPERAND frv_cgen_operand_table[] =
{ 0|A(VIRTUAL), { (1<<MACH_BASE) } } },
/* ulo16: 16 bit unsigned immediate, for #lo() */
{ "ulo16", FRV_OPERAND_ULO16, HW_H_UINT, 15, 16,
- { 0, { (const PTR) &frv_cgen_ifld_table[40] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_U16] } },
{ 0, { (1<<MACH_BASE) } } },
/* slo16: 16 bit unsigned immediate, for #lo() */
{ "slo16", FRV_OPERAND_SLO16, HW_H_SINT, 15, 16,
- { 0, { (const PTR) &frv_cgen_ifld_table[41] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_S16] } },
{ 0, { (1<<MACH_BASE) } } },
/* uhi16: 16 bit unsigned immediate, for #hi() */
{ "uhi16", FRV_OPERAND_UHI16, HW_H_UINT, 15, 16,
- { 0, { (const PTR) &frv_cgen_ifld_table[40] } },
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_U16] } },
{ 0, { (1<<MACH_BASE) } } },
/* psr_esr: PSR.ESR bit */
{ "psr_esr", FRV_OPERAND_PSR_ESR, HW_H_PSR_ESR, 0, 0,
diff --git a/opcodes/frv-desc.h b/opcodes/frv-desc.h
index 893919fc2dc..53cad79079c 100644
--- a/opcodes/frv-desc.h
+++ b/opcodes/frv-desc.h
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/frv-opc.c b/opcodes/frv-opc.c
index 96325570a83..5e56e357645 100644
--- a/opcodes/frv-opc.c
+++ b/opcodes/frv-opc.c
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/frv-opc.h b/opcodes/frv-opc.h
index 266031b6419..018a64378d7 100644
--- a/opcodes/frv-opc.h
+++ b/opcodes/frv-opc.h
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 79faee676e5..be78e83fef1 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -1891,7 +1891,7 @@ print_insn (pc, info)
mode_64bit = (info->mach == bfd_mach_x86_64_intel_syntax
|| info->mach == bfd_mach_x86_64);
- if (intel_syntax == -1)
+ if (intel_syntax == (char) -1)
intel_syntax = (info->mach == bfd_mach_i386_i386_intel_syntax
|| info->mach == bfd_mach_x86_64_intel_syntax);
diff --git a/opcodes/ip2k-desc.c b/opcodes/ip2k-desc.c
index ab6f7bf732f..f8e493289fb 100644
--- a/opcodes/ip2k-desc.c
+++ b/opcodes/ip2k-desc.c
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
@@ -348,39 +348,39 @@ const CGEN_OPERAND ip2k_cgen_operand_table[] =
{
/* pc: program counter */
{ "pc", IP2K_OPERAND_PC, HW_H_PC, 0, 0,
- { 0, { (const PTR) &ip2k_cgen_ifld_table[0] } },
+ { 0, { (const PTR) &ip2k_cgen_ifld_table[IP2K_F_NIL] } },
{ 0|A(SEM_ONLY), { (1<<MACH_BASE) } } },
/* addr16cjp: 13-bit address */
{ "addr16cjp", IP2K_OPERAND_ADDR16CJP, HW_H_UINT, 12, 13,
- { 0, { (const PTR) &ip2k_cgen_ifld_table[4] } },
+ { 0, { (const PTR) &ip2k_cgen_ifld_table[IP2K_F_ADDR16CJP] } },
{ 0|A(ABS_ADDR), { (1<<MACH_BASE) } } },
/* fr: register */
{ "fr", IP2K_OPERAND_FR, HW_H_REGISTERS, 8, 9,
- { 0, { (const PTR) &ip2k_cgen_ifld_table[3] } },
+ { 0, { (const PTR) &ip2k_cgen_ifld_table[IP2K_F_REG] } },
{ 0|A(ABS_ADDR), { (1<<MACH_BASE) } } },
/* lit8: 8-bit signed literal */
{ "lit8", IP2K_OPERAND_LIT8, HW_H_SINT, 7, 8,
- { 0, { (const PTR) &ip2k_cgen_ifld_table[2] } },
+ { 0, { (const PTR) &ip2k_cgen_ifld_table[IP2K_F_IMM8] } },
{ 0, { (1<<MACH_BASE) } } },
/* bitno: bit number */
{ "bitno", IP2K_OPERAND_BITNO, HW_H_UINT, 11, 3,
- { 0, { (const PTR) &ip2k_cgen_ifld_table[6] } },
+ { 0, { (const PTR) &ip2k_cgen_ifld_table[IP2K_F_BITNO] } },
{ 0, { (1<<MACH_BASE) } } },
/* addr16p: page number */
{ "addr16p", IP2K_OPERAND_ADDR16P, HW_H_UINT, 2, 3,
- { 0, { (const PTR) &ip2k_cgen_ifld_table[16] } },
+ { 0, { (const PTR) &ip2k_cgen_ifld_table[IP2K_F_PAGE3] } },
{ 0, { (1<<MACH_BASE) } } },
/* addr16h: high 8 bits of address */
{ "addr16h", IP2K_OPERAND_ADDR16H, HW_H_UINT, 7, 8,
- { 0, { (const PTR) &ip2k_cgen_ifld_table[2] } },
+ { 0, { (const PTR) &ip2k_cgen_ifld_table[IP2K_F_IMM8] } },
{ 0, { (1<<MACH_BASE) } } },
/* addr16l: low 8 bits of address */
{ "addr16l", IP2K_OPERAND_ADDR16L, HW_H_UINT, 7, 8,
- { 0, { (const PTR) &ip2k_cgen_ifld_table[2] } },
+ { 0, { (const PTR) &ip2k_cgen_ifld_table[IP2K_F_IMM8] } },
{ 0, { (1<<MACH_BASE) } } },
/* reti3: reti flags */
{ "reti3", IP2K_OPERAND_RETI3, HW_H_UINT, 2, 3,
- { 0, { (const PTR) &ip2k_cgen_ifld_table[14] } },
+ { 0, { (const PTR) &ip2k_cgen_ifld_table[IP2K_F_RETI3] } },
{ 0, { (1<<MACH_BASE) } } },
/* pabits: page bits */
{ "pabits", IP2K_OPERAND_PABITS, HW_H_PABITS, 0, 0,
diff --git a/opcodes/ip2k-desc.h b/opcodes/ip2k-desc.h
index 74819ac81f2..84db7fb1cb0 100644
--- a/opcodes/ip2k-desc.h
+++ b/opcodes/ip2k-desc.h
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/ip2k-opc.c b/opcodes/ip2k-opc.c
index 691cc787351..5140cffcf1f 100644
--- a/opcodes/ip2k-opc.c
+++ b/opcodes/ip2k-opc.c
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/ip2k-opc.h b/opcodes/ip2k-opc.h
index 2f8a2e13eea..041cb04bc02 100644
--- a/opcodes/ip2k-opc.h
+++ b/opcodes/ip2k-opc.h
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/m32r-desc.c b/opcodes/m32r-desc.c
index 98fecb2650b..30a071985bd 100644
--- a/opcodes/m32r-desc.c
+++ b/opcodes/m32r-desc.c
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
@@ -320,67 +320,67 @@ const CGEN_OPERAND m32r_cgen_operand_table[] =
{
/* pc: program counter */
{ "pc", M32R_OPERAND_PC, HW_H_PC, 0, 0,
- { 0, { (const PTR) &m32r_cgen_ifld_table[0] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_NIL] } },
{ 0|A(SEM_ONLY), { (1<<MACH_BASE) } } },
/* sr: source register */
{ "sr", M32R_OPERAND_SR, HW_H_GR, 12, 4,
- { 0, { (const PTR) &m32r_cgen_ifld_table[6] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_R2] } },
{ 0, { (1<<MACH_BASE) } } },
/* dr: destination register */
{ "dr", M32R_OPERAND_DR, HW_H_GR, 4, 4,
- { 0, { (const PTR) &m32r_cgen_ifld_table[5] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_R1] } },
{ 0, { (1<<MACH_BASE) } } },
/* src1: source register 1 */
{ "src1", M32R_OPERAND_SRC1, HW_H_GR, 4, 4,
- { 0, { (const PTR) &m32r_cgen_ifld_table[5] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_R1] } },
{ 0, { (1<<MACH_BASE) } } },
/* src2: source register 2 */
{ "src2", M32R_OPERAND_SRC2, HW_H_GR, 12, 4,
- { 0, { (const PTR) &m32r_cgen_ifld_table[6] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_R2] } },
{ 0, { (1<<MACH_BASE) } } },
/* scr: source control register */
{ "scr", M32R_OPERAND_SCR, HW_H_CR, 12, 4,
- { 0, { (const PTR) &m32r_cgen_ifld_table[6] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_R2] } },
{ 0, { (1<<MACH_BASE) } } },
/* dcr: destination control register */
{ "dcr", M32R_OPERAND_DCR, HW_H_CR, 4, 4,
- { 0, { (const PTR) &m32r_cgen_ifld_table[5] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_R1] } },
{ 0, { (1<<MACH_BASE) } } },
/* simm8: 8 bit signed immediate */
{ "simm8", M32R_OPERAND_SIMM8, HW_H_SINT, 8, 8,
- { 0, { (const PTR) &m32r_cgen_ifld_table[7] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_SIMM8] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* simm16: 16 bit signed immediate */
{ "simm16", M32R_OPERAND_SIMM16, HW_H_SINT, 16, 16,
- { 0, { (const PTR) &m32r_cgen_ifld_table[8] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_SIMM16] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* uimm4: 4 bit trap number */
{ "uimm4", M32R_OPERAND_UIMM4, HW_H_UINT, 12, 4,
- { 0, { (const PTR) &m32r_cgen_ifld_table[10] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_UIMM4] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* uimm5: 5 bit shift count */
{ "uimm5", M32R_OPERAND_UIMM5, HW_H_UINT, 11, 5,
- { 0, { (const PTR) &m32r_cgen_ifld_table[11] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_UIMM5] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* uimm16: 16 bit unsigned immediate */
{ "uimm16", M32R_OPERAND_UIMM16, HW_H_UINT, 16, 16,
- { 0, { (const PTR) &m32r_cgen_ifld_table[12] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_UIMM16] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* imm1: 1 bit immediate */
{ "imm1", M32R_OPERAND_IMM1, HW_H_UINT, 15, 1,
- { 0, { (const PTR) &m32r_cgen_ifld_table[25] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_IMM1] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_M32RX) } } },
/* accd: accumulator destination register */
{ "accd", M32R_OPERAND_ACCD, HW_H_ACCUMS, 4, 2,
- { 0, { (const PTR) &m32r_cgen_ifld_table[22] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_ACCD] } },
{ 0, { (1<<MACH_M32RX) } } },
/* accs: accumulator source register */
{ "accs", M32R_OPERAND_ACCS, HW_H_ACCUMS, 12, 2,
- { 0, { (const PTR) &m32r_cgen_ifld_table[21] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_ACCS] } },
{ 0, { (1<<MACH_M32RX) } } },
/* acc: accumulator reg (d) */
{ "acc", M32R_OPERAND_ACC, HW_H_ACCUMS, 8, 1,
- { 0, { (const PTR) &m32r_cgen_ifld_table[20] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_ACC] } },
{ 0, { (1<<MACH_M32RX) } } },
/* hash: # prefix */
{ "hash", M32R_OPERAND_HASH, HW_H_SINT, 0, 0,
@@ -388,31 +388,31 @@ const CGEN_OPERAND m32r_cgen_operand_table[] =
{ 0, { (1<<MACH_BASE) } } },
/* hi16: high 16 bit immediate, sign optional */
{ "hi16", M32R_OPERAND_HI16, HW_H_HI16, 16, 16,
- { 0, { (const PTR) &m32r_cgen_ifld_table[14] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_HI16] } },
{ 0|A(SIGN_OPT), { (1<<MACH_BASE) } } },
/* slo16: 16 bit signed immediate, for low() */
{ "slo16", M32R_OPERAND_SLO16, HW_H_SLO16, 16, 16,
- { 0, { (const PTR) &m32r_cgen_ifld_table[8] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_SIMM16] } },
{ 0, { (1<<MACH_BASE) } } },
/* ulo16: 16 bit unsigned immediate, for low() */
{ "ulo16", M32R_OPERAND_ULO16, HW_H_ULO16, 16, 16,
- { 0, { (const PTR) &m32r_cgen_ifld_table[12] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_UIMM16] } },
{ 0, { (1<<MACH_BASE) } } },
/* uimm24: 24 bit address */
{ "uimm24", M32R_OPERAND_UIMM24, HW_H_ADDR, 8, 24,
- { 0, { (const PTR) &m32r_cgen_ifld_table[13] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_UIMM24] } },
{ 0|A(HASH_PREFIX)|A(RELOC)|A(ABS_ADDR), { (1<<MACH_BASE) } } },
/* disp8: 8 bit displacement */
{ "disp8", M32R_OPERAND_DISP8, HW_H_IADDR, 8, 8,
- { 0, { (const PTR) &m32r_cgen_ifld_table[15] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_DISP8] } },
{ 0|A(RELAX)|A(RELOC)|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
/* disp16: 16 bit displacement */
{ "disp16", M32R_OPERAND_DISP16, HW_H_IADDR, 16, 16,
- { 0, { (const PTR) &m32r_cgen_ifld_table[16] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_DISP16] } },
{ 0|A(RELOC)|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
/* disp24: 24 bit displacement */
{ "disp24", M32R_OPERAND_DISP24, HW_H_IADDR, 8, 24,
- { 0, { (const PTR) &m32r_cgen_ifld_table[17] } },
+ { 0, { (const PTR) &m32r_cgen_ifld_table[M32R_F_DISP24] } },
{ 0|A(RELAX)|A(RELOC)|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
/* condbit: condition bit */
{ "condbit", M32R_OPERAND_CONDBIT, HW_H_COND, 0, 0,
diff --git a/opcodes/m32r-desc.h b/opcodes/m32r-desc.h
index b099730d87a..85e22ee4dcd 100644
--- a/opcodes/m32r-desc.h
+++ b/opcodes/m32r-desc.h
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/m32r-opc.c b/opcodes/m32r-opc.c
index 5b20f4d17e5..b60c1bf36e0 100644
--- a/opcodes/m32r-opc.c
+++ b/opcodes/m32r-opc.c
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/m32r-opc.h b/opcodes/m32r-opc.h
index 0a69dc41821..22e6924b060 100644
--- a/opcodes/m32r-opc.h
+++ b/opcodes/m32r-opc.h
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/m32r-opinst.c b/opcodes/m32r-opinst.c
index f89c2307742..5365d15a734 100644
--- a/opcodes/m32r-opinst.c
+++ b/opcodes/m32r-opinst.c
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/openrisc-desc.c b/opcodes/openrisc-desc.c
index 5ec476622a1..6de9107f77b 100644
--- a/opcodes/openrisc-desc.c
+++ b/opcodes/openrisc-desc.c
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
@@ -242,6 +242,7 @@ const CGEN_IFLD openrisc_cgen_ifld_table[] =
{ OPENRISC_F_I16_2, "f-i16-2", 0, 32, 25, 5, { 0, { (1<<MACH_BASE) } } },
{ OPENRISC_F_DISP26, "f-disp26", 0, 32, 25, 26, { 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
{ OPENRISC_F_ABS26, "f-abs26", 0, 32, 25, 26, { 0|A(ABS_ADDR), { (1<<MACH_BASE) } } },
+ { OPENRISC_F_I16NC, "f-i16nc", 0, 0, 0, 0,{ 0|A(SIGN_OPT)|A(VIRTUAL), { (1<<MACH_BASE) } } },
{ OPENRISC_F_F_15_8, "f-f-15-8", 0, 32, 15, 8, { 0|A(RESERVED), { (1<<MACH_BASE) } } },
{ OPENRISC_F_F_10_3, "f-f-10-3", 0, 32, 10, 3, { 0|A(RESERVED), { (1<<MACH_BASE) } } },
{ OPENRISC_F_F_4_1, "f-f-4-1", 0, 32, 4, 1, { 0|A(RESERVED), { (1<<MACH_BASE) } } },
@@ -264,8 +265,8 @@ const CGEN_MAYBE_MULTI_IFLD OPENRISC_F_I16NC_MULTI_IFIELD [];
const CGEN_MAYBE_MULTI_IFLD OPENRISC_F_I16NC_MULTI_IFIELD [] =
{
- { 0, { (const PTR) &openrisc_cgen_ifld_table[19] } },
- { 0, { (const PTR) &openrisc_cgen_ifld_table[20] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_I16_1] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_I16_2] } },
{ 0, { (const PTR) 0 } }
};
@@ -286,7 +287,7 @@ const CGEN_OPERAND openrisc_cgen_operand_table[] =
{
/* pc: program counter */
{ "pc", OPENRISC_OPERAND_PC, HW_H_PC, 0, 0,
- { 0, { (const PTR) &openrisc_cgen_ifld_table[0] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_NIL] } },
{ 0|A(SEM_ONLY), { (1<<MACH_BASE) } } },
/* sr: special register */
{ "sr", OPENRISC_OPERAND_SR, HW_H_SR, 0, 0,
@@ -298,51 +299,51 @@ const CGEN_OPERAND openrisc_cgen_operand_table[] =
{ 0|A(SEM_ONLY), { (1<<MACH_BASE) } } },
/* simm-16: 16 bit signed immediate */
{ "simm-16", OPENRISC_OPERAND_SIMM_16, HW_H_SINT, 15, 16,
- { 0, { (const PTR) &openrisc_cgen_ifld_table[7] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_SIMM16] } },
{ 0, { (1<<MACH_BASE) } } },
/* uimm-16: 16 bit unsigned immediate */
{ "uimm-16", OPENRISC_OPERAND_UIMM_16, HW_H_UINT, 15, 16,
- { 0, { (const PTR) &openrisc_cgen_ifld_table[8] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_UIMM16] } },
{ 0, { (1<<MACH_BASE) } } },
/* disp-26: pc-rel 26 bit */
{ "disp-26", OPENRISC_OPERAND_DISP_26, HW_H_IADDR, 25, 26,
- { 0, { (const PTR) &openrisc_cgen_ifld_table[21] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_DISP26] } },
{ 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
/* abs-26: abs 26 bit */
{ "abs-26", OPENRISC_OPERAND_ABS_26, HW_H_IADDR, 25, 26,
- { 0, { (const PTR) &openrisc_cgen_ifld_table[22] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_ABS26] } },
{ 0|A(ABS_ADDR), { (1<<MACH_BASE) } } },
/* uimm-5: imm5 */
{ "uimm-5", OPENRISC_OPERAND_UIMM_5, HW_H_UINT, 4, 5,
- { 0, { (const PTR) &openrisc_cgen_ifld_table[9] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_UIMM5] } },
{ 0, { (1<<MACH_BASE) } } },
/* rD: destination register */
{ "rD", OPENRISC_OPERAND_RD, HW_H_GR, 25, 5,
- { 0, { (const PTR) &openrisc_cgen_ifld_table[4] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_R1] } },
{ 0, { (1<<MACH_BASE) } } },
/* rA: source register A */
{ "rA", OPENRISC_OPERAND_RA, HW_H_GR, 20, 5,
- { 0, { (const PTR) &openrisc_cgen_ifld_table[5] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_R2] } },
{ 0, { (1<<MACH_BASE) } } },
/* rB: source register B */
{ "rB", OPENRISC_OPERAND_RB, HW_H_GR, 15, 5,
- { 0, { (const PTR) &openrisc_cgen_ifld_table[6] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_R3] } },
{ 0, { (1<<MACH_BASE) } } },
/* op-f-23: f-op23 */
{ "op-f-23", OPENRISC_OPERAND_OP_F_23, HW_H_UINT, 23, 3,
- { 0, { (const PTR) &openrisc_cgen_ifld_table[15] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_OP4] } },
{ 0, { (1<<MACH_BASE) } } },
/* op-f-3: f-op3 */
{ "op-f-3", OPENRISC_OPERAND_OP_F_3, HW_H_UINT, 25, 5,
- { 0, { (const PTR) &openrisc_cgen_ifld_table[16] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_OP5] } },
{ 0, { (1<<MACH_BASE) } } },
/* hi16: high 16 bit immediate, sign optional */
{ "hi16", OPENRISC_OPERAND_HI16, HW_H_HI16, 15, 16,
- { 0, { (const PTR) &openrisc_cgen_ifld_table[7] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_SIMM16] } },
{ 0|A(SIGN_OPT), { (1<<MACH_BASE) } } },
/* lo16: low 16 bit immediate, sign optional */
{ "lo16", OPENRISC_OPERAND_LO16, HW_H_LO16, 15, 16,
- { 0, { (const PTR) &openrisc_cgen_ifld_table[11] } },
+ { 0, { (const PTR) &openrisc_cgen_ifld_table[OPENRISC_F_LO16] } },
{ 0|A(SIGN_OPT), { (1<<MACH_BASE) } } },
/* ui16nc: 16 bit immediate, sign optional */
{ "ui16nc", OPENRISC_OPERAND_UI16NC, HW_H_LO16, 10, 16,
diff --git a/opcodes/openrisc-desc.h b/opcodes/openrisc-desc.h
index a85930ed77e..d1edee2f51c 100644
--- a/opcodes/openrisc-desc.h
+++ b/opcodes/openrisc-desc.h
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/openrisc-opc.c b/opcodes/openrisc-opc.c
index 687996c0dde..943f4d5b7f7 100644
--- a/opcodes/openrisc-opc.c
+++ b/opcodes/openrisc-opc.c
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/openrisc-opc.h b/opcodes/openrisc-opc.h
index 494ba5c838c..bd8bb7c7bee 100644
--- a/opcodes/openrisc-opc.h
+++ b/opcodes/openrisc-opc.h
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/xstormy16-desc.c b/opcodes/xstormy16-desc.c
index 77d7613f4aa..9c9f30bc582 100644
--- a/opcodes/xstormy16-desc.c
+++ b/opcodes/xstormy16-desc.c
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
@@ -297,6 +297,7 @@ const CGEN_IFLD xstormy16_cgen_ifld_table[] =
{ XSTORMY16_F_REL12A, "f-rel12a", 0, 32, 4, 11, { 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
{ XSTORMY16_F_ABS24_1, "f-abs24-1", 0, 32, 8, 8, { 0, { (1<<MACH_BASE) } } },
{ XSTORMY16_F_ABS24_2, "f-abs24-2", 0, 32, 16, 16, { 0, { (1<<MACH_BASE) } } },
+ { XSTORMY16_F_ABS24, "f-abs24", 0, 0, 0, 0,{ 0|A(ABS_ADDR)|A(VIRTUAL), { (1<<MACH_BASE) } } },
{ 0, 0, 0, 0, 0, 0, {0, {0}} }
};
@@ -313,8 +314,8 @@ const CGEN_MAYBE_MULTI_IFLD XSTORMY16_F_ABS24_MULTI_IFIELD [];
const CGEN_MAYBE_MULTI_IFLD XSTORMY16_F_ABS24_MULTI_IFIELD [] =
{
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[34] } },
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[35] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_ABS24_1] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_ABS24_2] } },
{ 0, { (const PTR) 0 } }
};
@@ -335,7 +336,7 @@ const CGEN_OPERAND xstormy16_cgen_operand_table[] =
{
/* pc: program counter */
{ "pc", XSTORMY16_OPERAND_PC, HW_H_PC, 0, 0,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[0] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_NIL] } },
{ 0|A(SEM_ONLY), { (1<<MACH_BASE) } } },
/* psw-z8: */
{ "psw-z8", XSTORMY16_OPERAND_PSW_Z8, HW_H_Z8, 0, 0,
@@ -367,95 +368,95 @@ const CGEN_OPERAND xstormy16_cgen_operand_table[] =
{ 0|A(SEM_ONLY), { (1<<MACH_BASE) } } },
/* Rd: general register destination */
{ "Rd", XSTORMY16_OPERAND_RD, HW_H_GR, 12, 4,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[2] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_RD] } },
{ 0, { (1<<MACH_BASE) } } },
/* Rdm: general register destination */
{ "Rdm", XSTORMY16_OPERAND_RDM, HW_H_GR, 13, 3,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[3] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_RDM] } },
{ 0, { (1<<MACH_BASE) } } },
/* Rm: general register for memory */
{ "Rm", XSTORMY16_OPERAND_RM, HW_H_GR, 4, 3,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[4] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_RM] } },
{ 0, { (1<<MACH_BASE) } } },
/* Rs: general register source */
{ "Rs", XSTORMY16_OPERAND_RS, HW_H_GR, 8, 4,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[5] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_RS] } },
{ 0, { (1<<MACH_BASE) } } },
/* Rb: base register */
{ "Rb", XSTORMY16_OPERAND_RB, HW_H_RB, 17, 3,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[6] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_RB] } },
{ 0, { (1<<MACH_BASE) } } },
/* Rbj: base register for jump */
{ "Rbj", XSTORMY16_OPERAND_RBJ, HW_H_RBJ, 11, 1,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[7] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_RBJ] } },
{ 0, { (1<<MACH_BASE) } } },
/* bcond2: branch condition opcode */
{ "bcond2", XSTORMY16_OPERAND_BCOND2, HW_H_BRANCHCOND, 4, 4,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[9] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_OP2] } },
{ 0, { (1<<MACH_BASE) } } },
/* ws2: word size opcode */
{ "ws2", XSTORMY16_OPERAND_WS2, HW_H_WORDSIZE, 7, 1,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[11] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_OP2M] } },
{ 0, { (1<<MACH_BASE) } } },
/* bcond5: branch condition opcode */
{ "bcond5", XSTORMY16_OPERAND_BCOND5, HW_H_BRANCHCOND, 16, 4,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[18] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_OP5] } },
{ 0, { (1<<MACH_BASE) } } },
/* imm2: 2 bit unsigned immediate */
{ "imm2", XSTORMY16_OPERAND_IMM2, HW_H_UINT, 10, 2,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[21] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_IMM2] } },
{ 0, { (1<<MACH_BASE) } } },
/* imm3: 3 bit unsigned immediate */
{ "imm3", XSTORMY16_OPERAND_IMM3, HW_H_UINT, 4, 3,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[22] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_IMM3] } },
{ 0, { (1<<MACH_BASE) } } },
/* imm3b: 3 bit unsigned immediate for bit tests */
{ "imm3b", XSTORMY16_OPERAND_IMM3B, HW_H_UINT, 17, 3,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[23] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_IMM3B] } },
{ 0, { (1<<MACH_BASE) } } },
/* imm4: 4 bit unsigned immediate */
{ "imm4", XSTORMY16_OPERAND_IMM4, HW_H_UINT, 8, 4,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[24] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_IMM4] } },
{ 0, { (1<<MACH_BASE) } } },
/* imm8: 8 bit unsigned immediate */
{ "imm8", XSTORMY16_OPERAND_IMM8, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[25] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_IMM8] } },
{ 0, { (1<<MACH_BASE) } } },
/* imm8small: 8 bit unsigned immediate */
{ "imm8small", XSTORMY16_OPERAND_IMM8SMALL, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[25] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_IMM8] } },
{ 0, { (1<<MACH_BASE) } } },
/* imm12: 12 bit signed immediate */
{ "imm12", XSTORMY16_OPERAND_IMM12, HW_H_SINT, 20, 12,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[26] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_IMM12] } },
{ 0, { (1<<MACH_BASE) } } },
/* imm16: 16 bit immediate */
{ "imm16", XSTORMY16_OPERAND_IMM16, HW_H_UINT, 16, 16,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[27] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_IMM16] } },
{ 0|A(SIGN_OPT), { (1<<MACH_BASE) } } },
/* lmem8: 8 bit unsigned immediate low memory */
{ "lmem8", XSTORMY16_OPERAND_LMEM8, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[28] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_LMEM8] } },
{ 0|A(ABS_ADDR), { (1<<MACH_BASE) } } },
/* hmem8: 8 bit unsigned immediate high memory */
{ "hmem8", XSTORMY16_OPERAND_HMEM8, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[29] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_HMEM8] } },
{ 0|A(ABS_ADDR), { (1<<MACH_BASE) } } },
/* rel8-2: 8 bit relative address */
{ "rel8-2", XSTORMY16_OPERAND_REL8_2, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[30] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_REL8_2] } },
{ 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
/* rel8-4: 8 bit relative address */
{ "rel8-4", XSTORMY16_OPERAND_REL8_4, HW_H_UINT, 8, 8,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[31] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_REL8_4] } },
{ 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
/* rel12: 12 bit relative address */
{ "rel12", XSTORMY16_OPERAND_REL12, HW_H_UINT, 20, 12,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[32] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_REL12] } },
{ 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
/* rel12a: 12 bit relative address */
{ "rel12a", XSTORMY16_OPERAND_REL12A, HW_H_UINT, 4, 11,
- { 0, { (const PTR) &xstormy16_cgen_ifld_table[33] } },
+ { 0, { (const PTR) &xstormy16_cgen_ifld_table[XSTORMY16_F_REL12A] } },
{ 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
/* abs24: 24 bit absolute address */
{ "abs24", XSTORMY16_OPERAND_ABS24, HW_H_UINT, 8, 24,
@@ -1118,6 +1119,11 @@ static const CGEN_IBASE xstormy16_cgen_insn_table[MAX_INSNS] =
XSTORMY16_INSN_DIVLH, "divlh", "divlh", 16,
{ 0, { (1<<MACH_BASE) } }
},
+/* reset */
+ {
+ XSTORMY16_INSN_RESET, "reset", "reset", 16,
+ { 0, { (1<<MACH_BASE) } }
+ },
/* nop */
{
XSTORMY16_INSN_NOP, "nop", "nop", 16,
diff --git a/opcodes/xstormy16-desc.h b/opcodes/xstormy16-desc.h
index fe18a1374e0..a880321f759 100644
--- a/opcodes/xstormy16-desc.h
+++ b/opcodes/xstormy16-desc.h
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
diff --git a/opcodes/xstormy16-opc.c b/opcodes/xstormy16-opc.c
index 90db6f0ca12..34c0b0ea7f6 100644
--- a/opcodes/xstormy16-opc.c
+++ b/opcodes/xstormy16-opc.c
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
@@ -910,6 +910,12 @@ static const CGEN_OPCODE xstormy16_cgen_insn_opcode_table[MAX_INSNS] =
{ { MNEM, 0 } },
& ifmt_iret, { 0xe0 }
},
+/* reset */
+ {
+ { 0, 0, 0, 0 },
+ { { MNEM, 0 } },
+ & ifmt_iret, { 0xf }
+ },
/* nop */
{
{ 0, 0, 0, 0 },
diff --git a/opcodes/xstormy16-opc.h b/opcodes/xstormy16-opc.h
index fbe7fe11438..f2366cac697 100644
--- a/opcodes/xstormy16-opc.h
+++ b/opcodes/xstormy16-opc.h
@@ -2,7 +2,7 @@
THIS FILE IS MACHINE GENERATED WITH CGEN.
-Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
@@ -67,8 +67,9 @@ typedef enum cgen_insn_type {
, XSTORMY16_INSN_CALLRGR, XSTORMY16_INSN_CALLRIMM, XSTORMY16_INSN_CALLGR, XSTORMY16_INSN_CALLFIMM
, XSTORMY16_INSN_ICALLRGR, XSTORMY16_INSN_ICALLGR, XSTORMY16_INSN_ICALLFIMM, XSTORMY16_INSN_IRET
, XSTORMY16_INSN_RET, XSTORMY16_INSN_MUL, XSTORMY16_INSN_DIV, XSTORMY16_INSN_SDIV
- , XSTORMY16_INSN_SDIVLH, XSTORMY16_INSN_DIVLH, XSTORMY16_INSN_NOP, XSTORMY16_INSN_HALT
- , XSTORMY16_INSN_HOLD, XSTORMY16_INSN_HOLDX, XSTORMY16_INSN_BRK, XSTORMY16_INSN_SYSCALL
+ , XSTORMY16_INSN_SDIVLH, XSTORMY16_INSN_DIVLH, XSTORMY16_INSN_RESET, XSTORMY16_INSN_NOP
+ , XSTORMY16_INSN_HALT, XSTORMY16_INSN_HOLD, XSTORMY16_INSN_HOLDX, XSTORMY16_INSN_BRK
+ , XSTORMY16_INSN_SYSCALL
} CGEN_INSN_TYPE;
/* Index of `invalid' insn place holder. */
diff --git a/opcodes/z8k-dis.c b/opcodes/z8k-dis.c
index 6c1913892c8..69d1792312a 100644
--- a/opcodes/z8k-dis.c
+++ b/opcodes/z8k-dis.c
@@ -209,11 +209,13 @@ z8k_lookup_instr (nibbles, info)
int nibl_index, tabl_index;
int nibl_matched;
+ int need_fetch = 0;
unsigned short instr_nibl;
unsigned short tabl_datum, datum_class, datum_value;
nibl_matched = 0;
tabl_index = 0;
+ FETCH_DATA (info, 4);
while (!nibl_matched && z8k_table[tabl_index].name)
{
nibl_matched = 1;
@@ -222,8 +224,15 @@ z8k_lookup_instr (nibbles, info)
nibl_index++)
{
if ((nibl_index % 4) == 0)
- /* Fetch one word at a time. */
- FETCH_DATA (info, nibl_index + 4);
+ {
+ /* Fetch data only if it isn't already there. */
+ if (nibl_index >= 4 || (nibl_index < 4 && need_fetch))
+ FETCH_DATA (info, nibl_index + 4); /* Fetch one word at a time. */
+ if (nibl_index < 4)
+ need_fetch = 0;
+ else
+ need_fetch = 1;
+ }
instr_nibl = nibbles[nibl_index];
tabl_datum = z8k_table[tabl_index].byte_info[nibl_index];
@@ -414,14 +423,14 @@ unpack_instr (instr_data, is_segmented, info)
FETCH_DATA (info, nibl_count + 8);
instr_long = (instr_data->words[nibl_count] << 16)
| (instr_data->words[nibl_count + 4]);
- instr_data->address = ((instr_word & 0x7f00) << 8)
+ instr_data->address = ((instr_word & 0x7f00) << 16)
+ (instr_long & 0xffff);
nibl_count += 7;
seg_length = 2;
}
else
{
- instr_data->address = ((instr_word & 0x7f00) << 8)
+ instr_data->address = ((instr_word & 0x7f00) << 16)
+ (instr_word & 0x00ff);
nibl_count += 3;
}
@@ -484,6 +493,13 @@ unpack_instr (instr_data, is_segmented, info)
}
}
+static char *intr_names[] = {
+ "all", /* 0 */
+ "vi", /* 1 */
+ "nvi", /* 2 */
+ "none" /* 3 */
+};
+
static void
unparse_instr (instr_data, is_segmented)
instr_data_s *instr_data;
@@ -536,6 +552,12 @@ unparse_instr (instr_data, is_segmented)
strcat (out_str, tmp_str);
break;
case CLASS_IMM:
+ if (datum_value == ARG_IMM2) /* True with EI/DI instructions only. */
+ {
+ sprintf (tmp_str, "%s", intr_names[instr_data->interrupts]);
+ strcat (out_str, tmp_str);
+ break;
+ }
sprintf (tmp_str, "#0x%0lx", instr_data->immediate);
strcat (out_str, tmp_str);
break;
diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog
index 54d84e6b028..3256284ad41 100644
--- a/sim/d10v/ChangeLog
+++ b/sim/d10v/ChangeLog
@@ -1,3 +1,15 @@
+2003-05-07 Andrew Cagney <cagney@redhat.com>
+
+ * interp.c (sim_d10v_translate_addr): Add "regcache" parameter.
+ (sim_d10v_translate_imap_addr): Ditto.
+ (sim_d10v_translate_dmap_addr): Ditto.
+ (xfer_mem): Pass NULL regcache to sim_d10v_translate_addr.
+ (dmem_addr): Pass NULL regcache to sim_d10v_translate_dmap_addr.
+ (dmap_register, imap_register): Add "regcache" parameter.
+ (imem_addr): Pass NULL regcache to sim_d10v_translate_imap_addr.
+ (sim_fetch_register): Pass NULL regcache to imap_register and
+ dmap_register.
+
2003-02-27 Andrew Cagney <cagney@redhat.com>
* interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c
index 718acca9936..30239ab0247 100644
--- a/sim/d10v/interp.c
+++ b/sim/d10v/interp.c
@@ -363,7 +363,7 @@ set_dmap_register (int reg_nr, unsigned long value)
}
static unsigned long
-dmap_register (int reg_nr)
+dmap_register (void *regcache, int reg_nr)
{
uint8 *raw = map_memory (SIM_D10V_MEMORY_DATA
+ DMAP0_OFFSET + 2 * reg_nr);
@@ -386,7 +386,7 @@ set_imap_register (int reg_nr, unsigned long value)
}
static unsigned long
-imap_register (int reg_nr)
+imap_register (void *regcache, int reg_nr)
{
uint8 *raw = map_memory (SIM_D10V_MEMORY_DATA
+ IMAP0_OFFSET + 2 * reg_nr);
@@ -440,7 +440,9 @@ unsigned long
sim_d10v_translate_dmap_addr (unsigned long offset,
int nr_bytes,
unsigned long *phys,
- unsigned long (*dmap_register) (int reg_nr))
+ void *regcache,
+ unsigned long (*dmap_register) (void *regcache,
+ int reg_nr))
{
short map;
int regno;
@@ -457,7 +459,7 @@ sim_d10v_translate_dmap_addr (unsigned long offset,
/* Don't cross a BLOCK boundary */
nr_bytes = DMAP_BLOCK_SIZE - (offset % DMAP_BLOCK_SIZE);
}
- map = dmap_register (regno);
+ map = dmap_register (regcache, regno);
if (regno == 3)
{
/* Always maps to data memory */
@@ -498,7 +500,9 @@ unsigned long
sim_d10v_translate_imap_addr (unsigned long offset,
int nr_bytes,
unsigned long *phys,
- unsigned long (*imap_register) (int reg_nr))
+ void *regcache,
+ unsigned long (*imap_register) (void *regcache,
+ int reg_nr))
{
short map;
int regno;
@@ -517,7 +521,7 @@ sim_d10v_translate_imap_addr (unsigned long offset,
/* Don't cross a BLOCK boundary */
nr_bytes = IMAP_BLOCK_SIZE - offset;
}
- map = imap_register (regno);
+ map = imap_register (regcache, regno);
sp = (map & 0x3000) >> 12;
segno = (map & 0x007f);
switch (sp)
@@ -549,8 +553,11 @@ unsigned long
sim_d10v_translate_addr (unsigned long memaddr,
int nr_bytes,
unsigned long *targ_addr,
- unsigned long (*dmap_register) (int reg_nr),
- unsigned long (*imap_register) (int reg_nr))
+ void *regcache,
+ unsigned long (*dmap_register) (void *regcache,
+ int reg_nr),
+ unsigned long (*imap_register) (void *regcache,
+ int reg_nr))
{
unsigned long phys;
unsigned long seg;
@@ -614,12 +621,12 @@ sim_d10v_translate_addr (unsigned long memaddr,
break;
case 0x10: /* in logical data address segment */
- nr_bytes = sim_d10v_translate_dmap_addr (off, nr_bytes, &phys,
+ nr_bytes = sim_d10v_translate_dmap_addr (off, nr_bytes, &phys, regcache,
dmap_register);
break;
case 0x11: /* in logical instruction address segment */
- nr_bytes = sim_d10v_translate_imap_addr (off, nr_bytes, &phys,
+ nr_bytes = sim_d10v_translate_imap_addr (off, nr_bytes, &phys, regcache,
imap_register);
break;
@@ -720,10 +727,8 @@ xfer_mem (SIM_ADDR virt,
uint8 *memory;
unsigned long phys;
int phys_size;
- phys_size = sim_d10v_translate_addr (virt, size,
- &phys,
- dmap_register,
- imap_register);
+ phys_size = sim_d10v_translate_addr (virt, size, &phys, NULL,
+ dmap_register, imap_register);
if (phys_size == 0)
return xfered;
@@ -892,7 +897,7 @@ dmem_addr (uint16 offset)
things like ``0xfffe + 0x0e60 == 0x10e5d''. Since offset's type
is uint16 this is modulo'ed onto 0x0e5d. */
- phys_size = sim_d10v_translate_dmap_addr (offset, 1, &phys,
+ phys_size = sim_d10v_translate_dmap_addr (offset, 1, &phys, NULL,
dmap_register);
if (phys_size == 0)
{
@@ -919,7 +924,8 @@ imem_addr (uint32 offset)
{
unsigned long phys;
uint8 *mem;
- int phys_size = sim_d10v_translate_imap_addr (offset, 1, &phys, imap_register);
+ int phys_size = sim_d10v_translate_imap_addr (offset, 1, &phys, NULL,
+ imap_register);
if (phys_size == 0)
{
return State.mem.fault;
@@ -1367,14 +1373,14 @@ sim_fetch_register (sd, rn, memory, length)
break;
case SIM_D10V_IMAP0_REGNUM:
case SIM_D10V_IMAP1_REGNUM:
- WRITE_16 (memory, imap_register (rn - SIM_D10V_IMAP0_REGNUM));
+ WRITE_16 (memory, imap_register (NULL, rn - SIM_D10V_IMAP0_REGNUM));
size = 2;
break;
case SIM_D10V_DMAP0_REGNUM:
case SIM_D10V_DMAP1_REGNUM:
case SIM_D10V_DMAP2_REGNUM:
case SIM_D10V_DMAP3_REGNUM:
- WRITE_16 (memory, dmap_register (rn - SIM_D10V_DMAP0_REGNUM));
+ WRITE_16 (memory, dmap_register (NULL, rn - SIM_D10V_DMAP0_REGNUM));
size = 2;
break;
case SIM_D10V_TS2_DMAP_REGNUM:
diff --git a/sim/igen/ChangeLog b/sim/igen/ChangeLog
index b36e4f00445..db27cb80712 100644
--- a/sim/igen/ChangeLog
+++ b/sim/igen/ChangeLog
@@ -1,3 +1,7 @@
+2003-05-03 Chris Demetriou <cgd@broadcom.com>
+
+ * compare_igen_models: Tweak attribution slightly.
+
2002-11-22 Andrew Cagney <cagney@redhat.com>
* gen.c (name_cmp): Rename format_name_cmp.
diff --git a/sim/igen/compare_igen_models b/sim/igen/compare_igen_models
index 3c3e46ac3e4..a842be9e355 100755
--- a/sim/igen/compare_igen_models
+++ b/sim/igen/compare_igen_models
@@ -2,7 +2,7 @@
# Script to compare functions and instructions used by different igen models.
# Copyright (C) 2002 Free Software Foundation, Inc.
-# Contributed by Broadcom Corporation (SiByte).
+# Contributed by Chris Demetriou of Broadcom Corporation (SiByte).
#
# This file is part of GDB, the GNU debugger.
#
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index 2d344b5f3d0..a5b2b02ab33 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,3 +1,12 @@
+2003-05-03 Chris Demetriou <cgd@broadcom.com>
+
+ * cp1.c: Tweak attribution slightly.
+ * cp1.h: Likewise.
+ * mdmx.c: Likewise.
+ * mdmx.igen: Likewise.
+ * mips3d.igen: Likewise.
+ * sb1.igen: Likewise.
+
2003-04-15 Richard Sandiford <rsandifo@redhat.com>
* vr.igen (do_vr_mul_op): Zero-extend the low 32 bits of
diff --git a/sim/mips/cp1.c b/sim/mips/cp1.c
index ea0f5998115..556af1abc45 100644
--- a/sim/mips/cp1.c
+++ b/sim/mips/cp1.c
@@ -1,9 +1,10 @@
/*> cp1.c <*/
/* MIPS Simulator FPU (CoProcessor 1) support.
Copyright (C) 2002 Free Software Foundation, Inc.
- Originally created by Cygnus Solutions, modified substially
- by Broadcom Corporation (SiByte). Paired-single operation support
- and MIPS-3D support contributed by Broadcom Corporation (SiByte).
+ Originally created by Cygnus Solutions. Extensive modifications,
+ including paired-single operation support and MIPS-3D support
+ contributed by Ed Satterthwaite and Chris Demetriou, of Broadcom
+ Corporation (SiByte).
This file is part of GDB, the GNU debugger.
diff --git a/sim/mips/cp1.h b/sim/mips/cp1.h
index 24901d8b75a..9a189a9305e 100644
--- a/sim/mips/cp1.h
+++ b/sim/mips/cp1.h
@@ -2,7 +2,8 @@
/* MIPS Simulator FPU (CoProcessor 1) definitions.
Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc.
Derived from sim-main.h contributed by Cygnus Solutions,
- modified substially by Broadcom Corporation (SiByte).
+ modified substantially by Ed Satterthwaite of Broadcom Corporation
+ (SiByte).
This file is part of GDB, the GNU debugger.
diff --git a/sim/mips/mdmx.c b/sim/mips/mdmx.c
index 4955e821246..3af59b06dcb 100644
--- a/sim/mips/mdmx.c
+++ b/sim/mips/mdmx.c
@@ -1,6 +1,7 @@
/* Simulation code for the MIPS MDMX ASE.
Copyright (C) 2002 Free Software Foundation, Inc.
- Contributed by Broadcom Corporation (SiByte).
+ Contributed by Ed Satterthwaite and Chris Demetriou, of Broadcom
+ Corporation (SiByte).
This file is part of GDB, the GNU debugger.
diff --git a/sim/mips/mdmx.igen b/sim/mips/mdmx.igen
index f286e3b4ab4..d8edcd74b4b 100644
--- a/sim/mips/mdmx.igen
+++ b/sim/mips/mdmx.igen
@@ -2,7 +2,8 @@
// Simulator definition for the MIPS MDMX ASE.
// Copyright (C) 2002 Free Software Foundation, Inc.
-// Contributed by Broadcom Corporation (SiByte).
+// Contributed by Ed Satterthwaite and Chris Demetriou, of Broadcom
+// Corporation (SiByte).
//
// This file is part of GDB, the GNU debugger.
//
diff --git a/sim/mips/mips3d.igen b/sim/mips/mips3d.igen
index f7043efcac0..d24a06c06cb 100644
--- a/sim/mips/mips3d.igen
+++ b/sim/mips/mips3d.igen
@@ -2,7 +2,8 @@
// Simulator definition for the MIPS MIPS-3D ASE.
// Copyright (C) 2002 Free Software Foundation, Inc.
-// Contributed by Broadcom Corporation (SiByte).
+// Contributed by Ed Satterthwaite and Chris Demetriou, of Broadcom
+// Corporation (SiByte).
//
// This file is part of GDB, the GNU debugger.
//
diff --git a/sim/mips/sb1.igen b/sim/mips/sb1.igen
index 6453670b1d6..33c5141e776 100644
--- a/sim/mips/sb1.igen
+++ b/sim/mips/sb1.igen
@@ -2,7 +2,8 @@
// Simulator definition for the Broadcom SiByte SB-1 CPU extensions.
// Copyright (C) 2002 Free Software Foundation, Inc.
-// Contributed by Broadcom Corporation (SiByte).
+// Contributed by Ed Satterthwaite and Chris Demetriou, of Broadcom
+// Corporation (SiByte).
//
// This file is part of GDB, the GNU debugger.
//
diff --git a/src-release b/src-release
index b5eca52505e..2b8fa45c054 100644
--- a/src-release
+++ b/src-release
@@ -48,7 +48,8 @@ DEVO_SUPPORT= README Makefile.in configure configure.in \
mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
mkinstalldirs ltconfig ltmain.sh missing ylwrap \
- libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh
+ libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh \
+ Makefile.def Makefile.tpl src-release
# Files in devo/etc used in any net release.
# ChangeLog omitted because it may refer to files which are not in this